用了很久的S2了,发现自己用到的地方还少了。对S2的了解仅存于皮毛。还需要继续学习。

下面是struts.xml一个简单配置,以备后查!

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>

<!-- 怎么由.action改为.do -->
<!-- <constant name="struts.action.extension" value="do" />-->
<!-- do或action -->
<constant name="struts.action.extension" value="do,action" />

<!-- truts2用来指定默认编码的-->
<constant name="struts.i18n.encoding" value="UTF-8" />

<!-- 改变常量后不许重启服务器 ,系统默认为false-->
<constant name="struts.configuration.xml.reload" value="true" />

<!-- 便于排错,打印出更详细的错误信息-->
<constant name="struts.devMode" value="true" />

<!-- 设置浏览器是否缓存静态内容,默认为TRUE 开发阶段最好关闭-->
<constant name="struts.server.static.browserCache" value="false" />

<!-- 默认的视图主题-->
<constant name="struts.ui.theme" value="simple" />

<!-- 与spring集成时,指定spring负责action对象的创建-->
<!-- <struts name="struts.objectFactory" value="spring" />-->

<!-- 上传文件大小限制-->
<!-- <struts name="struts.multipart.maxSize" value="10241024" />-->

<package name="struts2" extends="struts-default">

<action name="msg" class="com.alpha.actiom.Action">
<result>/index.jsp</result>
</action>

</package>
</struts>