struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <db...@rhoworld.com>
Subject how to strutsly send the user back to the last URL
Date Thu, 27 Mar 2003 18:47:25 GMT
hi guys, got a very simple question. i've got a SaveAction which can be 
invoked via the url /Save.do from basically anywhere in my struts app. 
naturally, its mapping configuration is quite terse:

<action path="/Save" type="mypackage.SaveAction"/>

works fine, but here's the issue - at the end of the action, i want to 
send the user back to wherever they came from, maybe with a little "save 
successful" or "save failed" message. I can't do this:

return new ActionForward(mapping.getInput());

i get an npe when i try, presumably because i didn't declare an explicit 
input path for the action in struts-config. i can of course do this:

response.sendRedirect(request.getHeader("Referer"));

(with appropriate failure condition if the browser doesn't send Referer 
headers) but that doesn't seem very strutsy. is there a recommended 
practice in this regard?

- donald


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message