| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 422 人关注过本帖
标题:[求助]为什么用struts2.0的默认 jsp页面发送请求不知道传到什么地方去了
只看楼主 加入收藏
penjew
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2007-10-23
收藏
 问题点数:0 回复次数:4 
[求助]为什么用struts2.0的默认 jsp页面发送请求不知道传到什么地方去了
这是JSP页面的原代码:
<%@ page language="java" pageEncoding="utf-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<html:base />

<title>updateradicate.jsp</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

</head>

<body>
<html:form action="radicateAction?r=queryAll">
<table border="0">
<html:hidden property="rid" />
<tr>
<td>
项目名称:
</td>
<td>
<html:text property="name" />
</td>
</tr>
<tr>
<td>
项目类型:
</td>
<td>
<html:text property="type" />
</td>
</tr>
<tr>
<td>
用户名称:
</td>
<td>

<html:text property="uname" />
</td>
</tr>
<tr>
<td>
客户名称:
</td>
<td>

<html:text property="cname" />
</td>
</tr>
<tr>
<td>
总金额:
</td>
<td>
<html:text property="saleMoney" />
</td>
</tr>
<tr>
<td>
开发周期:
</td>
<td>
<html:text property="periods" />
</td>
</tr>
<tr>
<td>
预算费用:
</td>
<td>
<html:text property="budgerMoney" />
</td>
</tr>

<tr>
<td>
立项时间:
</td>
<td>
<html:text property="liDate" />
</td>
</tr>
<tr>
<td>
大概利润:
</td>
<td>
<html:text property="gainMoney" />
</td>
</tr>




<tr>
<td colspan="2" align="center">
<html:submit>更新项目</html:submit>
</td>
<td>
<html:reset>重置</html:reset>
</td>
</tr>
</table>
</html:form>
</body>
</html:html>


下面是action代码:
package com.aptech.pz.struts.action;

import java.sql.Connection;
import java.sql.Statement;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import org.hibernate.Session;

import com.aptech.hbm.HibernateSessionFactory;
import com.aptech.pz.service.IRadicateService;
import com.aptech.pz.service.RadicateService;
import com.aptech.pz.struts.form.RadicateForm;
import com.aptech.pz.vo.RadicateVo;

import com.aptech.tools.ConsoleDate;

public class RadicateAction extends DispatchAction {

private IRadicateService rservice = new RadicateService();

public ActionForward queryAll(ActionMapping mapping, ActionForm action,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
List<RadicateVo> listvo = rservice.queryAll();
request.setAttribute("list", listvo);
return new ActionForward("/radicatelist.jsp");
}

public ActionForward loadRadicate(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
RadicateForm radicateform = (RadicateForm) form;
String strid = request.getParameter("rid");
int rid = Integer.parseInt(strid);

RadicateVo rvo = rservice.loadRadicate(rid);

radicateform.setRid(rid);
radicateform.setName(rvo.getName());
radicateform.setType(rvo.getType());
radicateform.setCid(rvo.getCid());
radicateform.setUid(rvo.getUid());

radicateform.setCname(rvo.getCname());
radicateform.setUname(rvo.getUname());
radicateform.setSaleMoney(rvo.getSaleMoney());
radicateform.setBudgerMoney(rvo.getBudgerMoney());
radicateform.setLiDate(ConsoleDate.String2Date(rvo.getLiDate()));

radicateform.setPeople(rvo.getPeople());
radicateform.setPeriods(rvo.getPeriods());
radicateform.setGainMoney(rvo.getGainMoney());

return new ActionForward("/updateradicate.jsp");
}

public ActionForward updateRadicate(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
RadicateForm radicateForm = (RadicateForm) form;
String strid = request.getParameter("rid");


int rid = Integer.parseInt(strid);
RadicateVo rvo = rservice.loadRadicate(rid);
System.out.println(radicateForm.getCid());


rvo.setRid(rid); rvo.setName(radicateForm.getName());
rvo.setType(radicateForm.getType());
rvo.setCid(radicateForm.getCid());
rvo.setCname(radicateForm.getCname());

rvo.setUid(radicateForm.getUid());
rvo.setUname(radicateForm.getUname());
rvo.setSaleMoney(radicateForm.getSaleMoney());
rvo.setPeriods(radicateForm.getPeriods());
rvo.setBudgerMoney(radicateForm.getBudgerMoney());

rvo.setLiDate(ConsoleDate.Date2String(radicateForm.getLiDate()));
rvo.setPeople(radicateForm.getPeople());
rvo.setGainMoney(radicateForm.getGainMoney());





rservice.updateRadicate(rvo);

return new ActionForward("/radicateAction.do?r=queryAll");
}

public ActionForward deleteRadicate(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
RadicateForm radicateform = (RadicateForm) form;
String strid = request.getParameter("rid");
int rid = Integer.parseInt(strid);

RadicateVo rvo = rservice.loadRadicate(rid);

rservice.deleteRadicate(rvo.getRid());
System.out.println("删除项目成功!!!");
return new ActionForward("/radicateAction.do?r=queryAll");
}
}


不知道怎么搞的,当点更新的时时候就不知道请求发送到那里去了,搞了好久都没搞出来,请教各位大虾
搜索更多相关主题的帖子: jsp 页面 请求 
2007-10-23 14:50
penjew
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2007-10-23
收藏
得分:0 
出现的异常是这个呢,就是不知道为什么,我明明写的是updateRadicate
上面jsp的<form action="">是不对的,因为我改来改去,忘记改回来了
各位,帮忙看看是什么原因


javax.servlet.ServletException: BeanUtils.populate
650)this.style.width=650;"> at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:805)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.aptech.filter.SessionFilter.doFilter(SessionFilter.java:32)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
2007-10-24 00:22
penjew
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2007-10-23
收藏
得分:0 
大哥,不是吧,怎么没人回答呢

帮忙看一下是什么原因啊
2007-10-25 15:23
penjew
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2007-10-23
收藏
得分:0 
这个问题真的很难吗
2007-10-25 15:36
penjew
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2007-10-23
收藏
得分:0 
知道问题在那里了,原来 ActionForm 不可以用 Date 类型的,如果用了改成String 就可以了

这个问题还真不知道,才知道,
2007-10-30 18:27
快速回复:[求助]为什么用struts2.0的默认 jsp页面发送请求不知道传到什么地方去 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.079842 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved