Forums Register Login

Problem with JSP app

+Pie Number of slices to send: Send
I have a major problem, the JSP app has started behaving differently since SSL was applied.
Before:
A user fills out a form (jsp1), when they click submit they are taken to a JSP controller page (jsp2) that runs checks for errors and business logic. If any errors are found they are forwarded to an error page (jsp3) stating the error message(s), they can click the back button (javascript window.history.back()) which then goes to jsp1, with their fields still containing their details.
But now with SSL when the user clicks back they are taken to a new instance of the form, which is empty. (The users will not like this!)
I know I need to use the session object to acheive getting the users data back into the form, but I'm not quite sure how to do this, I keep getting null pointer exceptions.
Can someone point me to some documentation or explain it to me? This would be most appreciated.
+Pie Number of slices to send: Send
If you're familiar with servlets, you can use the HttpSession object to store your session data as attributes. Same thing happens in a JSP, noting that every JSP page has an implicit reference to current session called session.
+Pie Number of slices to send: Send
Hi Sharon,
I would like to recommend that you use Struts, an open source MVC framework from The Jakarta Project. You might be using Model 1 in your JSP app, but believe me it's all worth it if you try out Struts.
Struts has so-called ActionForm objects which are tied to forms (obviously). These are session-based so the form fields' values are retained until the session lasts. What's novel is that, just tell Struts that this form has a corresponding ActionForm object, and Struts will automatically tie that form to the ActionForm object for you. Also, ActionForm objects perform field validation when the form gets POSTed so it is another added convenience.
If you are pressed on time, you can use a session bean to track down values of fields in a form, but basically you're just reinventing the wheel.
GL
Ex Animo Java!
-- Val
[ June 25, 2002: Message edited by: Val Pecaoco ]
+Pie Number of slices to send: Send
Thank you for your comments. Unfortunately this app has been written in JSP with a few java classes attached...I will definetely look into Struts on a future java project.
Lasagna is spaghetti flvored cake. Just like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1155 times.
Similar Threads
Using default JAAS Mechanism in Websphere makes applications to access the context path of the other
setting a value
jsp > servlet > jsp......URLs???
JSP Form data lost while back to same Action (struts 2)
Data Missing error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 04:55:30.