[jcifs] usage jcifs with servlets

Michael.Jagusch at it.nrw.de Michael.Jagusch at it.nrw.de
Fri Aug 14 05:28:23 MDT 2009

i have the apprehension that this is really a littleness, but i have not found a good documentation for my problem.
i am trying to use jcifs to read userdata (login id only) in my servlet via the getRemoteUser() method. 
i have downloaded the version 1.3.11 of jcifs (tomcat 5.5, java 1.5.x) and already read the documentation and 
viewed the examples. But i really dont found an example for this standard problem. 
So i hope, you can give me a little help. 
In the documentation is described that the web.xml should be extended with the jcifs filters and the jcif[..].jar should be 
located in the lib directory of the servlet. Than the HttpServletRequest.getRemoteUser() method supplies the connected user.

My web.xml looks like that:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee <http://java.sun.com/xml/ns/j2ee> " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance <http://www.w3.org/2001/XMLSchema-instance> " xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee <http://java.sun.com/xml/ns/j2ee>  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd <http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd> ">
The Servlet reads only the remote user:

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	PrintWriter out = response.getWriter();
	out.println("Remote User: " + request.getRemoteUser() + "<BR>");

When i use the standard web.xml, i can access the servlet - successfully. When i am use the extended web.xml with
the jcifs filters i get the message 404 "The Requested resource [..] not available". In the examples directory 
the web.xml doesnt contain the servlet Tags, when i remove this i get logically the same message from tomcat. 
So the web.xml doesnt correspond to the given servlet example.

Has anybody experience in that, any idea or a good documentation, how to use jcifs within a servlet?

Many thanks in advance.

Michael Jagusch

More information about the jCIFS mailing list