You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adam Levine <ad...@hotmail.com> on 2003/07/08 21:39:32 UTC
using getInputForward vs new ActionForward(mapping.getInput())
My goal in handling "business problems" in validating a form submission from
an Action.execute() is 2-fold:
1: Display the accumulated ActionErrors (ie, using [html:errors/] )
2: "Return" the user to the exact same URL in their browser address bar.
I was using an action-mapping forward in struts-config to send them to the
original .jsp they used to submit from. The errors were showing up (good),
but the URL in the address bar was being shown as /dynamic/Path.jspa (bad)
So I changed the action-mapping, setting "redirect" to "true". Now the
address bar was correct (good), but the error messages were gone (bad).
Then I did a lot of web searching, and discovered that I should be using the
getInput.
So, now my execute() was returning: return new
ActionForward(mapping.getInput());
This worked! The address bar was correct and the errors were still present.
Then I "upgraded" my struts library to 1.1b3. Now I'm back to the
original problem of the address bar being right, but my errors are gone.
I found mapping.getInputForward(), and tried returning that, even going in
and setting the redirect field to "true". I'm bouncing between the same 2
situations I had before.
Am I missing something? Is it no longer possible to have "the best of both
worlds"? For whatever it may be worth, I'm using the -el sets of libraries
(thank you for finally getting that!).. and jboss 3.07.. and xdoclet...
Thanks for any insight you can provide.
-- adam
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: using getInputForward vs new ActionForward(mapping.getInput())
Posted by Yansheng Lin <ya...@isogis.com>.
So you are saying that error.isEmpty() returns false, but <html:errors/> doesn't
display anything?
This is happening 'cause you use redirect instead of forward. Also You might
want to try System.out.println(mapping.getInput()) to see if you are going back
to the right page. You might be surprised:).
-----Original Message-----
From: Adam Levine [mailto:adam_l_levine@hotmail.com]
Sent: July 8, 2003 1:40 PM
To: struts-user@jakarta.apache.org
Subject: using getInputForward vs new ActionForward(mapping.getInput())
My goal in handling "business problems" in validating a form submission from
an Action.execute() is 2-fold:
1: Display the accumulated ActionErrors (ie, using [html:errors/] )
2: "Return" the user to the exact same URL in their browser address bar.
I was using an action-mapping forward in struts-config to send them to the
original .jsp they used to submit from. The errors were showing up (good),
but the URL in the address bar was being shown as /dynamic/Path.jspa (bad)
So I changed the action-mapping, setting "redirect" to "true". Now the
address bar was correct (good), but the error messages were gone (bad).
Then I did a lot of web searching, and discovered that I should be using the
getInput.
So, now my execute() was returning: return new
ActionForward(mapping.getInput());
This worked! The address bar was correct and the errors were still present.
Then I "upgraded" my struts library to 1.1b3. Now I'm back to the
original problem of the address bar being right, but my errors are gone.
I found mapping.getInputForward(), and tried returning that, even going in
and setting the redirect field to "true". I'm bouncing between the same 2
situations I had before.
Am I missing something? Is it no longer possible to have "the best of both
worlds"? For whatever it may be worth, I'm using the -el sets of libraries
(thank you for finally getting that!).. and jboss 3.07.. and xdoclet...
Thanks for any insight you can provide.
-- adam
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org