----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Rob,
I had a similar requirement with the last project. I wrote all the
functionality for the parts that required authentication into one servlet.
Then I used ApjServAction in the <VirtualHost> directive in httpd.conf to
call the servlet in question for all files ending in my chosen file
extension.
ie.
<VirtualHost xxx.xxx.com>
...
ApJServAction .ir /servlet/ParseServlet
</VirtualHost>
This worked really well in this situation as I could create an html template
which had the .ir file extension. The full path of the file is passed to
this servlet with the directory and user parameters. The servlet performs
an action depending upon the name of the file passed to it and uses the file
as the html template to output.
If you have lots of different servlets or very different functionality then
this won't be ideal, but it worked really well in my situation.
Good luck
Simon
>
> Hi, I was wondering if it is possible to restrict access to
> servlets by
> setting up a .htacess file in the Servlets directory.
>
> What I want to do is to pick up the remote user name, however
> when I run
> the SnoopServlet that comes with JSDK2.0, the remote user name says
> <none>.
>
> I have restricted access to other parts of my site, that works
> fine (docs area, cgi-bin) . I get asked for authentication and in the
> access.log any requested to pages in that directory send the
> user name.
> If I go the servlet directory and run a servlet, the entry in
> access.log
> does not pass the username through
>
> I have tried putting a .htacess in the servlet directory, but it did
> nothing. I tried adding a directive in http.conf for that
> Directory with
> AllowOveride All and AuthConfig. The servlet will still run.
> Tried with
> and without a trailing slash
>
> I have looked at the FAQ for Authentication, has provided any solution
>
> Essentially I want to be able to do 2 things,
>
> a> restrict acess to the servlets
> b> be able to get the user name of the attached client
>
> Anyone come accross this before? Can anyone please help?
>
> Rob
>
> SYSTEM:
>
> Caldera 2.2,
> Apache 1.3.11
> ApacheJServ 1.1
> JSDK 2.0
>
<-- snip conf files -->
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]