struts2配置
<?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.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<jsp-config>
<taglib>
<taglib-uri>struts2</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tags.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>
以上为web.xml中代码,运行后tomcat找不到该项目,项目已经加载并在tomcat的文件夹下存在,错误信息:
HTTP Status 404 - /cityInfo/
--------------------------------------------------------------------------------
type Status report
message /cityInfo/
description The requested resource (/cityInfo/) is not available.
希望高手指点!!!!!!
搜索更多相关主题的帖子:
filter xml version
----------------解决方案--------------------------------------------------------
回复 楼主 wu_leiaaa
打开你的struts核心包。看你配置的路径对不对。现在能看出你用的老式的配置
找下包对不对
如下图,我的是新配置
所以我的配置是这个
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
----------------解决方案--------------------------------------------------------
看看
----------------解决方案--------------------------------------------------------