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 Servlets and the fly likes HTTP_USER_AGENT 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 » Servlets
Bookmark "HTTP_USER_AGENT" Watch "HTTP_USER_AGENT" New topic


Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I'm using JSP with WLS, and am trying to capture the HTTP_USER_AGENT header variable to prepopulate a form text box. I can find no reference in any of the JSP books I have available. Is there any way to the user's network logon?
Rick Sharpless
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
The http user-agent which is part of the request header, is used to determine the type of browser that the client is using. Not sure if that's what you are trying to do.


So much trouble in the world -- Bob Marley
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
OOOPS! It's not the user_agent I'm after. My mistake. I know IIS captures a couple of other variables, and maybe WLS doesn't provide this info. What I'm after is the AUTH_USER or REMOTE_USER variable.
Sorry for the confusion.
Rick Sharpless
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Provided you are using Basic Authenication, you should be able to get the REMOTE_USER from the request object using the getRemoteUser() method.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
THAT WAS IT! Thanks soooo much.
Rick Sharpless
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

your name doesn't agree with the javaranch guidelines.
please take a moment and re-register after reviewing the
guidelines at
thanks for your cooperation.
- satya

Take a Minute, Donate an Hour, Change a Life
I agree. Here's the link:
Similar Threads
Accessing applet string from javascript
java maskeraiding as firefox - how?
Is this an error by Sun?
Pocket PC/Desktop user agents
Not Getting client information from a servlet