This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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:
True wisdom is in knowing you know nothing - Socrates
Christophe Verré wrote:
And you also changed your Action to put the username in the session ? Meanning replacing request.setAttribute("username", sUserName);.
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