Olá pessoal, estou iniciando meu estudo em desenvolvimento web com java, jsp e struts.
Procurei na internet e achei várias páginas que trazem o mesmo exemplo de aplicação básica de struts, ou seja, copiar o struts-blank, renomear e criar uma aplicação com e-mail e senha. Embora o artigo seja o mesmo (do mesmo autor), em páginas diferentes, há divergências entre eles, o que tem me confundido.
Eu montei então uma aplicação, e arrumei alguns erros que deram pra acessar a index.jsp do projeto, mas quando tento acessar minha action tenho o eguinte erro:
type: Status report
message: /Cadastro/actions/register
description: The requested resource (/Cadastro/actions/register) is not available
Bom pelo que entendo, não está encontrando o action, o erro deve estar no mapeamento, certo???
Bom, segue meu web.xml:<web-app>
<display-name>Cadastro</display-name>
<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-nested</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
</web-app>
e o struts-config.xml:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="userFormBean" type="goetten.UserFormBean"/>
</form-beans>
<global-forwards>
<!-- Default forward to "Welcome" action -->
<!-- Demonstrates using index.jsp to forward -->
<forward name="register" path="/register.do"/>
</global-forwards>
<action-mappings>
<!-- Default "Welcome" action -->
<!-- Forwards to Welcome.jsp -->
<action path="/register" forward = "/pages/actions/register.jsp"/>
<action path="/actions/register" type="goetten.RegisterAction" name="userFormBean"
scope="request" input="/pages/action/register.jsp">
<forward name="success" path="/WEB-INF/results/result.jsp"/>
<forward name="badaddress" path="/WEB-INF/results/badaddress.jsp"/>
<forward name="badpassword" path="/WEB-INF/results/badpassword.jsp"/>
</action>
</action-mappings>
</struts-config>
Se alguém puder me ajudar, agradeço!
[]'s
