1
스트럿츠 2 주석 자바와 함께 작동하지 않습니다 (8) (8)스트럿츠 2 주석 자바 작동하지
나는 것 같아요 다음 Java 7 일 예,하지만 자바 8에 오류를 제공
이 오류는 라이브러리 및 Java 8과 관련이 있습니다.
누구든지이 문제가 있습니까 ?? 그렇다면 우리는 어떻게 그것을 해결합니까 ??? 나는이 예제는 자바 7 성공적으로 작동하고 자바 (8) 및 아파치 톰캣 (8)
와 스트럿 2.3.15.1를 사용하고
은 2.3.15.1 스트럿과 아파치 톰캣 (8) 난 그냥 모두를 테스트했다.
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
<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>
TestAction.java
package action;
import org.apache.struts2.convention.annotation.Result;
@Result(name="success", location="/test.jsp")
public class TestAction {
public String execute() {
return "success";
}
}
에게 test.jsp를
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Test Successful!</h1>
</body>
</html>
을
> HTTP Status 404 - There is no Action mapped for namespace [/] and
> action name [test] associated with context path [/s2demo].
의 web.xml : 내가 자바 (8)을 사용하고 때
는 다음과 같은 오류를 제공합니다이 프로젝트에 포함 된
라이브러리는 다음과 같습니다
asm-3.3.jar
asm-commons-3.3.jar
asm-tree-3.3.jar
commons-beanutils-1.8.0.jar
commons-digester-2.0.jar
commons-fileupload-1.3.jar
commons-io-2.0.1.jar
commons-lang3-3.1.jar
commons-logging-1.1.3.jar
files.txt
freemarker-2.3.19.jar
javassist-3.11.0.GA.jar
log4j-1.2.17.jar
ognl-3.0.6.jar
struts2-convention-plugin-2.3.15.1.jar
struts2-core-2.3.15.1.jar
struts2-tiles-plugin-2.3.15.1.jar
tiles-api-2.0.6.jar
tiles-compat-3.0.1.jar
tiles-core-2.0.6.jar
tiles-jsp-2.0.6.jar
tiles-servlet-3.0.1.jar
xwork-core-2.3.15.1.jar
본 적이 있습니까? http://stackoverflow.com/q/23588099/1700321? –