Boa dim galera… to com outro problema com struts… agora o erro que me da é este toda vez que eu vo chamar a pagina de adicionar e de editar autores… porem a de excluir… ele excluir normal…
o erro é este:
[code]HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Action[/Operacao] does not contain specified method (check logs)
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
java.lang.NoSuchMethodException: Action[/Operacao] does not contain specified method (check logs)
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:264)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.[/code]
o odigo do meu xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
<struts-config>
<form-beans>
<form-bean name="EditarAutoresForm" type="br.com.integrator.struts.EditarAutoresForm"/>
<form-bean name="AutoresActionForm" type="br.com.integrator.struts.AutoresActionForm"/>
</form-beans>
<global-exceptions>
</global-exceptions>
<global-forwards>
<forward name="welcome" path="/Welcome.do"/>
</global-forwards>
<action-mappings>
<action input="/welcomeStruts.jsp" name="AutoresActionForm" path="/AutoresActionForm" scope="request" type="br.com.integrator.struts.AutoresAction">
<forward name="success" path="/welcomeStruts.jsp"/>
</action>
<action attribute="editarAutoresForm"
name="editarAutoresForm"
parameter="acao"
path="/Operacao"
scope="request" type="br.com.integrator.struts.EditarAutoresAction">
<forward
name="showEdit"
path="/jsp/editAutor.jsp"/>
<forward
name="showAdd"
path="/jsp/addAutor.jsp" />
<forward
name="success"
path="/AutoresActionForm.do"
redirect="true" />
</action>
<action path="/Welcome" forward="/welcomeStruts.jsp"/>
</action-mappings>
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>
<message-resources parameter="br/com/struts/ApplicationResource"/>
<!-- ========================= Tiles plugin ===============================-->
<!--
This plugin initialize Tiles definition factory. This later can takes some
parameters explained here after. The plugin first read parameters from
web.xml, thenoverload them with parameters defined here. All parameters
are optional.
The plugin should be declared in each struts-config file.
- definitions-config: (optional)
Specify configuration file names. There can be several comma
separated file names (default: ?? )
- moduleAware: (optional - struts1.1)
Specify if the Tiles definition factory is module aware. If true
(default), there will be one factory for each Struts module.
If false, there will be one common factory for all module. In this
later case, it is still needed to declare one plugin per module.
The factory will be initialized with parameters found in the first
initialized plugin (generally the one associated with the default
module).
true : One factory per module. (default)
false : one single shared factory for all modules
- definitions-parser-validate: (optional)
Specify if xml parser should validate the Tiles configuration file.
true : validate. DTD should be specified in file header (default)
false : no validation
Paths found in Tiles definitions are relative to the main context.
-->
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
</plug-in>
<!-- ========================= Validator plugin ================================= -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
</struts-config>
e a minha pagina que chama a jsp de adicionar editar e excluir meu welcomeStruts.jsp
[code]<%@page contentType=“text/html”%>
<%@page pageEncoding=“ISO-8859-1”%>
<%@ taglib uri=“http://jakarta.apache.org/struts/tags-bean” prefix=“bean” %>
<%@ taglib uri=“http://jakarta.apache.org/struts/tags-html” prefix=“html” %>
<%@ taglib uri=“http://jakarta.apache.org/struts/tags-logic” prefix=“logic” %>
html:html
Autores Cadastrados
ID | Nome | Data de Nascimento | Ações | |
<bean:write name=“autor” property=“id” /> | <bean:write name=“autor” property=“nome” /> | <bean:write name=“autor” property=“email” /> | <bean:write name=“autor” property=“nascimento” format=“dd/MM/yyyy” /> | <html:link action=“Operacao.do?acao=editAutor” paramName=“autor” paramProperty=“id” paramId=“id”>Editar</html:link> |