You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "White, Joshua A (CASD, IT)" <Jo...@thehartford.com> on 2003/03/19 13:59:35 UTC

Beginner question

I have two struts actions:

	"insertIt" - adds an item to the database.  When successful, this
action forwards to the "viewIt" action putting the newly inserted items
itemId into the request.
	"viewIt" - views an item by itemId (retrieves itemId from request)

When "insertIt" successfully completes, It forwards to "viewIt" without a
redirect.  As many of you know, if the user then refreshes the page, the
insert action is performed again.

To solve this problem, I changed the redirect attribute to "true".  The
refresh problem disappears.  However, the request variable "itemId" gets
lost because of the redirect.  

I know this is something every struts developer has worked through.  Could
someone suggest a pattern for this type of transaction?  

Regards,

Joshua


This communication, including attachments, is for the exclusive use of 
addressee and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, any use, copying, 
disclosure, dissemination or distribution is strictly prohibited. If 
you are not the intended recipient, please notify the sender 
immediately by return email and delete this communication and destroy all copies.


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