|
|||||||||||
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
net.sf.ewc.EasyWebController
EasyWebController
is the EWC controller servlet. Its main
responsability is performing user changes on the model, and calling the user
event method after those changes.
Servlet operations
This controller servlet goes through the following stages on each request:
Accepted POST/GET parameters
Every parameter whose name has been formed with
EWCSession.getFullExpression(Object,String)
will be handled as a
model change. This method is called by taglibs to write well formed
parameter names, but can be called directly on a JSP.
There are three special parameters that this servlet accepts:
EWC_PROCESS_GET_PARAMETER
: 'true' to process.EWC_MODEL_CHANGES_PARAMETER
: That can contain a CSV
secuence of model changes in the same way that usual parameters.EWC_EVENT_PARAMETER
: That contains the user event
and that must be well formed using
EWCSession.getEventFullExpression(String, String)
.EWC_DEFAULT_CONTEXT_PARAMETER
: Default context for
those model changes that doesn't specify their context.After the model changes and event processing stages, the control flow is redirected to presentation. The presentation page will be selected on the following basis:
Initialization/configuration parameters
This servlet can be configured with the following initialization parameters:
LOG_FILE
: Log file.LOG_LEVEL
: Log level (ERROR, WARNING, INFO,
FINE, FINER, FINEST).UPLOAD_THRESHOLD
: Uploaded files with a
size below this threshold will be stored in a memory buffer, improving file
upload performance.UPLOAD_MAX_SIZE
: Uploaded files with a size
greater than this value will not be accepted.
Field Summary | |
static java.lang.String |
EWC_DEFAULT_CONTEXT_PARAMETER
Default context parameter |
static java.lang.String |
EWC_EVENT_PARAMETER
The parameter that contains the method to execute after model changes |
static java.lang.String |
EWC_MODEL_CHANGES_PARAMETER
Compact model changes parameter. |
static java.lang.String |
EWC_PROCESS_GET_PARAMETER
True to process GET |
static java.lang.String |
EWC_REQUEST_URI_ATTRIBUTE
Request attribute where the original request URI is stored |
static java.lang.String |
FILEUPLOAD_CONTEXT_ATTRIBUTE
File upload context attribute. |
static java.lang.String |
LOG_FILE
Log file initialization parameter name |
static java.lang.String |
LOG_LEVEL
Log level initialization parameter name |
static java.lang.String |
UPLOAD_MAX_SIZE
Upload maximum size initialization parameter name |
static java.lang.String |
UPLOAD_THRESHOLD
Upload threshold initialization parameter name |
Constructor Summary | |
EasyWebController()
|
Method Summary | |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
GET requests are redirected to the root application context, except when EWC_PROCESS_GET_PARAMETER equals 'true' (this allows you to
pass parameters through URL). |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Processes user requests... |
void |
init()
Servlet initialization. |
static void |
setConsoleLog(java.lang.String level)
Sets a console log |
static void |
setFileLog(java.lang.String logfile,
java.lang.String level)
Sets a file log |
static void |
setLog(java.util.logging.Handler handler,
java.lang.String level)
Sets the package log |
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 |
Field Detail |
public static final java.lang.String EWC_PROCESS_GET_PARAMETER
public static final java.lang.String EWC_DEFAULT_CONTEXT_PARAMETER
public static final java.lang.String EWC_MODEL_CHANGES_PARAMETER
public static final java.lang.String EWC_EVENT_PARAMETER
public static final java.lang.String EWC_REQUEST_URI_ATTRIBUTE
public static final java.lang.String LOG_FILE
public static final java.lang.String LOG_LEVEL
public static final java.lang.String UPLOAD_THRESHOLD
public static final java.lang.String UPLOAD_MAX_SIZE
public static final java.lang.String FILEUPLOAD_CONTEXT_ATTRIBUTE
Constructor Detail |
public EasyWebController()
Method Detail |
public void init()
public static void setFileLog(java.lang.String logfile, java.lang.String level) throws java.lang.SecurityException, java.io.IOException
logfile
- level
-
java.lang.SecurityException
java.io.IOException
public static void setConsoleLog(java.lang.String level)
level
- public static void setLog(java.util.logging.Handler handler, java.lang.String level)
handler
- level
- public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
EWC_PROCESS_GET_PARAMETER
equals 'true' (this allows you to
pass parameters through URL). Images, css, and other files requested by
the client browser using GET method are processed by the default servlet
container as direct requests to the root application context.
request
- The servlet requestresponse
- The servlet response
javax.servlet.ServletException
- Thrown if the requested file cannot be found
java.io.IOException
- Thrown if there's an I/O problempublic void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
request
- response
-
javax.servlet.ServletException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |