Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ask for a password from a Servlet
12-14-2010, 08:47 AM (This post was last modified: 12-14-2010 08:49 AM by tutorials4u.)
Post: #1
Ask for a password from a Servlet
public void askPassword(HttpServletResponse response) {
response.setStatus(response.SC_UNAUTHORIZED);
response.setHeader("WWW-Authenticate",
"BASIC realm=\"protected-area\"");
}

Note: then the browser will popup a dialog for username/password
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:



Send your comments, Suggestions or Queries regarding this site at info@tutorials4u.net

Copyright © 2010 Tutorials4u.net All Rights Reserved