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 java.lang.String |
ENGINE_BASE
The base property for alternate BSF engines.
|
protected static java.lang.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 java.lang.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.
|
java.util.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(java.util.Properties props)
Loads and initializes the filters.
|
protected org.apache.struts.scripting.ScriptAction.Script |
loadScript(java.lang.String name,
javax.servlet.ServletContext context)
Loads the script from cache if possible.
|
protected java.lang.String |
parseScriptName(java.lang.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 java.lang.String[] |
split(java.lang.String line,
java.lang.String delimiter)
Splits a line with the given delimiter.
|
addErrors, addMessages, execute, generateToken, getErrors, getMessages, getResources, getResources, getServlet, isTokenValid, saveErrors, saveErrors, saveMessages, setLocale, setServletprotected static final org.apache.commons.logging.Log LOG
protected static final java.lang.String PROPS_PATH
protected static final java.lang.String ENGINE_BASE
protected static final java.lang.String FILTERS_BASE
public ActionForward execute(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
protected java.lang.String parseScriptName(java.lang.String url,
org.apache.bsf.BSFManager manager)
throws java.lang.Exception
url - The script url consisting of a path and optional
parametersmanager - The BSF manager to declare new parameters injava.lang.Exception - If something goes wrongprotected org.apache.struts.scripting.ScriptAction.Script loadScript(java.lang.String name,
javax.servlet.ServletContext context)
name - The name of the scriptcontext - The servlet contextprotected static BSFManagerFilter[] loadFilters(java.util.Properties props)
props - The properties defining the filtersprotected static java.lang.String[] split(java.lang.String line,
java.lang.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 Actionreq - The request objectpublic boolean isTokenValid(javax.servlet.http.HttpServletRequest req)
isTokenValid in class Actionreq - The request objectpublic void resetToken(javax.servlet.http.HttpServletRequest req)
resetToken in class Actionreq - The request objectpublic java.util.Locale getLocale(javax.servlet.http.HttpServletRequest req)
public void saveMessages(javax.servlet.http.HttpServletRequest req,
ActionMessages mes)
saveMessages in class Actionreq - The request objectmes - The action messagespublic void saveErrors(javax.servlet.http.HttpServletRequest req,
ActionErrors errs)
req - The request objecterrs - The action errorsCopyright © 2000–2025 Apache Software Foundation. All rights reserved.