Yes, that's correct. Using extension mapping with Struts, and ".do" in
particular, is just a Struts convention. I suspect that most people are
probably following that convention, but it is not a requirement. You are
free to use a different extension, such as ".act" or ".cmd" or whatever, or
to use path mapping, if you want.
As you point out, changing the mapping method or the extension after the
project is in development may have repercussions, so it's a decision you
really want to make up front, and stick with.
--
Martin Cooper
At 02:09 PM 8/3/01, John M. Corro wrote:
>Ken clarified my point - that in a form's 'action' you don't need to tack
>the '.do' extension to the end of the action mapping (ie
>action="SomeAction"). In a link's 'href' value you do need to tack on the
>'do' extension (ie the value changes to href="SomeAction.do").
>
>I believe this comes w/ a caveat as the '.do' extension can be changed. By
>default the extension is '.do' in the web.xml file. I haven't tried this,
>but I would imagine if you changed the extension in the web.xml file, you'd
>have to also reflect the change in your links.
>
>----- Original Message -----
>From: "Greg Maletic" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Friday, August 03, 2001 11:57 AM
>Subject: RE: Reaching Action class from Href Link
>
>
> > Now I'm really confused! Your original problem was that you wanted to
>have
> > a link forward to an action. Your clarification shows how to do it from a
> > form ("<form action="SomeAction>"), but then you say that using a link or
> > href will not work. That doesn't seem to solve your original problem,
>does
> > it?
> >
> > Please let me know what I'm missing here, because I'm having this problem
>as
> > well.
> >
> > Thanks!
> >
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> > rg]On Behalf Of John M. Corro
> > Sent: Friday, August 03, 2001 1:33 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Reaching Action class from Href Link
> >
> >
> > Thanks to John and Ken for the assistance.
> >
> > Point of clarification other interested newbies, using a form's 'action'
> > value as the link's 'href' value will not work - the reason mine wasn't
> > working. For instance,
> >
> > <form action="SomeAction">
> >
> > may work, where as
> >
> > <a href="SomeAction">~~~</a> or <html:link
>href="SomeAction"~~~></html:link>
> >
> > will not.
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "John Schroeder" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, August 03, 2001 11:22 AM
> > Subject: RE: Reaching Action class from Href Link
> >
> >
> > > Using the struts html:form tag will set the method to POST by default.
> > This
> > > won't prevent you from using the link as you describe though. The
>service
> > > methods of an HttpServlet doPost() and doGet() will accomplish
>essentially
> > > the same goal (often doGet() will just call doPost() ). In the case of
> > the
> > > struts ActionServlet, both of these methods call process(). So you can
> > use
> > > a query string to pass your parameters (or extra path info if you wish).
> > >
> > > So, that was a little long-winded way of saying that your link can look
> > > like:
> > > <a
>href="/someContext/someAction.do?param1=foo¶m2=bar¶m3=baz">LINK
> > > TEXT</a>
> > >
> > > Hope this helps!!
> > >
> > > --John
> > >
> > >
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: John M. Corro [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, August 03, 2001 1:07 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Reaching Action class from Href Link
> > >
> > >
> > > I've recently begun working with Struts and am looking to create a
> > scenario
> > > where a user can click on a link and trigger some event in an Action
>class
> > > (ie the clicking of a link would be the same as clicking a form's submit
> > > button). My understanding is that within Struts forms submit by the
>post
> > > method by default so I don't know if the only way to reach an Action
>class
> > > is by an actual form. Any one have any insight?
> > >
> > >
> > >
> >
> >
> >