VIRGIN FOREST OF JAVA
不要埋头苦干,要学习,学习,再学习。。。。。
powered by R.Zeus

1。   type="com.yourcompany.struts.DemoAction" name="DemoForm"
   scope="request" input="/index.jsp" />

一个DemoForm(继承 ActionForm)对应一个DemoAction( extends Action)必须实现 execute
  (ActionMapping mapping,ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)

里面的ActionForm form对应DemoForm;

2。DemoForm里面的validate(ActionMapping mapping,HttpServletRequest request)验证;

不通过转向 input="/index.jsp" /;

否则由 type="com.yourcompany.struts.DemoAction" 验证!

3
    user:
   

   name="UserForm" scope="request" input="/failedIn.do" />

html:form对应action="/user.do">对应UserForm"

property对应UserForm"里的属性!

还可添加reset(ActionMapping mapiping,HttpServletRequest request)

 

4


    logic:present:
   


   
   

判断userbean是否存在!存在则显示后面的内容!

5 web.xml
tomcat 启动时加载,servlet类,类中对象保存在httpcontext中,即application范围内,所有组件可共享。

1这句话不能缺少!!!!!!!!!!!

6. "/>

前一句多了个空格,导致严重错误!!!!!!!!!!!

7.DynaActionForm f = (DynaActionForm) form;
  String[] s = (String[]) f.getMap().get("results");
注意getMap部分
posted on 2005-08-04 04:07 R.Zeus 阅读(341) 评论(0)  编辑  收藏 所属分类: STRUTS

只有注册用户登录后才能发表评论。


网站导航: