A HttpSession is like a map that is available to you on any page the user visits. This means you can store the user id in the session when he/she logs in and have it available on a later page when the user wants to change the password.
Of course. That's how a session works. The Struts specific way is to create a form bean in the session scope. Then your later actions/pages can access it.
thank you again for your reply actually i am now posting my code
my login page
now the page on which i want to change my password
now i want to ask how can i use session on my action page some problem is there when i click on my changepassword.jsp it shows me userloggin page again
For the behavior you describe, "valid" is not present in the session. Where do you set it? In an action? Can you show that code? Can you confirm it is being called? (via a debug statement)