<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"> <struts-config> <data-sources /> <!-- 在此注册ActionForm --> <form-beans> <!-- name:名称 type:类路径 --> <form-bean name="queryForm" type="com.action.QueryForm" /> </form-beans> <global-exceptions /> <!-- 设置URL逻辑名称(全局,任意的Action都可以识别到)--> <global-forwards> <forward name="RESULT" path="/queryResult.jsp"></forward> </global-forwards> <!-- 注册Action --> <action-mappings> <!-- type:类路径; name:相应的ActionForm的名称; path:客户端提交到服务器端时指定的路径 --> <action name="queryForm" path="/query" type="com.action.QueryAction"> <!-- 设置URL逻辑名称(局部,只有这个Action可以识别到)--> <forward name="RESULT" path="/queryResult.jsp"></forward> </action> </action-mappings> <message-resources parameter="com.struts.ApplicationResources" /> </struts-config>
Struts1中struts-config.xml配置
最新推荐文章于 2021-01-05 14:06:59 发布