troubleshooting Question

Obtain User ID in ContextListener

Avatar of Ajay Chowdary Kandula
Ajay Chowdary KandulaFlag for United States of America asked on
Web ServersJavaJava EE
5 Comments2 Solutions823 ViewsLast Modified:
We have ContextListener implemented ( i.e. our class implements javax.servlet.ServletContextListener)

Am trying to obtain the user id and I have ServletContextEvent object available as parameter for contextInitialized

Right now it is hardcoded.

The same username is obtained in JSP like this

      <jstl:set var="userId" scope="session" value="<%= request.getRemoteUser() %>"></jstl:set>

Is there anyway, I obtain the same from JSP, as I need the value that is being set there

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros