修改struts2的action的后缀名
来源:互联网 发布:linux ip地址拒绝访问 编辑:程序博客网 时间:2024/05/16 00:33
首先在 web.xml 配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name></display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<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>*.do</url-pattern>
<url-pattern>*.action</url-pattern>
</filter-mapping></web-app>
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name></display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<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>*.do</url-pattern>
<url-pattern>*.action</url-pattern>
</filter-mapping></web-app>
其次在 struts.xml 配置如下
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.action.extension" value="do,action"/>
<package name="login" extends="struts-default" namespace="/">
<action name="login*" class="code.common.action.LoginAction" method="login_{1}">
<result name="success">/page/default/login_success.jsp</result>
<result name="failure">/page/default/login_failure.jsp</result>
</action>
</package>
</struts>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.action.extension" value="do,action"/>
<package name="login" extends="struts-default" namespace="/">
<action name="login*" class="code.common.action.LoginAction" method="login_{1}">
<result name="success">/page/default/login_success.jsp</result>
<result name="failure">/page/default/login_failure.jsp</result>
</action>
</package>
</struts>
0 0
- struts2修改action的后缀名
- 修改struts2的.action后缀名
- 修改struts2的.action后缀名
- 修改struts2的.action后缀名
- 修改struts2的action的后缀名
- struts2修改action访问时的后缀名
- 修改Struts2的后缀名
- struts2中后缀名.action的更改以及何时该加后缀名,何时不用加
- struts2 action 扩展名的修改
- struts2 修改action的后缀
- Struts2 Action扩展名的修改
- struts2 修改action的后缀
- (搜藏)更改struts2的访问后缀名.action为.do或者其他的
- 更改struts2的访问后缀名.action为.do或者其他的
- Struts2 action的扩展名修改方法
- 批量修改图片的后缀名
- [struts2]Struts2 Action扩展名的三种修改方法
- struts2 去掉或修改后缀名
- 外链对网站的影响
- Ubuntu下设置adb环境变量
- 谷歌Chrome DevTools浅析
- VirtualBox配置CentOS7的共享文件夹
- Cocos2d-JS快速入门一
- 修改struts2的action的后缀名
- MemStoreChunkPool&MSLAB提升HBASE GC性能
- 集成 admob Banner广告出错之二 _OBJC_CLASS_$_EKEvent
- Cocos2d-JS 快速入门二 HelloWord
- 【Leetcode】Binary Tree Level Order Traversal (Tree Traversal)
- Python中字符串的解压缩
- NSUnknownKeyException
- 80 port system
- Oracle表维护 快速备份删除数据