• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Extracting a value from the j_security_check servlet into a JSP page

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks...

I have a problem as follows:

I log in into the web app, via my login.jsp page. Below is the code for the form that accepts the login information



Login is sucessful and I am brought to the 'studentstub.jsp' page. I would like the user name to appear on the 'studentstub.jsp' page. I used the following code in the 'studentstub.jsp' page :


but all I am getting is a null. The 'j_security_check' servlet is not exactly part of my package, but the glassfish app server. Is there anything wrong in the way I am extracting the information from 'j_security_check' ? Hope someone can advise, thanks.
 
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The getRemoteUser() method in HttpServletRequest returns the username of the authenticated user.
 
Varnam Aayiram
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Devaka Cooray..

Thanks for the reply, I appreciate it. I tried doing what you mentioned and it worked. I replaced this:



with this:



Thanks alot...
 
My pie came with a little toothpic holding up this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic