org.purl.sword.client
Class ServletClient

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.purl.sword.client.ServletClient
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ServletClient
extends javax.servlet.http.HttpServlet

Example client that runs as a Servlet.

Author:
Stuart Lewis
See Also:
Serialized Form

Field Summary
static String userAgent
          The user agent name of this library
 
Constructor Summary
ServletClient()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handle a get request.
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process the post.
 void init()
          Initialise the servlet.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userAgent

public static final String userAgent
The user agent name of this library

See Also:
Constant Field Values
Constructor Detail

ServletClient

public ServletClient()
Method Detail

init

public void init()
Initialise the servlet.

Overrides:
init in class javax.servlet.GenericServlet

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     IOException
Handle a get request. Simply show the default form (form.jsp)

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - The request details
response - The response to write to.
Throws:
javax.servlet.ServletException
IOException

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      IOException
Process the post. Determine if the request is for a post or service document. Then, dispatch the request to the appropriate handler.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - The request details.
response - The response to write to.
Throws:
javax.servlet.ServletException
IOException


Copyright © 2011 DuraSpace. All Rights Reserved.