Markus Kirsten wrote:
>
> Thankyou for the example! Do you know how I can use this in a servlet so
> the servlet forwards a request to a page which is protected with HTTP
> Authentication?
>

 For the benefit of any future archive searchers who come
across this thread, I wanted to point out that the code
posted by Marot Laurent <[EMAIL PROTECTED]> uses
classes from the sun.* packages, which is something you
normally want to avoid.

 There's a complete explanation and example of the 1.2
classes in the article I posted a reference to earlier
in this thread. There's a follow article that has an
implementation for pre-1.2 versions of Java that doesn't
use the sun.* packages:

  http://www.javaworld.com/javaworld/javatips/jw-javatip47.html

 But I suspect none of that may be necessary. If your
protected content is on the same server, then you can
just use a RequestDispatcher. Section SRV.12.2 of version
2.3 of the servlet spec[1] has this to say:

   The security model applies to the static content
   part of the web application and to servlets within
   the application that are requested by the client.
   The security model does not apply when a servlet
   uses the RequestDispatcher to invoke a static
   resource or servlet using a forward or an include.

 The servlet spec is easy to read. It's not filled with
obscure terminology, it's not written in spec-speak. It's
targeted towards people who actually use the technology,
and anyone who can write a simple "HelloWorld" servlet
can understand (most of :-) it. Really. I promise.


[1] http://java.sun.com/products/servlet/download.html


--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to