struts2---Introduction
(1)首先要下载和安装Struts的包
(2)Web.xml文件中要加入这段配置:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
(3)要配置struts.xml文件
(4)Struts2的开发模式设置:
修改struts.xml配置文件:
Java代码
<constant name="struts.devMode" value="true"/>
<constant name="struts.devMode" value="true"/>
引用
true为开发模式,false为生产模式
(1)首先要下载和安装Struts的包
(2)Web.xml文件中要加入这段配置:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
(3)要配置struts.xml文件
(4)Struts2的开发模式设置:
修改struts.xml配置文件:
Java代码
<constant name="struts.devMode" value="true"/>
<constant name="struts.devMode" value="true"/>
引用
true为开发模式,false为生产模式