LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web.struts.action
Class LyStrutsLeonardiAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by leon.view.web.struts.action.LyStrutsLeonardiAction
Direct Known Subclasses:
LyMobileAction, LyStrutsAboutAction, LyStrutsAnswerAction, LyStrutsAuditAction, LyStrutsCloseAction, LyStrutsClosePopupAction, LyStrutsCommandAction, LyStrutsDownloadAction, LyStrutsEventAction, LyStrutsExitAction, LyStrutsHomeAction, LyStrutsInvokeAction, LyStrutsLoginAction, LyStrutsMapAction, LyStrutsPageAction, LyStrutsPopupFrameAction, LyStrutsPrintAction, LyStrutsPushAction, LyStrutsRefreshAction, LyStrutsTargetFrameAction, LyStrutsUpFrameAction

public abstract class LyStrutsLeonardiAction
extends org.apache.struts.action.Action

Type : leon.view.web.struts.LyStrutsLeonardiAction
This Leonardi class implements the Action layer of the Struts framework.
This action is abstract and contains only usefull methods to be used for all Leonardi Struts actions.


Field Summary
static java.lang.String __VERSION
           
static int ADDITIONAL_SCRIPTS_MAX_SIZE
          Maximum length of Ajax refresh scripts before an entire refresh will be performed.
static int GENERATED_PAGE_MAX_SIZE
          Maximum length of generated pages.
 
Fields inherited from class org.apache.struts.action.Action
ACTION_SERVLET_KEY, APPLICATION_KEY, DATA_SOURCE_KEY, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGE_KEY, MESSAGES_KEY, MULTIPART_KEY, PLUG_INS_KEY, REQUEST_PROCESSOR_KEY, SERVLET_KEY, TRANSACTION_TOKEN_KEY
 
Constructor Summary
LyStrutsLeonardiAction()
           
 
Method Summary
 java.io.Writer beginRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, LyStrutsViewManager viewManager)
          Performs some specific operations at the begining of a request.
 boolean checkSessionRegistered(LyStrutsSessionBean bean, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Check if current session is valid and redirect to home page if not.
static java.lang.String decodeUrl(java.lang.String url)
          Decodes an URL by replacing unauthorized characters.
 java.io.Writer dumpToFile(LyStrutsViewManager viewManager, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.Writer out)
          Dump HTML content to files for debug.
 void endRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, LyStrutsViewManager viewManager, java.io.Writer out)
          Performs some specific operations at the end of a request.
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mappings, org.apache.struts.action.ActionForm bean, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This basic implementation of the Struts Action Model returns null (no response).
static void generateAdditionalScripts(LySession session, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.Writer out)
          Generates the scripts created by web components in the standard output.
 java.lang.String getContextReativePath(javax.servlet.http.HttpServletRequest request, java.lang.String page)
          Removes the context path from URLS to enable forwarding into a JSP.
static java.lang.String getParameter(javax.servlet.http.HttpServletRequest request, java.lang.String name)
          Retrieves a parameter in an http request and decode its value.
 void setNoCacheHeaders(javax.servlet.http.HttpServletResponse response, int delay)
          Sets an expiration delay used by the cache : modify the HTTP response header.
 void setRequestAttributes(javax.servlet.http.HttpServletRequest request, LySession session)
          Stores some usefull information as attribute inside an HTTP request.
 
Methods inherited from class org.apache.struts.action.Action
execute, getServlet, perform, perform, setServlet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

ADDITIONAL_SCRIPTS_MAX_SIZE

public static int ADDITIONAL_SCRIPTS_MAX_SIZE
Maximum length of Ajax refresh scripts before an entire refresh will be performed. A negative value indicates that refresh scripts are always sent to the client. It is not recommended to set a value lower than 100000.


GENERATED_PAGE_MAX_SIZE

public static int GENERATED_PAGE_MAX_SIZE
Maximum length of generated pages. A negative value indicates that pages are always sent to the client.

