public class ScriptAction extends Action
struts.forwardName
to the name of the forwardstruts.forward
to the actual ActionForward object
request
- The HTTP requestresponse
- The HTTP responsesession
- The sessionapplication
- The servlet contextstruts
- A grouping of all Struts-related objectslog
- A logging instancestruts-scripting.filters.FILTER_NAME.class=FILTER_CLASS
- The class implementing BSFManagerFilter where FILTER_NAME is the name
you are calling the filter.
struts-scripting.filters.FILTER_NAME.PROPERTY_NAME=PROPERTY_VALUE
- A property to be used by the filter.struts-scripting.properties
and add two properties for each
engine:
struts-scripting.engine.ENGINE_NAME.class
- The class of
the BSF engine where ENGINE_NAME is the name you are calling the engine.
struts-scripting.engine.ENGINE_NAME.extensions
- A
comma-delimited list of file extensions that will be used to identify the
engine to use to execute the script.Modifier and Type | Field and Description |
---|---|
protected static String |
ENGINE_BASE
The base property for alternate BSF engines.
|
protected static String |
FILTERS_BASE
The base property for classes that put new variables in the context.
|
protected static org.apache.commons.logging.Log |
LOG
The logging instance.
|
protected static String |
PROPS_PATH
The default path to the properties file.
|
Constructor and Description |
---|
ScriptAction() |
Modifier and Type | Method and Description |
---|---|
ActionForward |
execute(ActionMapping mapping,
ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Executes the script.
|
Locale |
getLocale(javax.servlet.http.HttpServletRequest req)
Gets the locale.
|
boolean |
isCancelled(javax.servlet.http.HttpServletRequest req)
Checks to see if the request is cancelled.
|
boolean |
isTokenValid(javax.servlet.http.HttpServletRequest req)
Checks to see if the token is valid.
|
protected static BSFManagerFilter[] |
loadFilters(Properties props)
Loads and initializes the filters.
|
protected org.apache.struts.scripting.ScriptAction.Script |
loadScript(String name,
javax.servlet.ServletContext context)
Loads the script from cache if possible.
|
protected String |
parseScriptName(String url,
org.apache.bsf.BSFManager manager)
Parses the script name and puts any url parameters in the context.
|
void |
resetToken(javax.servlet.http.HttpServletRequest req)
Resets the token.
|
void |
saveErrors(javax.servlet.http.HttpServletRequest req,
ActionErrors errs)
Deprecated.
Use saveErrors(HttpServletRequest, ActionMessages) instead.
This will be removed after Struts 1.2.
|
void |
saveMessages(javax.servlet.http.HttpServletRequest req,
ActionMessages mes)
Saves the messages to the request.
|
void |
saveToken(javax.servlet.http.HttpServletRequest req)
Saves a token.
|
protected static String[] |
split(String line,
String delimiter)
Splits a line with the given delimiter.
|
addErrors, addMessages, execute, generateToken, getErrors, getMessages, getResources, getResources, getServlet, isTokenValid, saveErrors, saveErrors, saveMessages, setLocale, setServlet
protected static final org.apache.commons.logging.Log LOG
protected static final String PROPS_PATH
protected static final String ENGINE_BASE
protected static final String FILTERS_BASE
public ActionForward execute(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
protected String parseScriptName(String url, org.apache.bsf.BSFManager manager) throws Exception
url
- The script url consisting of a path and optional
parametersmanager
- The BSF manager to declare new parameters inException
- If something goes wrongprotected org.apache.struts.scripting.ScriptAction.Script loadScript(String name, javax.servlet.ServletContext context)
name
- The name of the scriptcontext
- The servlet contextprotected static BSFManagerFilter[] loadFilters(Properties props)
props
- The properties defining the filtersprotected static String[] split(String line, String delimiter)
line
- The line to splitdelimiter
- The string to split withpublic void saveToken(javax.servlet.http.HttpServletRequest req)
public boolean isCancelled(javax.servlet.http.HttpServletRequest req)
isCancelled
in class Action
req
- The request objectpublic boolean isTokenValid(javax.servlet.http.HttpServletRequest req)
isTokenValid
in class Action
req
- The request objectpublic void resetToken(javax.servlet.http.HttpServletRequest req)
resetToken
in class Action
req
- The request objectpublic Locale getLocale(javax.servlet.http.HttpServletRequest req)
public void saveMessages(javax.servlet.http.HttpServletRequest req, ActionMessages mes)
saveMessages
in class Action
req
- The request objectmes
- The action messagespublic void saveErrors(javax.servlet.http.HttpServletRequest req, ActionErrors errs)
req
- The request objecterrs
- The action errorsCopyright © 2000–2017 Apache Software Foundation. All rights reserved.