org.faceless.graph2.tag
Class GraphServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.faceless.graph2.tag.GraphServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class GraphServlet
extends HttpServlet

This is the Servlet that processes web-service requests, and retrieves images and/or other files created by the Tag Library or a RequestHandler. Typically there will be no need to override this class - extending it can usually be done by creating a new RequestHandler.

See Also:
Serialized Form

Constructor Summary
GraphServlet()
           
 
Method Summary
protected  boolean authenticate(HttpServletRequest req)
          Return true if the request should be honoured, false otherwise.
 void destroy()
           
 void doGet(HttpServletRequest req, HttpServletResponse res)
           
 void doPost(HttpServletRequest req, HttpServletResponse res)
           
static String getServletPath(ServletContext sc, HttpServletRequest req, boolean relative)
          Get the base path that should be used to request a file from this servlet to retrieve a file.
 void init()
           
protected  void process(HttpServletRequest req, HttpServletResponse res, String xmlstring)
          Called from doGet() and doPost() to process the XML.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
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
 

Constructor Detail

GraphServlet

public GraphServlet()
Method Detail

init

public void init()
          throws ServletException
Overrides:
init in class GenericServlet
Throws:
ServletException

destroy

public void destroy()
Specified by:
destroy in interface Servlet
Overrides:
destroy in class GenericServlet

doGet

public void doGet(HttpServletRequest req,
                  HttpServletResponse res)
           throws ServletException,
                  IOException
Overrides:
doGet in class HttpServlet
Throws:
ServletException
IOException

doPost

public void doPost(HttpServletRequest req,
                   HttpServletResponse res)
            throws ServletException,
                   IOException
Overrides:
doPost in class HttpServlet
Throws:
ServletException
IOException

process

protected void process(HttpServletRequest req,
                       HttpServletResponse res,
                       String xmlstring)
                throws ServletException,
                       IOException
Called from doGet() and doPost() to process the XML.

Parameters:
req - the HTTP request
res - the HTTP response
xmlstring - XML to use for the request
Throws:
ServletException
IOException
Since:
2.4.1

authenticate

protected boolean authenticate(HttpServletRequest req)
Return true if the request should be honoured, false otherwise. By default this method checks the headercheck.n parameters for patterns which will be matched against the supplied headers, e.g. Referer:.*mywebsite.com/.*

Parameters:
req - the request to validate
Since:
2.3.2

getServletPath

public static String getServletPath(ServletContext sc,
                                    HttpServletRequest req,
                                    boolean relative)
Get the base path that should be used to request a file from this servlet to retrieve a file. The returned value should be appended with "pageid" and a "/" character to retrieve the graph

Parameters:
sc - the Servlet Context
req - the Request context
relative - whether the URL is to be relative (true) or include the servlet host and port (false)
Since:
2.4.1


Copyright © 2001-2011 Big Faceless Organization