Struts2 アノテーションを使用しました
私web.xml
は:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<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>
私のJSPは:
<s:form action="test" method="post">
<s:textfield name="id" label="Id"></s:textfield>
<s:submit value="Submit"></s:submit>
</s:form>
私のクラスは:
@Namespace("/")
public class Test extends ActionSupport {
private static final long serialVersionUID = 1L;
@Action(value = "test", results = { @Result(name = "success", location = "success.jsp") })
public String input() {
System.out.println("input call");
return SUCCESS;
}
}
エラーが発生しました:
HTTP Status 404 - There is no Action mapped for namespace / and action name test.
フォルダ構造: