我配置的Tomcat+Strtus为什么运行不起来
运行http://localhost:8080调试时提示:
The requested resource () is not available.
配置信息如下:
Tomcat中的conf/server.xml已定位到网站目录
<Context path="" docBase="C:\News\WebRoot\" reloadable="true" crossContext="true"></Context>
在C:\News\WebRoot\WEB-INF\web.xml配置如下
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Struts2</display-name>
<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>*.action</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>/index.action</welcome-file>
</welcome-file-list>
</web-app>
在C:\News\WebRoot\WEB-INF\classes\struts.xml代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="default" extends="struts-default" namespace="/">
<action name="index" class="net.abc.www.index" method="GoHomePage">
<result name="success">/index.jsp</result>
</action>
</package>
</struts>
在index.java中代码如下,已建包,在MyEclipse6.5.0 GA调试编译没问题
package net.abc.www;
public class index {
public String GoHomePage()
{
return "success";
}
}
咋办呢?
struts
tomcat
myeclipse
------解决方案--------------------提示是你的filter错误“
严重: Error filterStart”,看看你得Struts2的相关Jar包是否正确放到lib目录下面了。