|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.buglabs.osgi.sewing.pub.SewingController
public abstract class SewingController
Implement SewingController to handle the requests to your Sewing App Typically these are public inner classes in your SewingHttpServlet, but they don't have to be. The important thing is to map the url to the controller in your SewingHttpServlet.getControllerMap() method. Lastly, the convention is that the controller class name matches the template name which matches the url. But this doesn't have to be the case. To map a different url to a different controller, do so in your SewingHttpServlet implementation's getControllerMap() method. If you only do this, the controller will still use the url to map to the template. To use a different template, override getTemplateName() in your SewingController.
| Field Summary | |
|---|---|
protected boolean |
skip_action
|
| Constructor Summary | |
|---|---|
SewingController()
|
|
| Method Summary | |
|---|---|
void |
beforeGet(RequestParameters params,
HttpServletRequest req,
HttpServletResponse resp)
Override this method if you want to add pre-processing code before a GET request |
void |
beforePost(RequestParameters params,
HttpServletRequest req,
HttpServletResponse resp)
Override this method if you want to add pre-processing code before a POST request |
void |
clearRedirect()
|
boolean |
doRedirect()
Tells servlet to process a redirect if one is pending |
TemplateModelRoot |
get(RequestParameters params,
HttpServletRequest req,
HttpServletResponse resp)
Override this method to handle get requests Default implementation will simply render the correctly named template without any processing |
RedirectInfo |
getRedirectInfo()
|
boolean |
getSkipAction()
|
java.lang.String |
getTemplateName()
Override this method if you need to set a name for your template that is not part of the conventions. |
protected void |
paramDebug(RequestParameters params)
Go ahead and have fun |
TemplateModelRoot |
post(RequestParameters params,
HttpServletRequest req,
HttpServletResponse resp)
Override this method to handle post requests Default implementation will simply render the correctly named template without any processing |
protected void |
redirectTo(java.lang.String url)
This does a simple redirect by setting the meta refresh tag in the html page |
protected void |
render(int requestType,
java.lang.String controllerName,
RequestParameters params,
HttpServletRequest req,
HttpServletResponse resp)
Called from controller to set up for a redirect to a different controller This is the best way to pass params to a new controller |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean skip_action
| Constructor Detail |
|---|
public SewingController()
| Method Detail |
|---|
public boolean getSkipAction()
public TemplateModelRoot get(RequestParameters params,
HttpServletRequest req,
HttpServletResponse resp)
params - req - resp -
public TemplateModelRoot post(RequestParameters params,
HttpServletRequest req,
HttpServletResponse resp)
params - req - resp -
public java.lang.String getTemplateName()
public boolean doRedirect()
public RedirectInfo getRedirectInfo()
public void clearRedirect()
public void beforeGet(RequestParameters params,
HttpServletRequest req,
HttpServletResponse resp)
public void beforePost(RequestParameters params,
HttpServletRequest req,
HttpServletResponse resp)
protected final void render(int requestType,
java.lang.String controllerName,
RequestParameters params,
HttpServletRequest req,
HttpServletResponse resp)
requestType - controller - params - req - resp - protected final void redirectTo(java.lang.String url)
url - protected final void paramDebug(RequestParameters params)
params -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||