(Sorry if this post comes through twice.. not sure why it never made it this morning when I thought I sent this out).

Mazen, Tamer S wrote:

My question is: when user clicks on the add button I want to submit
main page's form so I can preserve all user's entered data so when he
come back to the main page he will found his entered data with new
added products. My solution is to save from in session and when  user
back to the main page I will repopulate the form from the session. I
don't want to use session solution can nay one tell me if there is
another solution to solve that problem

All these posts lately about people scared of the Session, I don't get it:) (well I get some concern if you're storing huge lists for drop downs etc). I think the Session is your friend in this case. I'd use the Session for what you want. Other solutions, to me, do not outweigh the simplicity of using the Session and, not using it introduces more chances of bugs and more problems for later teams working on the code. You'll hear a lot of people mention to use hidden variables and make sure those keep getting populated correctly across your work flow. I've found this can create a maintenance nightmare and is not worth the effort. The object you are storing in Session is probably just an ActionForm with some String properties so it shouldn't be that much of a memory hog. "Use the Session Luke." (If you are really worried about unnecesary forms being in Session scope you can have a ServletContext listener that can clean up things based on different things (uris, etc) but I've never bothered to implement something like this. RAM is cheap)


--
Rick

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



Reply via email to