Dynamically changing forward in ActionForm

2003-07-08 Thread Michael C. Clark
I have a small ActionForm which I would like to include on all pages
of my webapp (it does a login, with user name and password).  When
the validate() method returns an ActionErrors object, I would like
control to return to the page that the login ActionForm was called
from.

Is there a way to do this without storing a reference to an
ActionForward in the session context, then dynamically changing the
Input of the ActionMapping in the ActionForm?  That seems far too
complicated.

Any insight appreciated.

-Mike


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



Re: Dynamically changing forward in ActionForm

2003-07-08 Thread Sandeep Takhar
This has been asked many times before.

You have to store something.  Sometimes it is nice to
have a user object that stores bookmarks etc.

try searching the archive...

sandeep
--- Michael C. Clark [EMAIL PROTECTED] wrote:
 I have a small ActionForm which I would like to
 include on all pages
 of my webapp (it does a login, with user name and
 password).  When
 the validate() method returns an ActionErrors
 object, I would like
 control to return to the page that the login
 ActionForm was called
 from.
 
 Is there a way to do this without storing a
 reference to an
 ActionForward in the session context, then
 dynamically changing the
 Input of the ActionMapping in the ActionForm?  That
 seems far too
 complicated.
 
 Any insight appreciated.
 
 -Mike
 
 

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


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



RE: Dynamically changing forward in ActionForm

2003-07-08 Thread Neil Carusetta
After the ActionServlet initializes the modules from the struts-config file,
a freeze() is placed on the ModuleConfig which includes the ActionForwards
elements. As a result any subsequent change to the actionForward's path is
not possible.  

For the scenario you describe I usually define one forward element in the
struts-config mapping for the fail validate case (probably just a URI back
to the Logon JSP itself, and another forward for the success case (probably
an action call which display the next page and any prepopulated form-bean
info).

Hope that helps.

Neil Carusetta
CGC
Scottsdale, AZ

-Original Message-
From: Sandeep Takhar [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 5:40 AM
To: Struts Users Mailing List
Subject: Re: Dynamically changing forward in ActionForm

This has been asked many times before.

You have to store something.  Sometimes it is nice to
have a user object that stores bookmarks etc.

try searching the archive...

sandeep
--- Michael C. Clark [EMAIL PROTECTED] wrote:
 I have a small ActionForm which I would like to
 include on all pages
 of my webapp (it does a login, with user name and
 password).  When
 the validate() method returns an ActionErrors
 object, I would like
 control to return to the page that the login
 ActionForm was called
 from.
 
 Is there a way to do this without storing a
 reference to an
 ActionForward in the session context, then
 dynamically changing the
 Input of the ActionMapping in the ActionForm?  That
 seems far too
 complicated.
 
 Any insight appreciated.
 
 -Mike
 
 

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


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



RE: Dynamically changing forward in ActionForm

2003-07-08 Thread Fedor Smirnoff
Hey,

I think that global forward is the best solution for
it as Neil mentioned. However, I havent tried this yet
but would it be possible to include login check into
lets say GeneralAction that extends Action, and than
every other action will extend GeneralAction. So
basically this action being in the middle can do all
the general processing that will be required by an
application. I read something about it in one fo the
books, and it does sound doable and useful, is it?

Thanks,
Fedor



--- Neil Carusetta [EMAIL PROTECTED]
wrote:
 After the ActionServlet initializes the modules from
 the struts-config file,
 a freeze() is placed on the ModuleConfig which
 includes the ActionForwards
 elements. As a result any subsequent change to the
 actionForward's path is
 not possible.  
 
 For the scenario you describe I usually define one
 forward element in the
 struts-config mapping for the fail validate case
 (probably just a URI back
 to the Logon JSP itself, and another forward for the
 success case (probably
 an action call which display the next page and any
 prepopulated form-bean
 info).
 
 Hope that helps.
 
 Neil Carusetta
 CGC
 Scottsdale, AZ
 
 -Original Message-
 From: Sandeep Takhar
 [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, July 08, 2003 5:40 AM
 To: Struts Users Mailing List
 Subject: Re: Dynamically changing forward in
 ActionForm
 
 This has been asked many times before.
 
 You have to store something.  Sometimes it is nice
 to
 have a user object that stores bookmarks etc.
 
 try searching the archive...
 
 sandeep
 --- Michael C. Clark [EMAIL PROTECTED] wrote:
  I have a small ActionForm which I would like to
  include on all pages
  of my webapp (it does a login, with user name and
  password).  When
  the validate() method returns an ActionErrors
  object, I would like
  control to return to the page that the login
  ActionForm was called
  from.
  
  Is there a way to do this without storing a
  reference to an
  ActionForward in the session context, then
  dynamically changing the
  Input of the ActionMapping in the ActionForm? 
 That
  seems far too
  complicated.
  
  Any insight appreciated.
  
  -Mike
  
  
 

-
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 SBC Yahoo! DSL - Now only $29.95 per month!
 http://sbc.yahoo.com
 

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


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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