Estou fazendo a atividade da apostila da caelum (atividade 11.6 á 1º de struts).
Sempre que eu vo executar da o erro 404. Eu já vi vários poste como problemas parecidos e fiz o que eles falava mais não deu certo...
Codigo:
Classe OlaMundoActionpackage br.com.caelum.tarefas.action;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
public class OlaMundoAction {
@Action(value = "olaMundoStruts", results = { @Result(location = "/olaMundoStruts.jsp", name = "ok") })
public String execute() {
System.out.println("Executando a lógica com Struts2");
return "ok";
}
}
<html>
<body>
<h2>Olá mundo com Struts2!</h2>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<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>
<display-name>fj21-tarefas2</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>
</web-app>