<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"><struts-config>
  <form-beans>
    <form-bean name="logonForm" 
      type="org.apache.struts.validator.DynaValidatorForm">
      <form-property name="username" type="java.lang.String"/>
      <form-property name="password" type="java.lang.String"/>
    </form-bean>
  </form-beans>  <global-forwards>
    <forward   name="success"              path="/main.jsp"/>
    <forward   name="logoff"               path="/logoff.do"/>
  </global-forwards>  <action-mappings>
    <action    path="/logon"
               type="org.monotonous.struts.LogonAction"
               name="logonForm"
               scope="session"
               input="logon">
    </action>    <action    path="/logoff"
               type="org.monotonous.struts.LogoffAction">
      <forward name="success"              path="/index.jsp"/>
    </action>
  </action-mappings>  <controller>
    <!-- The "input" parameter on "action" elements is the name of a
         local or global "forward" rather than a module-relative path -->
    <set-property property="inputForward" value="true"/>
  </controller>  <message-resources parameter="org.monotonous.struts.ApplicationResources"/>
</struts-config>

解决方案 »

  1.   

    楼上的,把struts config贴出来,这个就是动态form??
      

  2.   

    呵呵,是因为楼主说“尤其是怎样配struts-config.xml”嘛
    注意里面的:  <form-beans>
        <form-bean name="logonForm" 
          type="org.apache.struts.validator.DynaValidatorForm">
          <form-property name="username" type="java.lang.String"/>
          <form-property name="password" type="java.lang.String"/>
        </form-bean>
      </form-beans>
      

  3.   

    打倒 zcjl() ,和我抢分。哼我今晚睡不着了。
      

  4.   

    在Action里取动态form的属性值:String username = (String) PropertyUtils.getSimpleProperty(form, "username");
    String password = (String) PropertyUtils.getSimpleProperty(form, "password");
      

  5.   

    ^_^
    这个帖子在这里这么久
    呆鸟都不来回复
    我都看着实在过意不去了
    就把当初学struts从网上抄的例子贴出来给楼主作个参考对了,我想申请当斑竹,不知道该去找那位大人?嘿嘿
    想借这个机会把用到的东西总结一下
    也让呆鸟和各位老鸟给指点一二
      

  6.   

    好啊。
    你发消息给
    http://expert.csdn.net/Message_Board/Send.asp?sendto=wjmmml
    http://expert.csdn.net/Message_Board/Send.asp?sendto=beyond_xiruo
    他们,先走一下后门。
    然后再发个贴,请支持者Up一下。好像超过50人,还是什么的。我马上注册马甲帮你UP嘿嘿。。
      

  7.   

    干脆。我先在这里表示支持!呆鸟拿着扬声器,站在板凳上,大声喊:“呆鸟全力支持 zcjl(啄木鸟)当Java Enterprise Open Source的版主,请大家踊跃举4脚支持”!弟兄们,看你们表态了。
      

  8.   

    大家,各位,谢谢ing o^-^o