| javax.servlet.http.HttpServlet org.mmbase.servlet.MMBaseServlet
All known Subclasses: org.mmbase.servlet.BridgeServlet,
MMBaseServlet | public class MMBaseServlet extends HttpServlet implements MMBaseStarter(Code) | | MMBaseServlet is a base class for other MMBase servlets (like ImageServlet). Its main goal is to
store a MMBase instance for all its descendants, but it can also be used as a serlvet itself, to
show MMBase version information.
version: $Id: MMBaseServlet.java,v 1.71 2007/11/28 17:10:04 michiel Exp $ author: Michiel Meeuwissen since: MMBase-1.6 |
Field Summary | |
protected MMBase | mmbase MMBase reference. | protected int | retryAfter If MMBase has not been started, a 503 is given, with this value for the 'Retry-After' header. |
mmbase | protected MMBase mmbase(Code) | | MMBase reference. While null, servlet does not accept request.
|
retryAfter | protected int retryAfter(Code) | | If MMBase has not been started, a 503 is given, with this value for the 'Retry-After' header.
See rfc 2616, section 10.5.4.
Defaults to 60 seconds, can be configured in web.xml with the 'retry-after' propery on the servlets.
since: MMBase-1.7.2 |
associateMapping | protected static synchronized void associateMapping(String function, String servletMapping, Integer priority)(Code) | | Associate a given servletmapping with the given function.
Use this to set a servletmapping to call for a certain type of operation or data (i.e 'image-processing');
For now, only one servletmapping can be registered.
Parameters: function - the function that identifies the type of association Parameters: servletMapping - mapping of the servlet to associate with the function Parameters: priority - priority of this association, the association only occurs if no servlet or servletmappingwith higher priority for the same function is present already |
checkInited | protected boolean checkInited(HttpServletResponse res) throws ServletException, IOException(Code) | | This methods can be (and is) called in the beginning of
service. It sends an UNAVAILABLE error if MMBase has not bee
started, or throws an exeption if that was unsuccessful.
A boolean. If false, then service must return immediately (because mmbase has not been inited yet). since: MMBase-1.7.2 |
decRefCount | protected void decRefCount(HttpServletRequest req)(Code) | | Decrease the reference count of the servlet
Parameters: req - The HttpServletRequest. |
destroy | public void destroy()(Code) | | |
getAssociations | protected Map<String, Integer> getAssociations()(Code) | | On default, servlets are not associated with any function.
This function is called in the init method.
A map of Strings (function) -> Integer (priority). Never null. |
getMMBase | public MMBase getMMBase()(Code) | | Returns the MMBase instance.
since: MMBase-1.7 |
getRequestURL | protected static String getRequestURL(HttpServletRequest req)(Code) | | Return URI with QueryString appended
Parameters: req - The HttpServletRequest. |
getServletByAssociation | public static String getServletByAssociation(String function)(Code) | | Gets the name of the servlet that performs actions associated with the
the given function.
Use this to find a servlet to handle a certain type of
operation or data (i.e 'imageservlet', 'myimageservlet',
'images');
Parameters: function - the function that identifies the type of association the name of the servlet associated with the function, or null if there is none |
getServletByMapping | public static HttpServlet getServletByMapping(String mapping)(Code) | | Gets the servlet that belongs to the given mapping
Parameters: mapping - the mapping used to access the servlet the Servlet that handles the mapping |
getServletInfo | public String getServletInfo()(Code) | | Returns information about this servlet. Don't forget to override it.
|
getServletMappings | public static List<String> getServletMappings(String servletName)(Code) | | Gets all the mappings for a given servlet. So, this is a method to obtain info from web.xml.
Parameters: servletName - the name of the servlet an unmodifiable list of servlet mappings for this servlet |
getServletMappingsByAssociation | public static List<String> getServletMappingsByAssociation(String function)(Code) | | Gets all the mappings for a given association.
Use this to find out how to call a servlet to handle a certain
type of operation or data (i.e 'images', 'attachments').
Parameters: function - the function that identifies the type of association an unmodifiable list of servlet mappings associated with the function |
incRefCount | protected void incRefCount(HttpServletRequest req)(Code) | | Increase the reference count of the servlet (for debugging)
and send running servlets to log once every 32 requests
Parameters: req - The HttpServletRequest. |
init | public void init() throws ServletException(Code) | | The init of an MMBaseServlet checks if MMBase is running. It not then it is started.
|
setInitException | public void setInitException(ServletException e)(Code) | | Called by MMBaseStartThread, if something went wrong during
initialization of MMBase. It will be thrown by checkInited
then.
since: MMBase-1.7 |
setMMBase | public void setMMBase(MMBase mmb)(Code) | | Sets the mmbase member. Can be overriden to implement extra initalization for the servlet which needs a running MMBase.
since: MMBase-1.7 |
Methods inherited from javax.servlet.http.HttpServlet | protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected long getLastModified(HttpServletRequest req)(Code)(Java Doc) protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)
|
|
|