This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Advice on a putting dynamic message on jsp page depending on action taken by user Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Advice on a putting dynamic message on jsp page depending on action taken by user" Watch "Advice on a putting dynamic message on jsp page depending on action taken by user" New topic
Author

Advice on a putting dynamic message on jsp page depending on action taken by user

Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

I have user login and registration pages set up right now, and a loginSuccess page. The user goes to the login page first of course, and then hits "register". If registration is successful (condition is username and password being added to database) I want the user sent back to the login page, with a new message saying something like "feel free to login 'newUserName'" I have this all done accept for the message at the top of the page saying "login" or whatever it will say

What is the best way to go about this? I was trying to use a request attribute, but since the attribute is null when you first get to the login page, there are compile errors (I guess you cannot do request.setAttribute within the jsp page?). I would be willing to set this attribute to a default value, like "Please login" but I have not been able to figure out how (guessing in the faces-config file).

Or I would also like to know if there is simply a better way to handle this.

Thanks


edit - doubt it is needed, but here is the simple login page I am wanting to put the dynamic message on:



True wisdom is in knowing you know nothing - Socrates
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

If your scoped variable is named someMessage:

Of course, you need the JSTL set up.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

That is all new material for me.

Can you suggest what I should search for in google to learn how to use this info?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Advice on a putting dynamic message on jsp page depending on action taken by user
 
Similar Threads
No tag "form" defined in tag library imported with prefix "html"
Cannot load a validator resource
html:form tag not working
Getting Exception creating bean of class JSP Exception
Need an attribute to be available in different places (SOLVED)