내 프로젝트에서 Struts 2 Annotation을 구현하려고하는데 어떻게해야할지 모르겠다. Struts2 - Struts2 어노테이션을 사용하는 방법?
나는 내가 web.xml을내 작업
package org.apache.struts.helloworld.action;
import org.apache.struts.helloworld.model.MessageStore;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
@Results({
@Result(name="success", location="HelloWorld.jsp")
})
public class HelloWorld extends ActionSupport {
public String execute() throws Exception {
messageStore = new MessageStore() ; return SUCCESS;
}
JSP 페이지
...
<init-param>
<param-name>actionPackages</param-name>
<param-value>org.apache.struts.helloworld.action</param-value>
</init-param>
...
을 수정
내 치어로 대회 - 플러그인 V 2.1.8.1 추가 내 행동을 사용하려고하는 곳에서.
<body> <h1>Welcome To Struts 2!</h1> <p><a href="<s:url action='helloWorld'/>">Hello World</a></p> </body>
내가 작업 인 helloWorld에 관련된 링크를 누르면,하지만 그건 정확히 동일한 페이지에 저를 보내
. 따라서 index.jsp에서 index.jsp로 전송됩니다.동작 방식 : HelloWorld.jsp으로 보내야합니다.
FileFront에 프로젝트 (아주 간단한 HelloWorld 앱)를 업로드했는데 누군가가 문제가있는 곳을 보았을 수도 있습니다. http://www.filefront.com/16364385/Hello_World.zip