|
|||||||||
| 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.opensubsystems.core.www.WebSessionServlet
org.opensubsystems.core.www.WebUIServlet
public class WebUIServlet
Base class for all servlets developed as part of this project, which perform web form processing or execute an action based on request from the user interface. It's main responsibility is to provide default implementation if functionality for form processing is required.
| Field Summary | |
|---|---|
static java.lang.String |
DATA_ATTRIBUTE_REQUEST_PARAM
Name of the generic attribute used to pass some data to the rendering page. |
static java.lang.String |
FORCE_MAXIMIZE_PARAM
Name of the attribute used to pass flag if the dialog has to be maximized. |
static int |
FORM_COUNT_WEBUI
Constants for number of forms recognized by this servlet |
static java.lang.String |
FORM_NAME_REQUEST_PARAM
Parameter used to identify form to be processed. |
static int |
FORM_UNKNOWN_ID
Constants for forms recognized by this servlet |
static java.lang.String |
LOGGEDIN_REQUEST_PARAM
Name of the attribute used to pass flag if the user is logged in. |
protected java.lang.String |
m_strMessageStyleSheet
Style sheet used for message boxes if any. |
static java.lang.String |
ORIGINAL_REQUEST_INFO_REQUEST_PARAM
Name of the generic attribute used to pass some string representation of the current request to the message box page in case it wants to display some troubleshooting information. |
static java.lang.String |
PAGE_TITLE_REQUEST_PARAM
Name of the attribute used to pass page title to the rendering pages. |
static java.lang.String |
WEBUI_MESSAGEBOX_PAGE
Property used to specify page to display messages to user for example in case of error. |
static java.lang.String |
WEBUI_MESSAGEBOX_STYLE_SHEET
Property used to specify stylesheet used to display messages to user for example in case of error. |
| Constructor Summary | |
|---|---|
WebUIServlet()
|
|
| Method Summary | |
|---|---|
protected void |
cacheDispatcher(java.lang.String strUIID,
java.lang.String strUIPath)
Cache dispatcher to given resource if caching is possible. |
protected void |
cacheUIPath(javax.servlet.ServletConfig scConfig,
java.lang.String strUIID,
java.lang.String strErrorMessage)
Cache path to portion of user interface by first search servlet configuration information and if not found then other predefined locations. |
protected void |
displayUI(java.lang.String strUIID,
javax.servlet.http.HttpServletRequest hsrqRequest,
javax.servlet.http.HttpServletResponse hsrpResponse)
Get handle to resource responsible for rendering of specified part of UI |
protected int |
getFormToProcess(javax.servlet.http.HttpServletRequest hsrqRequest)
Examine request and find out what form needs to be processed. |
java.lang.String |
getServletInfo()
|
void |
init(javax.servlet.ServletConfig scConfig)
|
protected void |
messageBoxPage(javax.servlet.http.HttpServletRequest hsrqRequest,
javax.servlet.http.HttpServletResponse hsrpResponse,
java.lang.String strPageTitle,
java.lang.String strMessage,
java.lang.String strProceedURL,
java.lang.Throwable cause)
Display page with a message to the user. |
protected void |
messageBoxPage(javax.servlet.http.HttpServletRequest hsrqRequest,
javax.servlet.http.HttpServletResponse hsrpResponse,
java.lang.String strPageTitle,
java.lang.String strMessage,
java.lang.String strProceedURL,
java.lang.Throwable cause,
java.lang.String strUIPage)
Display page with a message to the user, when there was a file error. |
protected void |
preservice(javax.servlet.http.HttpSession hsSession,
javax.servlet.http.HttpServletRequest hsrqRequest,
javax.servlet.http.HttpServletResponse hsrpResponse,
boolean bLoginVerified)
This method gives derived servlets execute common logic which needs to be executed for each request. |
protected void |
setLoggedInFlag(javax.servlet.http.HttpServletRequest hsrqRequest,
javax.servlet.http.HttpServletResponse hsrpResponse)
If the user has logged in, this method will set necessary flag to mark the page that way. |
| Methods inherited from class org.opensubsystems.core.www.WebSessionServlet |
|---|
destroy, getLoginRedirect, handleNewSession, isApplicationSecure, isDispatcherCachingEnabled, isLoginSecure, redirect, redirectToHandshake, redirectToLogin, resetLoginRedirect, saveLoginRedirect, service, shouldRequestBeSecure, verifyLogin |
| 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, 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 WEBUI_MESSAGEBOX_PAGE
public static final java.lang.String WEBUI_MESSAGEBOX_STYLE_SHEET
public static final java.lang.String ORIGINAL_REQUEST_INFO_REQUEST_PARAM
public static final java.lang.String DATA_ATTRIBUTE_REQUEST_PARAM
public static final java.lang.String PAGE_TITLE_REQUEST_PARAM
public static final java.lang.String LOGGEDIN_REQUEST_PARAM
public static final java.lang.String FORCE_MAXIMIZE_PARAM
public static final java.lang.String FORM_NAME_REQUEST_PARAM
FORM_UNKNOWN_ID,
getFormToProcess(javax.servlet.http.HttpServletRequest),
Constant Field Valuespublic static final int FORM_UNKNOWN_ID
FORM_NAME_REQUEST_PARAM,
getFormToProcess(javax.servlet.http.HttpServletRequest),
Constant Field Valuespublic static final int FORM_COUNT_WEBUI
protected java.lang.String m_strMessageStyleSheet
| Constructor Detail |
|---|
public WebUIServlet()
| Method Detail |
|---|
public void init(javax.servlet.ServletConfig scConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class WebSessionServletjavax.servlet.ServletExceptionpublic java.lang.String getServletInfo()
getServletInfo in interface javax.servlet.ServletgetServletInfo in class WebSessionServlet
protected void preservice(javax.servlet.http.HttpSession hsSession,
javax.servlet.http.HttpServletRequest hsrqRequest,
javax.servlet.http.HttpServletResponse hsrpResponse,
boolean bLoginVerified)
throws javax.servlet.ServletException,
java.io.IOException
preservice in class WebSessionServlethsSession - - HTTP session objecthsrqRequest - - the servlet request.hsrpResponse - - the servlet response.bLoginVerified - - true if login was verified or it is not required,
false if we are redirecting to the login page
javax.servlet.ServletException - - problems redirecting to login
java.io.IOException - - problems redirecting to login
protected final void cacheUIPath(javax.servlet.ServletConfig scConfig,
java.lang.String strUIID,
java.lang.String strErrorMessage)
throws javax.servlet.ServletException
scConfig - - servlet config to read parameters fromstrUIID - - unique ID of the configuration parameter used to specify
user interface which is URL or path to some kind of
rendering page (e.g. JSP page)strErrorMessage - - error message to display if the path doesn't exist
javax.servlet.ServletException - - problem finding the specified UI
protected final void cacheDispatcher(java.lang.String strUIID,
java.lang.String strUIPath)
throws javax.servlet.ServletException
strUIID - - unique ID of the configuration parameter used to specify this UIstrUIPath - - path to given resource
javax.servlet.ServletException - - problem finding the specified UI
protected final void displayUI(java.lang.String strUIID,
javax.servlet.http.HttpServletRequest hsrqRequest,
javax.servlet.http.HttpServletResponse hsrpResponse)
throws javax.servlet.ServletException,
java.io.IOException
strUIID - - unique ID of the configuration parameter used to specify
UI to display. This is the same ID previously passed into
cacheUIPath method.hsrqRequest - - the servlet request.hsrpResponse - - the servlet response.
javax.servlet.ServletException - - problems displaying UI
java.io.IOException - - problems displaying UI
protected void setLoggedInFlag(javax.servlet.http.HttpServletRequest hsrqRequest,
javax.servlet.http.HttpServletResponse hsrpResponse)
hsrqRequest - - the servlet request.hsrpResponse - - the servlet response.
protected void messageBoxPage(javax.servlet.http.HttpServletRequest hsrqRequest,
javax.servlet.http.HttpServletResponse hsrpResponse,
java.lang.String strPageTitle,
java.lang.String strMessage,
java.lang.String strProceedURL,
java.lang.Throwable cause)
throws java.io.IOException,
javax.servlet.ServletException
hsrqRequest - - the servlet request.hsrpResponse - - the servlet response.strPageTitle - - title of the message boxstrMessage - - message to display in the message boxstrProceedURL - - what URL to proceed tocause - - what was the cause of the problem if any
javax.servlet.ServletException - - an error has occured while displaying message box
java.io.IOException - - error writing response
protected void messageBoxPage(javax.servlet.http.HttpServletRequest hsrqRequest,
javax.servlet.http.HttpServletResponse hsrpResponse,
java.lang.String strPageTitle,
java.lang.String strMessage,
java.lang.String strProceedURL,
java.lang.Throwable cause,
java.lang.String strUIPage)
throws java.io.IOException,
javax.servlet.ServletException
hsrqRequest - - the servlet request.hsrpResponse - - the servlet response.strPageTitle - - title of the message boxstrMessage - - message to display in the file message boxstrProceedURL - - what URL to proceed tocause - - what was the cause of the problem if anystrUIPage - -
javax.servlet.ServletException - - an error has occured while displaying file message box
java.io.IOException - - error writing responseprotected int getFormToProcess(javax.servlet.http.HttpServletRequest hsrqRequest)
hsrqRequest - - the servlet request, which is used to find out
what form needs to be processed
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||