|
||||||||||
| 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
org.mentawai.core.Controller
public class Controller
The Mentawai central controller. Mentawai actions are intercepted and executed by this controller. The controller is also responsable for creating and starting the ApplicationManager.
| Field Summary | |
|---|---|
protected static ApplicationContext |
appContext
|
static String |
DEFAULT_CHARSET
|
| Constructor Summary | |
|---|---|
Controller()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Destroy all filters defined in the ApplicationManager, call the destroy() method of ApplicationManager, then call super.destroy() to destroy this servlet (the Controller). |
protected String |
getActionName(javax.servlet.http.HttpServletRequest req)
From the http request, get the action name. |
static javax.servlet.ServletContext |
getApplication()
Returns the ServletContext of your web application. |
static String |
getBasePathForMaven()
|
static javax.servlet.ServletConfig |
getConfig()
|
static ConsequenceProvider |
getConsequenceProvider()
|
protected String |
getInnerActionName(javax.servlet.http.HttpServletRequest req)
The action name may include an Inner Action. |
protected String |
getURI(javax.servlet.http.HttpServletRequest req)
Returns the URI from this request. |
void |
init(javax.servlet.ServletConfig conf)
Initialize the Controller, creating and starting the ApplicationManager. |
static Consequence |
invokeAction(ActionConfig ac,
Action action,
String innerAction,
List<Filter> filters,
StringBuilder returnedResult)
Invoke an action and return the consequence generated by this invocation. |
protected void |
prepareAction(Action action,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Subclasses of this controller may override this method to have a chance to prepare the action before it is executed. |
protected void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
static void |
setAppManager(ApplicationManager applicationManager)
|
static void |
setConsequenceProvider(ConsequenceProvider provider)
|
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
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 |
| Field Detail |
|---|
public static String DEFAULT_CHARSET
protected static ApplicationContext appContext
| Constructor Detail |
|---|
public Controller()
| Method Detail |
|---|
public void init(javax.servlet.ServletConfig conf)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletconf - the ServletConfig.
javax.servlet.ServletExceptionpublic static String getBasePathForMaven()
public static javax.servlet.ServletConfig getConfig()
public static void setConsequenceProvider(ConsequenceProvider provider)
public static ConsequenceProvider getConsequenceProvider()
public void destroy()
destroy in interface javax.servlet.Servletdestroy in class javax.servlet.GenericServletpublic static javax.servlet.ServletContext getApplication()
protected String getURI(javax.servlet.http.HttpServletRequest req)
req -
protected String getActionName(javax.servlet.http.HttpServletRequest req)
req - The http request
protected String getInnerActionName(javax.servlet.http.HttpServletRequest req)
req -
protected void prepareAction(Action action,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
action - The action to prepare for executionreq - The http request (input will need that)res - The http response (output will need that)
protected void service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
IOException
service in class javax.servlet.http.HttpServletjavax.servlet.ServletException
IOException
public static Consequence invokeAction(ActionConfig ac,
Action action,
String innerAction,
List<Filter> filters,
StringBuilder returnedResult)
throws Exception
ac - The ActionConfig which contains the consequences for this
action.action - The action to invoke.innerAction - The inner action to execute or null to execute the regular
action (execute() method).filters - The filters that were applied to the action. (You should pass
an empty list here!)
ActionException - if there was an exception executing the action.
FilterException - if there was an exception executing a filter for the action.
Exceptionpublic static void setAppManager(ApplicationManager applicationManager)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||