I would do this, if the parameters were static, but there are other parameters which are not static (for example, ID of the object being edited), the actual full URL is:
whatEverPageName?type=next&id=2234 I was thinking that perhaps I could forward to a .JSP page that could build the final destination using any tags it might have at it's disposal and then forwarding to that final destination. This approach, however, seems to be too much work. I am just starting out with Struts, and searching for a pattern that I could apply to various conditions. Perhaps there could be a patterns book for Struts... -AP_ -----Original Message----- From: Jonathan James [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 17, 2002 9:47 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Forwarding from a FormAction with parameters... What about having an action mapping like this: <action path="/initialWhateverActionThatWas" forward="/whateverActionThatWas.do?type=initial" /> or maybe (better?) in your original action mapping just a forward for each one like: <action ... <forward name="successInitial" path="/public/registerSuccess.html?type=initial"/> <forward name="successNext" path="/public/registerSuccess.html?type=next"/> </action> -Jonathan ----- Original Message ----- From: "Alex Paransky" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, January 17, 2002 11:37 AM Subject: RE: Forwarding from a FormAction with parameters... > I understand what you are saying, but then sometime the value is in the > parameters, and sometimes in the request. > > I basically have a page with two modes of operation. When I pass > ?type=initial to the page it behaves in a certain way. There is a link on > the page to take it into a second mode. The second mode, ?type=next, adds > extra controls on the page and allows user to edit data on a form. After > user hits the submit button, I need to get back to the ?type=initial state > (if all is ok). I need to pass this ?type=initial back to the page. But, > if I include it in the request, the semantics of getting the data is > different (sometimes as a parameter, other times in the request). > > Another suggestion was to hardcode it in the action, but I am trying to > avoid that, giving the flexibility to change to a different page without > having to alter code. > > By the way, I have remapped my .html to be processed by the .jsp compiler, > so the .html extensions are jsp pages. > > Thanks. > > -AP_ > www: http://www.alexparansky.com > > -----Original Message----- > From: Tom Goemaes [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 17, 2002 1:44 AM > To: Struts Users Mailing List; [EMAIL PROTECTED] > Subject: Re: Forwarding from a FormAction with parameters... > > > hehe. > > what you need to do is add the "initial" value to the request object and > forward the control to a jsp, not a html page. There you can get the value > from the request scope and do your thing with it. > > Are you sure you want to forward and not redirect ? Your way of thinking is > not very clear and probably not such a good idea. > > ------------------------ > "Struts Users Mailing List" <[EMAIL PROTECTED]> > [EMAIL PROTECTED] wrote: > ------------------------ > > >I have an action, which upon success needs to forward to another page. > >Common enough, I made the following struts-config.xml entry: > > > > > > > > > >However, I need to pass parameters to the registerSuccess.html, so the > final > >URL should be: > > > >registerSuccess.html?type=initial > > > >Is there a way to do this and avoid having to hardcode the URL and > appending > >of the parameters in the Action? > > > >-AP_ > >www: http://www.alexparansky.com > > > >PS: I am sorry if this has been asked before, but I could not find where I > >can search the list for previously posted messages. > > > > > >-- > >To unsubscribe, e-mail: > >For additional commands, e-mail: > > > > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

