I have a basic site with a login page, a new user registration, a welcome page, and an edit info page.
After logging in, a user gets a page with this:
The username bean is set on a login action
On that same page there is an edit profile link. When the user clicks that link, I need to send him to that page, and I would like that same welcome message to be available.
I have tried just copying and pasting the above to this subsequent page, but I get this: javax.servlet.jsp.JspException: Cannot find bean username in any scope
I have tried setting the scope attribute to "session" on both pages, as well as setting the login action-mapping to session, but it has not worked either. I thought that would be the solution, but apparently not.
The reason I need to do this is because on this edit profile page, I need to tell the java code what the username is, so it can change the database with the new input info based on whatever user is logged in
Here are what i think are the relevant jsp and java code:
LoginSuccess.jsp
profile.jsp
loginAction.java
ChangeProfileAction.java
True wisdom is in knowing you know nothing - Socrates
I did not do that. I bet that is my problem, I will update the thread once I have a chance to try this out. So instead of request.setAttribute I need to use session.setAttribute. I really think that is the problem
I changed the login Action to a session scope in the struts-config file.
Then on my loginSuccess page I changed this line :
And in my java code I changed the following code to accommodate session instead of request (code pointed out with <<<<<<<<<<<<<<<<<<<<<<)
But when I try to login now I just get a blank white page. It is not even getting as far as line 33, because nothing is being printed to the console. Any idea where I am going wrong?