Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Authentication not happening in IE

 
Jody Seigle
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm attempting to provide basic authentication using a simple servlet. The code should display a dialog prompting for username and password. If Cancel is pressed then an error page will be displayed. The following code accomplishes this in Netscape :
resp is a HttpServletResponse

However the dialog box does not display in Internet Explorer, the error page immediately displays. I've gotten around this by using the PrintStream in the HttpServletResponse and calling setStatus without the error page but I would like to know why this is occurring. This is only happening with a recent upgrade to the servlet API version 2.2.
I've found this problem posted on sun's java forums with no solution. Thanks for any help.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which application server are you using? If it supports basic authentication (and it should!) you can get everything you want via configuration rather than having to code it.
Security via configuration is the prefered mechanism since it covers a range of resources rather than having to protect each page separately.
Dave
 
Jody Seigle
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No app server. Just Netscape Enterprise web server 6.0 and HTML pages.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic