| javax.servlet.http.HttpServlet org.mmbase.servlet.MMBaseServlet org.mmbase.servlet.BridgeServlet
All known Subclasses: org.mmbase.servlet.Performance,
BridgeServlet | abstract public class BridgeServlet extends MMBaseServlet (Code) | | BridgeServlet is an MMBaseServlet with a bridge Cloud in it. Extending from this makes it easy to
implement servlet implemented with the MMBase bridge interfaces.
An advantage of this is that security is used, which means that you cannot unintentionly serve
content to the whole world which should actually be protected by the security mechanism.
Another advantage is that implementation using the bridge is easier/clearer.
The query of a bridge servlet can possible start with session= in which case the
cloud is taken from that session attribute with that name. Otherewise 'cloud_mmbase' is
supposed. All this is only done if there was a session active at all. If not, or the session
variable was not found, that an anonymous cloud is used.
Object can only be accessed by alias if a mapping on query string is used (so not e.g. /images/*,
but /img.db). Normally this is no problem, because the alias is resolved by the image-tag. But if
for some reason you need aliases to be working on the URL, you must map to URL's with a question mark.
version: $Id: BridgeServlet.java,v 1.33 2007/02/10 16:22:37 nklasens Exp $ author: Michiel Meeuwissen since: MMBase-1.6 |
Inner Class :final public static class QueryParts | |
FILE_PATTERN | final public static Pattern FILE_PATTERN(Code) | | Pattern used for the 'filename' part of the request. The a node-identifying string may be
present in it, and it the one capturing group.
It is a digit optionially followed by +.* (used in ImageServlet for url-triggered icache production)
|
MESSAGE_ATTRIBUTE | final public static String MESSAGE_ATTRIBUTE(Code) | | |
desperatelyGetNode | protected Node desperatelyGetNode(Cloud cloud, String nodeIdentifier)(Code) | | Extensions can override this, to produce a node, even if cloud.hasNode failed. ('title aliases' e.g.).
since: MMBase-1.7.5 |
findCloud | protected Cloud findCloud(Cloud c, String nodeNumber, QueryParts query) throws IOException(Code) | | Tries to find a Cloud which can read the given node.
since: MMBase-1.8 |
getAnonymousCloud | final protected Cloud getAnonymousCloud()(Code) | | Obtains an 'anonymous' cloud.
|
getClassCloud | protected Cloud getClassCloud()(Code) | | 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.
since: MMBase-1.8 |
getCloud | final protected Cloud getCloud(QueryParts qp) throws IOException(Code) | | Obtains a cloud object, using a QueryParts object.
A Cloud or null if unsuccessful (this may not be fatal). |
getCloudName | protected String getCloudName()(Code) | | The name of the mmbase cloud which must be used. At the moment this is not supported (every
mmbase cloud is called 'mmbase').
|
getLastModified | protected long getLastModified(HttpServletRequest req)(Code) | | The idea is that a 'bridge servlet' on default serves 'nodes', and that there could be
defined a 'last modified' time for nodes. This can't be determined right now, so 'now' is
returned.
This function is defined in HttpServlet
|
getNode | final protected Node getNode(QueryParts query) throws IOException(Code) | | Servlets would often need a node. This function provides it.
Parameters: query - A QueryParts object, which you must have obtained by BridgeServlet.readQuery |
getServedNode | protected Node getServedNode(QueryParts qp, Node node) throws IOException(Code) | | If the node associated with the resonse is another node then the node associated with the request.\
(E.g. a icache based on a url with an image node).
Parameters: qp - A QueryParts object, which you must have obtained by BridgeServlet.readQuery Parameters: node - The node which is specified on the URL (obtained by BridgeServlet.getNode since: MMBase-1.7.4 |
main | public static void main(String[] argv)(Code) | | Just to test to damn regexp
|
readQuery | protected QueryParts readQuery(HttpServletRequest req, HttpServletResponse res) throws IOException(Code) | | Creates a QueryParts object which wraps request and response and the parse result of them.
A QueryParts or null if something went wrong (in that case an error was sent, using the response). |
readQuery | public static QueryParts readQuery(String query)(Code) | | since: MMBase-1.7.4 |
readServletPath | public static QueryParts readServletPath(String servletPath)(Code) | | since: MMBase-1.7.4 |
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)
|
|
|