使用Struts-config八大元素时,不需要全部写上。
若写全的话,必须遵从以下顺序,否则,会出错。。
<struts-config>
<!--数据源-->
<data-sources />
<!--bean对象(dto)-->
<form-beans>
<form-bean name="userForm" type="com.t59.struts.form.UserForm" />
</form-beans>
<!--全局异常-->
<global-exceptions />
<!--全局转向-->
<global-forwards />
<!--文件映射-->
<action-mappings>
<action attribute="userForm" input="/index.jsp" name="userForm" parameter="param" path="/user" scope="request" type="com.t59.struts.action.UserAction">
<!--转发-->
<forward name="show" path="/show.jsp" />
<!--重定向-->
<forward name="error" path="/error.jsp" redirect="true" />
</action>
</action-mappings>
<!--控制器-->
<controller></controller>
<!--资源文件-->
<message-resources parameter="com.t59.struts.ApplicationResources" />
<!--插件注册-->
<plug-in className=""></plug-in>
</struts-config>
Struts 配置文件八大元素
最新推荐文章于 2011-12-23 19:34:26 发布