Oi pessoal,
Estou iniciando um projeto novo com Maven 2 + Struts 2 + Spring 3 + Weblogic.
O meu problema está sendo em utilizar o Struts 2 com annotation, só está funcionando com o mapeamento pelo struts.xml.
Exemplo:
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.validation.SkipValidation;
import org.springframework.stereotype.Controller;
import com.opensymphony.xwork2.ActionSupport;
@Controller
public class TesteAction extends ActionSupport implements ServletRequestAware { ....
@Action(value = "/testeAction", results = {@Result(name = "success", location = "/teste.jsp")})
public String teste() {
...
return SUCCESS;
}
...
Quando acesso a Action do meu projeto no browser http://localhost:7001/projeto/testeAction.action me retorna o erro 404 Not found. E se eu faço pelo struts.xml funciona perfeitamente.
O meu web.xml está assim:
<!-- Filters -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<!-- Filters mapping -->
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
E no meu pom.xml está assim:
<!-- struts -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.1.8</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.1.8</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>2.1.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>2.1.8</version>
</dependency>
Alguém teria alguma dica, um projeto de exemplo, ou algo que estou esquecendo em relação ao Spring + Struts ?
[]'s
Denis Santos
[email removido]