struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <mart...@apache.org>
Subject Re: Problem in using DispatchAction
Date Wed, 10 Jan 2007 15:37:28 GMT
Please ask questions about using Struts on the Struts User mailing list.
This list is for discussion of the development of Struts itself.

--
Martin Cooper


On 1/9/07, Mandar Velankar <msv_78@cooltoad.com> wrote:
>
>
> 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
> --
> View this message in context:
> http://www.nabble.com/Problem-in-using-DispatchAction-tf2951023.html#a8253237
> Sent from the Struts - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message