Struts2 struts 2中未找到资源错误
我试图使用struts执行一个基本的web应用程序,但没有发现任何资源错误,甚至无法显示index.jsp文件。我该怎么办 下面是我的web.xml文件 web.xmlStruts2 struts 2中未找到资源错误,struts2,Struts2,我试图使用struts执行一个基本的web应用程序,但没有发现任何资源错误,甚至无法显示index.jsp文件。我该怎么办 下面是我的web.xml文件 web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID"
version="3.1">
<display-name>Struts2Starter</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>sturts2</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>
<?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>
<package name="default" namespace = "/tutorials" extends="struts-default">
<action name="getTutorial" class = "com.struts.TutoralAction" >
<result name = "success">/success.jsp</result>
<result name = "failure">/failure.jsp</result>
</action>
</package>
</struts>
不知道——你没有提供任何人可以用来帮助你的信息。检查您的配置和服务器日志。很抱歉Dave以前没有提供代码。您现在能找到错误是什么吗?您应该添加您调用操作的确切方式以及返回的确切错误。
package com.struts;
import com.struts.service.TutorialService;
public class TutoralAction {
private String bestTutorial;
public String execute() {
TutorialService tutorialService = new TutorialService();
setBestTutorial(tutorialService.getBestTutorial());
return "success";
}
public String getBestTutorial() {
return bestTutorial;
}
public void setBestTutorial(String bestTutorial) {
this.bestTutorial = bestTutorial;
}
}