com.yworks.yfiles.server.graphml.servlets
Class LoadGraphServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.yworks.yfiles.server.graphml.servlets.LoadGraphServlet
All Implemented Interfaces:
java.io.Serializable, Servlet, ServletConfig

public abstract class LoadGraphServlet
extends HttpServlet

Simple abstract base servlet that can send a GraphML file from the server to the flash client. Subclasses need to override getInputStream(javax.servlet.http.HttpServletRequest) to return a stream to send to the client for a given request.

If getInputStream returns null, the status 204 (no content) response code is sent.

See Also:
Serialized Form

Constructor Summary
LoadGraphServlet()
           
 
Method Summary
protected  void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
           
protected  void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
           
protected  java.lang.String getContentType()
          Get the content type that will be used for the response header.
protected abstract  java.io.InputStream getInputStream(HttpServletRequest httpServletRequest)
          Get a stream to send to the client.
 
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, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoadGraphServlet

public LoadGraphServlet()
Method Detail

doPost

protected void doPost(HttpServletRequest httpServletRequest,
                      HttpServletResponse httpServletResponse)
               throws ServletException,
                      java.io.IOException
Throws:
ServletException
java.io.IOException

getContentType

protected java.lang.String getContentType()
Get the content type that will be used for the response header.

Depending on the servlet container configuration, the response content type might determine whether the servlet container sends a compressed response.

Returns:
A conten MIME type. This implementation returns "text/html".

getInputStream

protected abstract java.io.InputStream getInputStream(HttpServletRequest httpServletRequest)
                                               throws java.io.IOException
Get a stream to send to the client.

Parameters:
httpServletRequest - the request that used by the client.
Returns:
a stream or null.
Throws:
java.io.IOException - if an IO failure occurs.

doGet

protected void doGet(HttpServletRequest httpServletRequest,
                     HttpServletResponse httpServletResponse)
              throws ServletException,
                     java.io.IOException
Throws:
ServletException
java.io.IOException


Copyright © 2000-2013 yWorks GmbH. All rights reserved