Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your scoped variable is named someMessage:

Of course, you need the JSTL set up.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is all new material for me.

Can you suggest what I should search for in google to learn how to use this info?
 
Switching from electric heat to a rocket mass heater reduces your carbon footprint as much as parking 7 cars. Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic