项目添加Struts2支持,并修改默认后缀
2012-12-21 22:20
453 查看
方式一:
使用MyEclipse提供的项目构建组件,选择AddStruts capabilities,选择Struts2.1版本,然后把拦截类型改为 /*
方式二:
使用MyEclipse添加Struts2的库,然后修改web.xml,添加struts2提供的过滤器StrutsPrepareAndExecuteFilter
在src下创建struts.xml,添加constant节点,配置struts.action.extension属性为需要修改的后缀,如 html
使用MyEclipse提供的项目构建组件,选择AddStruts capabilities,选择Struts2.1版本,然后把拦截类型改为 /*
方式二:
使用MyEclipse添加Struts2的库,然后修改web.xml,添加struts2提供的过滤器StrutsPrepareAndExecuteFilter
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <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>
在src下创建struts.xml,添加constant节点,配置struts.action.extension属性为需要修改的后缀,如 html
<?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="html"/> <package name="default" extends="struts-default" namespace="/"> </package> </struts>
相关文章推荐
- Java web项目添加Struts2支持的步骤
- React-Native 在iOS9之后,网络请求默认为Https请求,如需支持Http,修改info.plist文件添加键值对设置允许http访问。
- 将应用程序添加到gnome3的全局菜单中(并支持修改为默认程序)
- struts2修改默认后缀
- 如何修改Tomcat的默认主页为你自己项目的主页
- 如何修改TOMCAT的默认主页为自己项目的主页
- 修改Grails项目中的默认端口号
- 二.maven的项目创建格式及修改Repository的默认路径设置
- oracle 添加表分区和索引分区,修改索引分区默认表空间
- Android8.0 修改默认铃声 添加新铃声
- Redis笔记(三)添加密码并修改默认端口后的主从同步
- tomcat默认启动项目修改
- 使用chsh修改默认的shell为bash,原来为sh不支持TAB等功能
- maven项目中修改默认显示jre版本
- Maven 修改默认JDK版本和指定项目JDK版本
- tomcat 修改默认主页为自己项目的主页
- 在QT项目中添加对研华数采模块的支持
- 使用Spring Boot开发Web项目(二)之添加HTTPS支持
- centos 7.0 修改ssh默认连接22端口 和 添加防火墙firewalld 通过端口
- Eclipse使用Maven tomcat:run命令启动web项目时修改默认端口