在MyEclipse8.5下初次配置struts2

来源:互联网 发布:无线网络优化方案 编辑:程序博客网 时间:2024/05/21 10:57

1. http://struts.apache.org/ 下载struts2

2.将下载好的struts2包解压(我下载的是struts2.2.3),再把struts-2.2.3\apps\struts2-blank.war解压,然后把struts2-blank\WEB-INF\classes里的struts.xml 复制到建立的web project 的src目录下,等编译后系统会默认放入projectWEB-INF\classes目录里

3.struts-2.2.3\apps\struts2-blank\WEB-INF\lib目录下的*.jar复制到web project下的WEB-INF\lib里

4.struts-2.2.3\apps\struts2-blank\WEB-INF下的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>

复制到WebRoot下的web.xml


然后再做相应的改动就行。

原创粉丝点击