Cookbook-struts1.3.8案例分析-Simple Form using DynaActionForm
l Simple Form using DynaActionForm
入口Action配置
<action path="/prepareDyna" type="examples.SuccessAction">
<forward name="success" path="/jsp/dyna/Dyna.jsp" />
</action>
<action path="/processDyna"
type="examples.dyna.ProcessDynaAction" name="dynaForm"
scope="request" input="/jsp/dyna/Dyna.jsp" validate="false">
<forward name="success" path="/jsp/dyna/DynaResults.jsp" />
</action>
|
SuccessActiony,与Simple Form using ActionForm的一致
Form Jsp页面里用到的标签,与Simple Form using ActionForm的一致
ActionForm类的定义,用xml定义
<form-bean name="dynaForm"
type="org.apache.struts.action.DynaActionForm">
<form-property name="name" type="java.lang.String" />
<form-property name="secret" type="java.lang.String" />
<form-property name="color" type="java.lang.String" />
<form-property name="confirm" type="java.lang.Boolean" />
<form-property name="rating" type="java.lang.String" />
<form-property name="message" type="java.lang.String" />
<form-property name="hidden" type="java.lang.String" />
</form-bean>
|
Result JSP里用到的标签,与Simple Form using ActionForm的一致
*最后说明,这个例子没有作验证,验证参考validate的例子