Hi,
I am using DispatchAction to call my own public method in class which extends DispatchAction, but problem is my required method is not called , instead execute() method is called. Where is problem?
Here is my code
JSP Page
....
....
<html:form action="/addshade">
<html:hidden property="method" value="mymethod" />
<table width="100%" border="0" cellpadding=3 cellspacing=1 bgcolor="#FFFFFF" class="TextContenttext" >
<tr bgcolor="#f0f0f0">
<td colspan="2"><html:errors/></td>
</tr>
....
....
</table>
</html:form>
....
....
Action mapping entry in struts-config.xml
....
....
<action-mappings>
<action path="/addshade"
type="coreservlets.production.ShadeAction"
name="shadeFormBean"
scope="session"
input="/pages/production/add_shade.jsp"
parameter="method"
>
<forward name="missing-value"
path="/pages/production/add_shade.jsp"
redirect="true"/>
<forward name="success"
path="/pages/production/saveshade.jsp"/>
</action>
</action-mappings>
....
....
Action Class
....
....
public class ShadeAction extends DispatchAction{
/** Creates a new instance of ShadeAction */
public ShadeAction() {
}
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
request.getSession().getServletContext().log("ShadeAction::Inside execute of ShadeAction");
....
....
}
....
....
public ActionForward mymethod(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
request.getSession().getServletContext().log("ShadeAction::Inside mymethod of ShadeAction");
return(mapping.findForward("success"));
}
}
But from logs , it shows execute() method is called.
Where is mistake? Thanks a lot.
wait for your replies.
Regards
Mandar Velankar