Struts2的配置
来源:互联网 发布:淘宝假冒品牌处罚 编辑:程序博客网 时间:2024/06/08 01:16
好的Struts2配置可以帮助开发,出现bug可以更快的解决
- web.xml
- struts.xml
- struts.properties
web.xml
留一个备份,每次建项目时,拷贝即可。或者依赖IDE自动生成,如IDEA
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> <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></web-app>
struts.xml
<constant name="struts.devMode" value="true"/>
一个很有用的配置
比较没有打开和打开的错误信息
打开
区别比较大,但是有些时候打开开发模式,也会有像没打开那样给出简略的错误信息
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"><!--suppress ALL --><struts> <!--设置开发模式 浏览器错误发生时显示更多信息--> <constant name="struts.devMode" value="true"/> <package name="abstract-test" extends="struts-default" abstract="true"> </package> <package name="default" extends="struts-default" namespace="/"> <action name="error" class="org.pikachu.action.ErrorAction"> <result name="success">/index.jsp</result> </action> </package></struts>
struts.properties
struts.configuration.xml.reload=true
打开后很方便 自动重新加载struts.xml文件
#这个挺有用的修改struts.xml后不用重启服务器(更新即可) 包括包含的文件改变struts.configuration.xml.reload=true#默认居然是关闭的 允许使用动态调用 如 user!loginstruts.enable.DynamicMethodInvocation=true
0 0
- struts2-struts2的基本配置
- Struts2的配置
- struts2 常量的配置
- Struts2的零配置
- struts2的配置
- struts2的配置
- struts2的基本配置
- struts2的配置
- Struts2基本的配置
- Struts2的基本配置
- Struts2的入门配置
- struts2的配置
- struts2的配置
- STRUTS2的Action配置
- struts2的配置
- Struts2的配置方法
- STRUTS2的常用配置
- struts2配置的问题
- 定制椭圆形状
- 使用Servlet+jsp构建MVC体系结构的Web应用
- Different Ways to Add Parentheses 不同的添加括号的方式
- leetcode #83 in cpp
- Crossin先生的微信打飞机游戏(3)
- Struts2的配置
- 让CodeReview成为一种团队习惯
- http://my.oschina.net/u/2352897/blog
- codeforces 645C
- 语音信号去混响原理与技术
- 谈cookie和session
- HDU 1372 Knight Moves (BFS)
- HDU--2048 错排问题
- TI协议栈例程GenericApp SampleApp SimpleAp 区别