Package eu.clarin.sru.server.utils
Class SRUServerServlet
- java.lang.Object
- 
- javax.servlet.GenericServlet
- 
- javax.servlet.http.HttpServlet
- 
- eu.clarin.sru.server.utils.SRUServerServlet
 
 
 
- 
- All Implemented Interfaces:
- Serializable,- javax.servlet.Servlet,- javax.servlet.ServletConfig
 
 public final class SRUServerServlet extends javax.servlet.http.HttpServletA Servlet implementation, which provides an environment for running aSRUServerin a Servlet container. Your search engine must useSRUSearchEngineBaseas base class.Add the following to the web.xml of your web applications web.xml to define a SRU server. Of course, the value of the Servlet initialization parameter "eu.clarin.sru.server.utils.sruServerSearchEngineClass" must be adapted to match the name of your search engine implementation. Furthermore, you can choose different url-pattern, to match your needs. For example, if your implementation of SRUSearchEngineBaseis "com.acme.MySearchEngine" and you want to map the Servlet to the URI "/sru" the following snippet in your "web.xml" should accomplish the task:<servlet> <servlet-name>SRUServerServlet</servlet-name> <servlet-class>eu.clarin.sru.server.utils.SRUServerServlet</servlet-class> <init-param> <param-name>eu.clarin.sru.server.utils.sruServerSearchEngineClass</param-name> <param-value>com.acme.MySearchEngine</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>SRUServerServlet</servlet-name> <url-pattern>/sru</url-pattern> </servlet-mapping>- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringSRU_SERVER_CONFIG_LOCATION_DEFAULTDefault value for the location of the SRU server configuration.static StringSRU_SERVER_CONFIG_LOCATION_PARAMServlet initialization parameter name for the location of the SRU server configuration.static StringSRU_SERVER_SEARCH_ENGINE_CLASS_PARAMServlet initialization parameter name for the class that implements the SRU search engine.
 - 
Constructor SummaryConstructors Constructor Description SRUServerServlet()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroy the SRU server Servlet.protected voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Handle a HTTP get request.protected voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Handle a HTTP post request.voidinit()Initialize the SRU server Servlet.- 
Methods inherited from class javax.servlet.http.HttpServletdoDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
- 
 
- 
- 
- 
Field Detail- 
SRU_SERVER_CONFIG_LOCATION_PARAMpublic static final String SRU_SERVER_CONFIG_LOCATION_PARAM Servlet initialization parameter name for the location of the SRU server configuration.- See Also:
- Constant Field Values
 
 - 
SRU_SERVER_SEARCH_ENGINE_CLASS_PARAMpublic static final String SRU_SERVER_SEARCH_ENGINE_CLASS_PARAM Servlet initialization parameter name for the class that implements the SRU search engine.- See Also:
- Constant Field Values
 
 - 
SRU_SERVER_CONFIG_LOCATION_DEFAULTpublic static final String SRU_SERVER_CONFIG_LOCATION_DEFAULT Default value for the location of the SRU server configuration.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
initpublic void init() throws javax.servlet.ServletExceptionInitialize the SRU server Servlet.- Overrides:
- initin class- javax.servlet.GenericServlet
- Throws:
- javax.servlet.ServletException
- See Also:
- GenericServlet.init()
 
 - 
destroypublic void destroy() Destroy the SRU server Servlet.- Specified by:
- destroyin interface- javax.servlet.Servlet
- Overrides:
- destroyin class- javax.servlet.GenericServlet
- See Also:
- GenericServlet.destroy()
 
 - 
doGetprotected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOExceptionHandle a HTTP get request.- Overrides:
- doGetin class- javax.servlet.http.HttpServlet
- Throws:
- javax.servlet.ServletException
- IOException
- See Also:
- HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 
 - 
doPostprotected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOExceptionHandle a HTTP post request.- Overrides:
- doPostin class- javax.servlet.http.HttpServlet
- Throws:
- javax.servlet.ServletException
- IOException
- See Also:
- HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 
 
- 
 
-