org.mmbase.servlet
Class ImageServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.mmbase.servlet.MMBaseServlet
              extended byorg.mmbase.servlet.BridgeServlet
                  extended byorg.mmbase.servlet.HandleServlet
                      extended byorg.mmbase.servlet.ImageServlet
All Implemented Interfaces:
MMBaseStarter, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ImageServlet
extends HandleServlet

ImageServlet handles nodes as images. If you want to convert an image (resize it, turn it, change its colors etc) then you want to serve an 'icaches' node ('icaches' are cached conversions of images), which you have to create yourself before calling this servlet. The cache() function of Images can be used for this. An URL can be gotten with cachepath().

Since:
MMBase-1.6
Version:
$Id: ImageServlet.java,v 1.15.2.1 2005/08/15 16:39:12 michiel Exp $
Author:
Michiel Meeuwissen
See Also:
AbstractImages, Images.executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.util.List), AttachmentServlet, Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.mmbase.servlet.BridgeServlet
BridgeServlet.QueryParts
 
Field Summary
 
Fields inherited from class org.mmbase.servlet.BridgeServlet
FILE_PATTERN
 
Fields inherited from class org.mmbase.servlet.MMBaseServlet
mmbase, retryAfter
 
Constructor Summary
ImageServlet()
           
 
Method Summary
protected  java.util.Map getAssociations()
          On default, servlets are not associated with any function.
protected  java.lang.String getMimeType(Node node)
           
protected  Node getServedNode(BridgeServlet.QueryParts query, Node node)
          ImageServlet can serve a icache node in stead (using the 'extra parameters'
 java.lang.String getServletInfo()
          Returns information about this servlet.
 void init()
          The init of an MMBaseServlet checks if MMBase is running.
protected  boolean setContent(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, Node node, java.lang.String mimeType)
          Sets the content disposition header.
 
Methods inherited from class org.mmbase.servlet.HandleServlet
doGet, sendBytes, setCacheControl, setExpires
 
Methods inherited from class org.mmbase.servlet.BridgeServlet
getAnonymousCloud, getCloud, getCloudName, getLastModified, getNode, readQuery, readQuery, readServletPath
 
Methods inherited from class org.mmbase.servlet.MMBaseServlet
associateMapping, checkInited, decRefCount, destroy, getMMBase, getRequestURL, getServletByAssociation, getServletByMapping, getServletMappings, getServletMappingsByAssociation, incRefCount, service, setInitException, setMMBase
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageServlet

public ImageServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException
Description copied from class: MMBaseServlet
The init of an MMBaseServlet checks if MMBase is running. It not then it is started.

Overrides:
init in class HandleServlet
Throws:
javax.servlet.ServletException

getServletInfo

public java.lang.String getServletInfo()
Description copied from class: MMBaseServlet
Returns information about this servlet. Don't forget to override it.

Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class MMBaseServlet

getAssociations

protected java.util.Map getAssociations()
Description copied from class: MMBaseServlet
On default, servlets are not associated with any function. This function is called in the init method.

Overrides:
getAssociations in class HandleServlet

getMimeType

protected java.lang.String getMimeType(Node node)
Overrides:
getMimeType in class HandleServlet

setContent

protected boolean setContent(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse res,
                             Node node,
                             java.lang.String mimeType)
                      throws java.io.IOException
Description copied from class: HandleServlet
Sets the content disposition header.

Overrides:
setContent in class HandleServlet
Returns:
true on success
Throws:
java.io.IOException

getServedNode

protected Node getServedNode(BridgeServlet.QueryParts query,
                             Node node)
                      throws java.io.IOException
ImageServlet can serve a icache node in stead (using the 'extra parameters'

Overrides:
getServedNode in class BridgeServlet
Parameters:
query - A QueryParts object, which you must have obtained by readQuery
node - The node which is specified on the URL (obtained by getNode
Throws:
java.io.IOException
Since:
MMBase-1.7.4


MMBase build 1.7.4.20050922