Good morning, I'm doing a small project with the new version Struts 2.5.13 and following the guide official I can not get it started. (Error 404, can not find resource).
ACTION An action as simple as possible:
@SuppressWarnings("serial")
public class InitAction extends ActionSupport implements SessionAware{
@Override
public String execute()
{
String resultado="success";
System.out.println("Holaaa resul("+resultado+")");
return resultado;
}
}
struts.xml
<constant name="struts.devMode" value="true" />
<package name="default" extends="struts-default">
<action name="init" class="com.mncars.commons.actions.InitAction">
<result name="success">/index.jsp</result>
</action>
</package>
Web.xml
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd ">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<session-config>
<session-timeout>120</session-timeout>
</session-config>
Index.jsp
<%@page import="java.net.URLDecoder"%>
<%
HttpSession ses = request.getSession();
response.sendRedirect("init");
%>
Bienvenido a la pagina!
The libraries I use are:
commons-fileupload-1.3.3.jar
commons-lang3-3.6.jar
freemarker-2.3.23.jar
javassist-3.20.0-GA.jar
log4j-api-2.8.2.jar
mybatis-3.2.2.jar
ognl-3.1.15.jar
struts2-core-2.5.13.jar
Project:
Tested URL