- 浏览: 18514 次
最新评论
防止struts-config.xml文件膨胀_LoginOtherAction.java
- 博客分类:
- Struts
public class LoginOtherAction extends Action{
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest requert,HttpServletResponse response){
UserForm actionForm = (UserForm)form;
String userId = actionForm.getUserId();
String passWord = actionForm.getPassWord();
String user = "hill";
String pass = "33";
ActionMessages actionMessage= new ActionMessages();
if(!user.equals(userId)){
ActionMessage a= new ActionMessage("user name is wrong",userId);
actionMessage.add("userId", a);
// saveErrors();
return mapping.findForward("fail");
}
if(!pass.equals(passWord)){
ActionMessage a= new ActionMessage("password is wrong",userId);
actionMessage.add("password", a);
// saveErrors();
return mapping.findForward("fail");
}
return mapping.findForward("sucess");
}
}
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest requert,HttpServletResponse response){
UserForm actionForm = (UserForm)form;
String userId = actionForm.getUserId();
String passWord = actionForm.getPassWord();
String user = "hill";
String pass = "33";
ActionMessages actionMessage= new ActionMessages();
if(!user.equals(userId)){
ActionMessage a= new ActionMessage("user name is wrong",userId);
actionMessage.add("userId", a);
// saveErrors();
return mapping.findForward("fail");
}
if(!pass.equals(passWord)){
ActionMessage a= new ActionMessage("password is wrong",userId);
actionMessage.add("password", a);
// saveErrors();
return mapping.findForward("fail");
}
return mapping.findForward("sucess");
}
}
发表评论
-
<html:link> <html:rewrite>区别
2011-11-20 22:13 881<html:link> 生成的是一个超链接: &l ... -
<htmk:link>的使用
2011-11-20 21:56 735<html:link action="/Reg ... -
struts中的整数转换器问题
2011-10-12 23:13 0画面入力项显示的是"",点击提交按钮后也显 ... -
防止表单重复提交的原理与struts的实现
2011-10-10 06:59 594第一个action: public class RegUser ... -
<html:checkbox>标签使用时要重写reset方法
2011-10-09 22:24 1084<html:checkbox property=&quo ... -
errors参数国际化
2011-10-09 07:21 518prompt.name=(en)username error. ... -
表单校验和业务逻辑校验
2011-10-09 06:53 999表单校验:请求参数->ActionForm->Ac ... -
html_errors标签单独显示各个错误消息
2011-10-08 22:00 1205public class UserForm extends A ... -
html_errors标签引入国际化资源包
2011-10-07 21:20 915public class UserForm extends A ... -
FormBean使用值对象类型的属性
2011-10-06 20:54 877public class UserForm extends A ... -
<logic:forward>与<logic:redirect>区别
2011-09-29 23:11 15171 .<logic:forward>属于程序内部访 ... -
<htmk:forward>对应在struts-config.xml中应配置全局的forward
2011-09-29 22:34 712当你想访问http://localhost:9999/stru ... -
<htmk:link>自动生成sessionId,支持url重写
2011-09-29 07:11 712当客户端向服务器发送一请求时,服务器不知道客户端是否支持coo ... -
防止struts-config.xml文件膨胀_OtherActionForm.java
2011-09-29 22:34 559public class OtherActionForm ex ... -
防止struts-config.xml文件膨胀_hello.jsp
2011-09-27 22:12 628<%@ page contentType="t ... -
防止struts-config.xml文件膨胀_struts-config.xml
2011-09-27 22:10 448<?xml version="1.0" ...
相关推荐
struts-config.xml struts标准配置文件 struts-config
Struts框架中struts-config.xml文件配置小结
struts-config.xml配置文件对学struts的人必备的查找资料。
struts-config.xml配置文件 struts-config.xml配置文件 struts-config.xml配置文件
struts-config.xml配置文件详解
Struts-config.xml配置详解,介绍Struts-config中8个元素配置方法。
韩顺平视频配套struts-config.xml配置详解.txt
配置 struts-config.xml 元素 属性的详解!转载来的,,看着很好!》希望对大家有用!
struts-config.xml 详解struts-config.xml 详解
这个strut-config配置详解是韩顺平老师指定的 很多同学都看过韩老师的视频或者上过韩老师的课程吧
SSH之Struts1之struts-config.xml常用配置详解(3-21-2008)
struts-config.xml 文件详解 以下是一份完整的struts-config.xml文件,配置元素的说明详见注释.
struts-2.0.11.2_EN_US.CHM 参考文档 struts-2.0.11.2_EN_US.CHM 参考文档 struts-2.0.11.2_EN_US.CHM 参考文档
Struts-config.xml 配置详解.doc Struts-config.xml 配置详解.doc
J2EE项目开发 struts-config.xml文件的配置
【Struts1.2总结】struts-config.xml配置
struts2-core-2.0.1.jar, struts2-core-2.0.11.1.jar, struts2-core-2.0.11.2.jar, struts2-core-2.0.11.jar, struts2-core-2.0.12.jar, struts2-core-2.0.14.jar, struts2-core-2.0.5.jar, struts2-core-2.0.6.jar,...
J2EE struts框架开发struts-config.xml配置