Constructor Detail

LyStrutsLeonardiAction

public LyStrutsLeonardiAction()
Method Detail

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mappings,
                                                      org.apache.struts.action.ActionForm bean,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws java.lang.Exception
This basic implementation of the Struts Action Model returns null (no response).

Overrides:
execute in class org.apache.struts.action.Action
Parameters:
mappings - - The ActionMapping used to select this instance
bean - - The optional ActionForm bean for this request (if any)
request - - The HTTP request we are processing
response - - The HTTP response we are creating
Returns:
null : no response.
Throws:
java.lang.Exception

checkSessionRegistered

public boolean checkSessionRegistered(LyStrutsSessionBean bean,
                                      javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response)
                               throws java.lang.Exception
Check if current session is valid and redirect to home page if not.

Parameters:
bean - - The optional ActionForm bean for this request (if any)
request - - The HTTP request we are processing
response - - The HTTP response we are creating
Returns:
true if session is valid, false otherwise.
Throws:
java.lang.Exception

beginRequest

public java.io.Writer beginRequest(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response,
                                   LyStrutsViewManager viewManager)
Performs some specific operations at the begining of a request.
Do the following operations:

Parameters:
request - The current HTTP request.
response - The current HTTP response.
viewManager - The current view manager.
Returns:
the output writer.

decodeUrl

public static java.lang.String decodeUrl(java.lang.String url)
Decodes an URL by replacing unauthorized characters.

Parameters:
url - The URL to decode.
Returns:
The URL without unauthorized characters.

endRequest

public void endRequest(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       LyStrutsViewManager viewManager,
                       java.io.Writer out)
                throws java.io.IOException
Performs some specific operations at the end of a request.
Clear the current page writer and the current window name.

Parameters:
request - The current HTTP request.
response - The current HTTP response.
viewManager - The current view manager.
Throws:
java.io.IOException

dumpToFile

public java.io.Writer dumpToFile(LyStrutsViewManager viewManager,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 java.io.Writer out)
                          throws java.io.IOException
Dump HTML content to files for debug.

Parameters:
viewManager - the view manager
request - the request
response - the response
out - the out writer
Returns:
the writer with the writed content
Throws:
java.io.IOException

generateAdditionalScripts

public static void generateAdditionalScripts(LySession session,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response,
                                             java.io.Writer out)
                                      throws java.io.IOException
Generates the scripts created by web components in the standard output.

Parameters:
session - The current session.
request - The current HTTP request.
response - The current HTTP response.
out - The response output.
Throws:
java.io.IOException

getContextReativePath

public java.lang.String getContextReativePath(javax.servlet.http.HttpServletRequest request,
                                              java.lang.String page)
Removes the context path from URLS to enable forwarding into a JSP.
Make a path relative to the Servlet context for the given page.
The path beeing build is relative to the root directory of the current WEB application.

Parameters:
request - Current HTTP request.
page - A JSP or HTML page with possibly a context path.
Returns:
the page ready for a forward.

getParameter

public static java.lang.String getParameter(javax.servlet.http.HttpServletRequest request,
                                            java.lang.String name)
Retrieves a parameter in an http request and decode its value.
If the value is multiple, this method just returns the last value.

Parameters:
request - The HTTP request
name - The name of the parameter.
Returns:
The value found in the given HTTP request.

setNoCacheHeaders

public void setNoCacheHeaders(javax.servlet.http.HttpServletResponse response,
                              int delay)
Sets an expiration delay used by the cache : modify the HTTP response header.

Parameters:
response - Current HTTP response.
delay - The expiration delay.

setRequestAttributes

public void setRequestAttributes(javax.servlet.http.HttpServletRequest request,
                                 LySession session)
Stores some usefull information as attribute inside an HTTP request. Then forward to a JSP:

Parameters:
request - Current HTTP request.
session - Current user session

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com