struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dakota Jack <dakota.j...@gmail.com>
Subject Re: DispatchAction
Date Thu, 30 Dec 2004 17:26:40 GMT
Haven't you completely overridden the execute method making the
extension of DispatchAction irrelevant?

Jack


On Thu, 30 Dec 2004 03:56:17 -0800 (PST), Rudi Doku <dokurudi@yahoo.com> wrote:
> Hi Anders,
> 
> Thanks for your reply.
> 
> I'm not sure how to define the mapping in the
> struts-config.xml. My DispatchAction class looks like
> this:
> 
> public class PostAction extends
> org.apache.struts.actions.DispatchAction {
> 
>         public ActionForward execute(ActionMapping mapping,
>                                                                  ActionForm form,
>                                                                  HttpServletRequest request,
>                                                                  HttpServletResponse
response)
>         throws Exception
>         {
>                 return mapping.findForward("success");
>         }
> 
>         public ActionForward add(ActionMapping mapping,
>                                                           ActionForm form,
>                                                           HttpServletRequest request,
>                                                           HttpServletResponse response)
>         throws Exception
>         {
>                 return mapping.findForward("success");
>         }
> 
>         public ActionForward edit(ActionMapping mapping,
>                           ActionForm form,
>                           HttpServletRequest request,
>                           HttpServletResponse response)
>         throws Exception
>         {
>                 return mapping.findForward("success");
>         }
> 
>         public ActionForward reply(ActionMapping mapping,
>                           ActionForm form,
>                           HttpServletRequest request,
>                           HttpServletResponse response)
>         throws Exception
>         {
>                 System.out.println(">> inside reply");
>                 return mapping.findForward("success");
>         }
>         public ActionForward list(ActionMapping mapping,
>                           ActionForm form,
>                           HttpServletRequest request,
>                           HttpServletResponse response)
>         throws Exception
>         {
>                 System.out.println(">> inside reply");
>                 return mapping.findForward("success");
>         }
> 
> and my mapping looks like this:
> 
>         <action path="/newPost"
>                 type="com.doku.weblog.PostAction"
>                 name="postForm"
>                 scope="request"
>                 input="/loggedin.jsp"
>                 parameter="method">
>         <forward name="success" path="/post.jsp"/>
> <forward name="failure" path="/login"/>
> 
>         </action>
> 
> I don't think I need a name or input. Can you please
> advise me on how I can get this mapping to work?
> 
> Thanks for your help,
> 
> Rudi
> 
> --- "Anders R. Sveen" <anders@f12.no> wrote:
> 
> > Use the html:link tag with an action attribute.
> > (action="MyDispatchActionMapping?cmd=myMethod"
> > should do it)
> >
> > You can also use a normal html href if you
> > absolutley wanted to.
> >
> > Anders,
> >
> > There's also no problem
> >
> > Rudi Doku wrote:
> > > Hello,
> > >
> > > I'm a struts newbvie!
> > >
> > > I have created a class that extends DispatchAction
> > to
> > > perform some CRUD.
> > >
> > > Can I use an html link to invoke an action, or
> > does it
> > > always have to be from a form?
> > >
> > > Regards,
> > >
> > > Rudi
> > >
> > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail - You care about security. So do we.
> > > http://promotions.yahoo.com/new_mail
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > user-help@struts.apache.org
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
> 
> __________________________________
> Do you Yahoo!? 
> Yahoo! Mail - Helps protect you from nasty viruses.
> http://promotions.yahoo.com/new_mail
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
------------------------------

"You can lead a horse to water but you cannot make it float on its back."

~Dakota Jack~

"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

-----------------------------------------------

"This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation."

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message