weizijia 2005年03月20日
struts问题严重
问题提示信息:
404 Not Found
/userup.do was not found on this server.
--------------------------------------------------------------------------------
Resin 2.1.10 (built Wed Jun 18 09:16:53 PDT 2003)
Action代码如下:
public class User_U_Action
extends Action {
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {

/**@todo: complete the business logic here, this is just a skeleton.*/
User_ActionForm user_ActionForm = (User_ActionForm) actionForm;
HttpSession session = httpServletRequest.getSession(); //得到session
String name;
name = (String) session.getAttribute("username");
//从session里取出username付给name

String pass = user_ActionForm.getPassword();
//得到密码
String sex = httpServletRequest.getParameter("ser");
String age = httpServletRequest.getParameter("age");
String age2 = httpServletRequest.getParameter("age2");
String age3 = httpServletRequest.getParameter("age3");
//年龄
String paper = httpServletRequest.getParameter("paper");
//证件号
String papertyp = httpServletRequest.getParameter("paperTyp");
//证件类型
String place = httpServletRequest.getParameter("place");
//住址
String phone = httpServletRequest.getParameter("phone");
//电话
String phonetyp = httpServletRequest.getParameter("phoneTyp");
// 电话类型
String ema = httpServletRequest.getParameter("ema");
//E-Mail
//得到提交过来的数据
String ageone = new String(age + "-" + age2 + "-" + age3);
//年龄和
User_Work work = new User_Work();
int x = work.Update(name,pass,sex,ageone,paper,papertyp,place,phone,phonetyp,ema);
if(x==0)
{return actionMapping.findForward("upok");}
else if (x==1)
{return actionMapping.findForward("err1");}
else{return actionMapping.findForward("err2");//跳转页面
}
struts-config.xml如下
<action input="/UserWork_Up.jsp" name="user_ActionForm" path="/userup" scope="session" type="useraction.User_U_Action">
<forward name="upok" path="/upok.htm" />
<forward name="err1" path="/error.jsp" />
<forward name="err2" path="/error.jsp" />
</action>
...全文
107 点赞 收藏 7
写回复
7 条回复

还没有回复,快来抢沙发~

发动态
发帖子
Java EE
创建于2007-09-28

3.7w+

社区成员

22.5w+

社区内容

J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区公告
暂无公告