org.mmbase.servlet
Class ImageServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.mmbase.servlet.MMBaseServlet
org.mmbase.servlet.BridgeServlet
org.mmbase.servlet.HandleServlet
org.mmbase.servlet.ImageServlet
- All Implemented Interfaces:
- Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, MMBaseStarter
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 40474 2010-01-11 17:35:36Z michiel $
- Author:
- Michiel Meeuwissen
- See Also:
AbstractImages,
Images.executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.util.List>),
AttachmentServlet,
Serialized Form
| Methods inherited from class org.mmbase.servlet.MMBaseServlet |
associateMapping, checkInited, decRefCount, destroy, getBasePath, 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 |
ImageServlet
public ImageServlet()
init
public void init()
throws javax.servlet.ServletException
- Description copied from class:
HandleServlet
- Takes care of the 'expire' init-parameter.
Inits lastmodifiedField.
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
getClassCloud
protected final Cloud getClassCloud()
- Description copied from class:
BridgeServlet
- Obtains a cloud using 'class' security. If e.g. you authorize org.mmbase.servlet.ImageServlet
by class-security for read all rights, it will be used.
- Overrides:
getClassCloud in class HandleServlet
getServletInfo
public 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 Map<String,Integer> 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
- Returns:
- A map of Strings (function) -> Integer (priority). Never null.
getMimeType
protected String getMimeType(Node node)
- Description copied from class:
HandleServlet
- Forces download in browsers.
This is overriden in several extensions.
- Overrides:
getMimeType in class HandleServlet
setContent
protected boolean setContent(BridgeServlet.QueryParts query,
Node node,
String mimeType)
throws IOException
- Content-Disposition header
Sets the content disposition header.
- Overrides:
setContent in class HandleServlet
- Returns:
- true on success
- Throws:
IOException
getServedNode
protected Node getServedNode(BridgeServlet.QueryParts query,
Node node)
throws 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 BridgeServlet.readQuery(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)node - The node which is specified on the URL (obtained by BridgeServlet.getNode(org.mmbase.servlet.BridgeServlet.QueryParts)
- Throws:
IOException- Since:
- MMBase-1.7.4
desperatelyGetNode
protected Node desperatelyGetNode(Cloud cloud,
String nodeIdentifier)
- Overridden to support 'title aliases'.
- Overrides:
desperatelyGetNode in class BridgeServlet
- Since:
- MMBase-1.7.5
MMBase 2.0-SNAPSHOT - null