Package edu.vt.middleware.ldap.servlets
Class SearchServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- edu.vt.middleware.ldap.servlets.SearchServlet
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public final class SearchServlet extends javax.servlet.http.HttpServlet
SearchServlet
is a servlet which queries an LDAP and returns the result as LDIF or DSML. The following init params can be set for this servlet: edu.vt.middleware.ldap.servlets.propertiesFile - to load ldap properties from edu.vt.middleware.ldap.servlets.outputFormat - type of output to produce, 'ldif' or 'dsml' Example: http://www.server.com/Search?query=uid=dfisher If you need to pass complex queries, such as (&(cn=daniel*)(surname=fisher)), then the query must be form encoded. If you only want to receive a subset of attributes those can be specified. Example: http://www.server.com/Search?query=uid=dfisher&attrs=givenname&attrs=surnameLDIF
The content returned by the servlet is of type text/plain.
DSML
The content returned by the servlet is of type text/xml, if you want to receive the content as text/plain that can be specified as well. Example: http://www.server.com/Search?query=uid=dfisher&content-type=text By default DSML version 1 is returned, if you want to receive DSML version 2 then you must pass in the dsml-version parameter. Example: http://www.server.com/Search?query=uid=dfisher&dsml-version=2
- Version:
- $Revision: 1330 $ $Date: 2010-05-24 00:10:53 +0200 (Mon, 24 May 2010) $
- Author:
- Middleware Services
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SearchServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.void
init(javax.servlet.ServletConfig config)
Initialize this servlet.void
service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Handle all requests sent to this servlet.-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Method Detail
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
Initialize this servlet.- Specified by:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in classjavax.servlet.GenericServlet
- Parameters:
config
-ServletConfig
- Throws:
javax.servlet.ServletException
- if an error occurs
-
service
public void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
Handle all requests sent to this servlet.- Overrides:
service
in classjavax.servlet.http.HttpServlet
- Parameters:
request
-HttpServletRequest
response
-HttpServletResponse
- Throws:
javax.servlet.ServletException
- if an error occursjava.io.IOException
- if an error occurs
-
destroy
public void destroy()
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.- Specified by:
destroy
in interfacejavax.servlet.Servlet
- Overrides:
destroy
in classjavax.servlet.GenericServlet
-
-