Hi!! I'm new in JSP's so I need a lot of advice.. I'm trying to validate a user from a JSP, asking for an id_user, and a password. For validation I had accessed the database thru a class called : CL_Conection that I imported.. but my problems become after I validate the user: [*]when I try to open a new navigator window (which the user has the permission to see) and close the existing one. [*]when I try to pass (parameter) the id_user to the new navigator window (that could be another jsp?) I don't want to pass the parameter thru the URL because I have heard it's not safe.. So, is there another way to pass the parameter to another JSP? Help me please!! What do I need to do to solve these problems? Could you give me a hint with some code? Thank you very much!! Nancy.
Your problem could be that your new window doesn't have access to the session the origional window has. Why open a new window and close down the original? Why not just forward onto a new page in the same window??
Pounding at a thick stone wall won't move it, sometimes, you need to step back to see the way around.
And why not use a session to store the information you need, instead of using a URL? Erik
Joined: Nov 22, 2008
You are right! Maybe I don't need to open a new window, so I have to do: pageContext.forward("validaError.jsp"); to load another jsp in the same window, don't I? But, how can I access the form's components of the first JSP? because I need to know the id_user that is in the first one JSP... How can I implement the sesions? (code) Help!! or if you want, could you give me some links to JSP pages (no SUN) to learn more? Thanks in advance... Nancy.
In subsequent pages just use String str_Login =(String)session.getValue("Login"); to retrieve the Login. U can put as many values in session which can be available throughout the user session. When the user logs off use session.invalidate(); to clear all the values from the session. Hope this solves ur problem.