GeeCON Prague 2014*
The moose likes Servlets and the fly likes Sending user name and password from HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Sending user name and password from HTML" Watch "Sending user name and password from HTML" New topic
Author

Sending user name and password from HTML

Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
Hello, I was wondering if any one knows how to send Authorization header to a servlet from a client that will include both password and username.
Thank you.
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
To place information into the http header of a clients request, you use the method in HttpServletResponse setHeader(String name, String value). After that when the client makes any subsquent requests to your site you can retrieve this same information using the method in HttpServletRequest getHeader(String name) which returns the String value that you placed in the header.
Hope this helps

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
Thanks Carl!
 
GeeCON Prague 2014
 
subject: Sending user name and password from HTML