Estou fazendo um projeto web, mas não estou conseguindo passar via link uma action declarada no struts que referencia definitions do tiles.
Link na página default.jsp:
<td height="22" class="td10"><a href="" class="link01">
<html:link page="/links.do?forward=mainlayout">ASUL</td>
</html:link>
arquivo struts-config.xml:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<global-forwards>
<!-- <forward name="login" path="login" /> -->
<forward name="defaut" path="/default.jsp" />
</global-forwards>
<action-mappings>
<!-- INÍCIO DO MAPEAMENTO DE ACTIONS-->
<action path="/links" type="br.inf.megainfo.asul.controller.Links">
<forward name="mainlayout" path="mainlayout"/>
<forward name="asul" path="asul"/>
</action>
</action-mappings>
<!-- ========== FIM Action Mappings Configuration ================================== -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml" />
</plug-in>
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml" />
</plug-in>
</struts-config>
configuração no tiles:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<!-- LAYOUT BASE PRINCIPAL -->
<definition name="mainlayout" path="/view/mainlayout.jsp">
<put name="title" value="/view/title.jsp" />
<put name="header" value="/view/header.jsp" />
<put name="logo" value="/view/logo.jsp" />
<put name="body" value="/view/blank_body.jsp" />
<put name="menu" value="/view/menu.jsp" />
<put name="footer" value="/view/footer.jsp" />
</definition>
<!-- Início das Páginas -->
<definition name="asul" extends="mainLayout">
<put name="body" value="/view/body_asul.jsp" />
</definition>
</tiles-definitions>
classe Links:
package br.inf.megainfo.asul.controller;
import org.apache.struts.action.*;
import javax.servlet.http.*;
/**
* @author Renato Viana Gomes Nazário <br>
* Email: (<a
* href="mailto:renatovgnaza@yahoo.com.br">renatovgnaza@yahoo.com.br</a>
* <br>
* Data: 11/10/2006 <br>
*
*/
public class Links extends Action {
public ActionForward perform(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response
) {
String forward = request.getParameter("forward");
return mapping.findForward(forward);
}
}
Gostaria de saber o que pode estar dando de errado nestas instruções, pois já verifiquei e não sei mais oque fazer.
erro:
HTTP Status 404 - Servlet action is not available
type Status report
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available.
Apache Tomcat/5.5.12
Obrigado.