|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
biz.hammurapi.web.StylingServlet
biz.hammurapi.web.DispatchingServlet
Dispatching servlet dispatches requests to action methods. Action method is any method which takes 3 parameters: HttpServletRequest, HttpServletResponse, DispatchingServlet or two parameters HttpServletRequest and HttpServletResponse. Return value of action method is processed in the following way: a) If it is instance of Forward then forward is performed b) If it is instance of String then it is gets written to response output stream. c) Otherwise it is XML-ized and then styled.
| Nested Class Summary |
| Nested classes inherited from class biz.hammurapi.web.StylingServlet |
StylingServlet.TransformCommand |
| Field Summary |
| Fields inherited from class biz.hammurapi.web.StylingServlet |
parameterizer |
| Constructor Summary | |
DispatchingServlet()
|
|
| Method Summary | |
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP GET method. |
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP POST method. |
java.lang.String |
executeAction(java.lang.String pathInfo,
biz.hammurapi.config.Context ctx)
|
protected abstract java.lang.Object |
getActionInstance(java.lang.String path)
Extracts instance name from the path and returns instance for the path. |
protected abstract java.lang.String |
getActionName(java.lang.String path)
|
protected biz.hammurapi.xml.dom.CompositeDomSerializer |
getDomSerializer()
Override this method to return custom serializer if needed. |
void |
init(javax.servlet.ServletConfig config)
|
protected void |
processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
void |
style(java.lang.Object ret,
java.lang.String styleName,
biz.hammurapi.config.Context context,
javax.xml.transform.Result result)
Converts object returned from action to XML and applies style |
void |
style(java.lang.Object ret,
java.lang.String styleName,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Converts object returned from action to XML and applies style |
protected abstract int |
styleSeparatorPosition()
|
protected void |
verifyMethod(java.lang.reflect.Method method)
Subclasses can override this method and throw an exception of methods which are not supposed to be dispatched to. |
| Methods inherited from class biz.hammurapi.web.StylingServlet |
getSetParametersCallback, getTransformer, newDocumentBuilder |
| 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, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DispatchingServlet()
| Method Detail |
protected biz.hammurapi.xml.dom.CompositeDomSerializer getDomSerializer()
getDomSerializer in class StylingServlet
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class StylingServletjavax.servlet.ServletException
protected abstract java.lang.Object getActionInstance(java.lang.String path)
throws HammurapiWebException
HammurapiWebException
protected abstract java.lang.String getActionName(java.lang.String path)
throws HammurapiWebException
path -
HammurapiWebExceptionprotected abstract int styleSeparatorPosition()
protected void verifyMethod(java.lang.reflect.Method method)
throws HammurapiWebException
method -
HammurapiWebException
protected void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
GET method.
doGet in class StylingServletrequest - servlet requestresponse - servlet response
javax.servlet.ServletException
java.io.IOException
protected void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
POST method.
doPost in class StylingServletrequest - servlet requestresponse - servlet response
javax.servlet.ServletException
java.io.IOException
protected void processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
processRequest in class StylingServletjavax.servlet.ServletException
java.io.IOException
public java.lang.String executeAction(java.lang.String pathInfo,
biz.hammurapi.config.Context ctx)
throws javax.servlet.ServletException,
java.io.IOException
javax.servlet.ServletException
java.io.IOException
public void style(java.lang.Object ret,
java.lang.String styleName,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.xml.parsers.ParserConfigurationException,
javax.xml.parsers.FactoryConfigurationError,
javax.servlet.ServletException
ret - Object to be styledstyleName - Style namerequest - requestresponse - response
javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.FactoryConfigurationError
javax.servlet.ServletException
public void style(java.lang.Object ret,
java.lang.String styleName,
biz.hammurapi.config.Context context,
javax.xml.transform.Result result)
throws javax.xml.parsers.ParserConfigurationException,
HammurapiWebException
ret - Object to be styledstyleName - Style name
javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.FactoryConfigurationError
javax.servlet.ServletException
HammurapiWebException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||