FYI -- I figured out what seems to be a decent solution to my problem.  Basically, I 
included two
hidden fields in my login form (that is part of the included page) as follows (I am 
using struts-el)-

<html:hidden property="originalUrl" value="${pageContext.request.requestURL}"/>
<html:hidden property="originalQuery" value="${pageContext.request.queryString}"/>

Then in my action that processes the login form I do the following:

public ActionForward execute(...
{
  // check credentials ...

  String url = ... /// get the originalUrl from the dyna form
  String query = ... /// get the originalQuery from the dyna form

  StringBuffer redirectUrl = new StringBuffer(url);
  if (query != null && !"".equals(query)) redirectUrl.append('?').append(query);

  response.sendRedirect(redirectUrl);
  return null;
}


-----Original Message-----
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 9:13 AM
To: 'Struts Users Mailing List'
Subject: RE: How to forward back to including page


Well, the problem is that I am including this fragment in *all* of my pages.  (The 
form allows the user
to login -- otherwise, the user is a "guest").
Basically, I want the "forward" of the action that processes the form to not be 
"hard-coded"
to a specific path but instead to the page that included it (actually to be more 
precise from the current URL).
Here is a visualization of what I want to do:


                           importedForm.jsp --submit--> login.do 
--redirect-->ActionA.do
                                    |
ActionA.do --forwards--> PageA.jsp


ActionB.do --forwards--> PageB.jsp
                            |
                      importedForm.jsp --submit--> login.do --redirect-->ActionB.do


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to