Author: mrdon
Date: Sat Dec 17 11:17:51 2005
New Revision: 357368
URL: http://svn.apache.org/viewcvs?rev=357368&view=rev
Log:
Fixed most checkstyle errors, added package file
Added:
struts/scripting/trunk/src/java/org/apache/struts/scripting/package.html
(with props)
Modified:
struts/scripting/trunk/src/java/org/apache/struts/scripting/BSFManagerFilter.java
struts/scripting/trunk/src/java/org/apache/struts/scripting/RequestToVariableFilter.java
struts/scripting/trunk/src/java/org/apache/struts/scripting/ScriptAction.java
struts/scripting/trunk/src/java/org/apache/struts/scripting/StrutsInfo.java
struts/scripting/trunk/src/java/org/apache/struts/scripting/TestFilter.java
Modified:
struts/scripting/trunk/src/java/org/apache/struts/scripting/BSFManagerFilter.java
URL:
http://svn.apache.org/viewcvs/struts/scripting/trunk/src/java/org/apache/struts/scripting/BSFManagerFilter.java?rev=357368&r1=357367&r2=357368&view=diff
==============================================================================
---
struts/scripting/trunk/src/java/org/apache/struts/scripting/BSFManagerFilter.java
(original)
+++
struts/scripting/trunk/src/java/org/apache/struts/scripting/BSFManagerFilter.java
Sat Dec 17 11:17:51 2005
@@ -1,3 +1,20 @@
+/*
+ * $Id$
+ *
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.struts.scripting;
// util imports:
@@ -9,25 +26,28 @@
/**
* Defines a class that wants to manipulate the contents of the scripting
- * context before the script is executed. An example would be a class that
- * puts business facade classes in the context.
+ * context before the script is executed. An example would be a class that
puts
+ * business facade classes in the context.
*/
public interface BSFManagerFilter {
/**
- * Initializes the filter. Properties can be retrieved as:
- *
<code>struts-scripting.filters.FILTER_NAME.PROPERTY_NAME=PROPERTY_VALUE</code>
- * where FILTER_NAME is the "name" parameter.
+ * Initializes the filter. Properties can be retrieved as: <code>
+ * struts-scripting.filters.FILTER_NAME.PROPERTY_NAME=PROPERTY_VALUE
+ * </code> where FILTER_NAME is the "name" parameter.
*
- * @param name The name of the filter
- * @param props The properties
+ [EMAIL PROTECTED] name The name of the filter
+ [EMAIL PROTECTED] props The properties
*/
- public void init(String name, Properties props);
+ void init(String name, Properties props);
+
/**
* Applies the filter.
*
- * @param mgr The scripting manager
+ [EMAIL PROTECTED] mgr The scripting manager
+ [EMAIL PROTECTED] The scripting manager
*/
- public BSFManager apply(BSFManager mgr);
+ BSFManager apply(BSFManager mgr);
}
+
Modified:
struts/scripting/trunk/src/java/org/apache/struts/scripting/RequestToVariableFilter.java
URL:
http://svn.apache.org/viewcvs/struts/scripting/trunk/src/java/org/apache/struts/scripting/RequestToVariableFilter.java?rev=357368&r1=357367&r2=357368&view=diff
==============================================================================
---
struts/scripting/trunk/src/java/org/apache/struts/scripting/RequestToVariableFilter.java
(original)
+++
struts/scripting/trunk/src/java/org/apache/struts/scripting/RequestToVariableFilter.java
Sat Dec 17 11:17:51 2005
@@ -1,3 +1,20 @@
+/*
+ * $Id$
+ *
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.struts.scripting;
// util imports:
@@ -15,66 +32,70 @@
/**
- * Takes request parameters and declares variables with them. If a variable
- * is already exists with that name, a "_" is prepended to the name. Both
- * Strings and arrays are recognized.
+ * Takes request parameters and declares variables with them. If a variable is
+ * already exists with that name, a "_" is prepended to the name. Both Strings
+ * and arrays are recognized.
*/
public class RequestToVariableFilter implements BSFManagerFilter {
- private static final Log log = LogFactory.getLog(TestFilter.class);
+ /** The logging instance. */
+ private static final Log LOG = LogFactory.getLog(TestFilter.class);
+
/**
* Initializes the filter.
*
- * @param name The name of the filter
- * @param props The properties
+ [EMAIL PROTECTED] name The name of the filter
+ [EMAIL PROTECTED] props The properties
*/
- public void init(String name, Properties props) {}
+ public void init(String name, Properties props) { }
+
/**
* Applies the filter.
*
- * @param mgr The bsf manager
- * @return The bsf manager
+ [EMAIL PROTECTED] mgr The bsf manager
+ [EMAIL PROTECTED] The bsf manager
*/
public BSFManager apply(BSFManager mgr) {
- HttpServletRequest request =
(HttpServletRequest)mgr.lookupBean("request");
+ HttpServletRequest request =
+ (HttpServletRequest) mgr.lookupBean("request");
String[] values = null;
- String name = null, newName = null;
+ String name = null;
+ String newName = null;
Object o = null;
- for (Enumeration e = request.getParameterNames(); e.hasMoreElements();
) {
- name = (String)e.nextElement();
+ for (Enumeration e = request.getParameterNames();
+ e.hasMoreElements();) {
+ name = (String) e.nextElement();
o = mgr.lookupBean(name);
if (o == null) {
newName = name;
- }
- else {
+ } else {
newName = "_" + name;
}
values = request.getParameterValues(name);
try {
- if (values.length>1) {
+ if (values.length > 1) {
mgr.declareBean(newName, values, values.getClass());
- if (log.isDebugEnabled()) {
- log.debug("creating array var "+newName);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("creating array var " + newName);
}
- }
- else {
+ } else {
mgr.declareBean(newName, values[0], String.class);
- if (log.isDebugEnabled()) {
- log.debug("creating string var "+newName);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("creating string var " + newName);
}
}
- }
- catch (BSFException ex) {
- log.warn("Unable to set variable "+newName, ex);
+ } catch (BSFException ex) {
+ LOG.warn("Unable to set variable " + newName, ex);
}
}
- if (log.isDebugEnabled()) {
- log.debug("Done filtering");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Done filtering");
}
return mgr;
}
}
+
Modified:
struts/scripting/trunk/src/java/org/apache/struts/scripting/ScriptAction.java
URL:
http://svn.apache.org/viewcvs/struts/scripting/trunk/src/java/org/apache/struts/scripting/ScriptAction.java?rev=357368&r1=357367&r2=357368&view=diff
==============================================================================
---
struts/scripting/trunk/src/java/org/apache/struts/scripting/ScriptAction.java
(original)
+++
struts/scripting/trunk/src/java/org/apache/struts/scripting/ScriptAction.java
Sat Dec 17 11:17:51 2005
@@ -1,7 +1,31 @@
+/*
+ * $Id$
+ *
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.struts.scripting;
// util imports:
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Properties;
+import java.util.StringTokenizer;
// io imports:
import java.io.File;
@@ -56,83 +80,94 @@
* <li> <code>session</code> - The session</li>
* <li> <code>application</code> - The servlet context</li>
* <li> <code>struts</code> - A grouping of all Struts-related objects</li>
+ *
* <li> <code>log</code> - A logging instance</li>
* </ul>
* You can add your own variables by creating a BSFManagerFilter and
* configuring it in struts-scripting.properties:
* <ul>
- * <li>
<code>struts-scripting.filters.FILTER_NAME.class=FILTER_CLASS</code> - The
- * class implementing BSFManagerFilter where FILTER_NAME is the name you are
- * calling the filter.</li>
- * <li>
<code>struts-scripting.filters.FILTER_NAME.PROPERTY_NAME=PROPERTY_VALUE</code>
- * - A property to be used by the filter.</li>
+ * <li> <code>struts-scripting.filters.FILTER_NAME.class=FILTER_CLASS</code>
+ * - The class implementing BSFManagerFilter where FILTER_NAME is the name
+ * you are calling the filter.</li>
+ * <li> <code>
+ * struts-scripting.filters.FILTER_NAME.PROPERTY_NAME=PROPERTY_VALUE
+ * </code> - A property to be used by the filter.</li>
* </ul>
* <br />
* <br />
* To use other scripting engines other than BeanShell, create a file called
- * <code>struts-scripting.properties</code> and add two properties for each
engine:
- *
+ * <code>struts-scripting.properties</code> and add two properties for each
+ * engine:
* <ul>
- * <li> <code>struts-scripting.engine.ENGINE_NAME.class</code> - The class
of the
- * BSF engine where ENGINE_NAME is the name you are calling the engine.</li>
- *
+ * <li> <code>struts-scripting.engine.ENGINE_NAME.class</code> - The class
of
+ * the BSF engine where ENGINE_NAME is the name you are calling the engine.
+ * </li>
* <li> <code>struts-scripting.engine.ENGINE_NAME.extensions</code> - A
* comma-delimited list of file extensions that will be used to identify the
* engine to use to execute the script.</li>
* </ul>
* This code was originally based off code from JPublish, but has since been
- * almost completely rewritten.
+ * almost completely rewritten.
*/
public class ScriptAction extends Action {
- /** The logging instance */
- protected static Log log = LogFactory.getLog(ScriptAction.class);
+ /** The logging instance. */
+ protected static final Log LOG = LogFactory.getLog(ScriptAction.class);
- /** The default path to the properties file */
- protected final static String PROPS_PATH = "/struts-scripting.properties";
+ /** The default path to the properties file. */
+ protected static final String PROPS_PATH = "/struts-scripting.properties";
- /** The base property for alternate BSF engines */
- protected final static String ENGINE_BASE = "struts-scripting.engine.";
+ /** The base property for alternate BSF engines. */
+ protected static final String ENGINE_BASE = "struts-scripting.engine.";
- /** The base property for classes that put new variables in the context */
- protected final static String FILTERS_BASE = "struts-scripting.filters.";
+ /** The base property for classes that put new variables in the context.
*/
+ protected static final String FILTERS_BASE = "struts-scripting.filters.";
- /** A list of initialized filters */
- protected static BSFManagerFilter[] filters = null;
+ /** A list of initialized filters. */
+ private static BSFManagerFilter[] filters = null;
- /** Holds the "compiled" scripts and their information */
- protected Map scripts = new Hashtable();
+ /** Holds the "compiled" scripts and their information. */
+ private Map scripts = new Hashtable();
static {
Properties props = new Properties();
try {
- InputStream in =
ScriptAction.class.getClassLoader().getResourceAsStream(PROPS_PATH);
+ InputStream in =
+ ScriptAction.class.getClassLoader()
+ .getResourceAsStream(PROPS_PATH);
if (in == null) {
- in =
ScriptAction.class.getClassLoader().getResourceAsStream("/struts-bsf.properties");
+ in =
+
ScriptAction.class.getClassLoader().getResourceAsStream(
+ "/struts-bsf.properties");
if (in != null) {
- log.warn("The struts-bsf.properties file has been
deprecated. Please use "+
- "struts-scripting.properties instead.");
+ LOG.warn("The struts-bsf.properties file has been "
+ + "deprecated. Please use "
+ + "struts-scripting.properties instead.");
} else {
- log.warn("struts-scripting.properties not found, using
default engine mappings.");
+ LOG.warn("struts-scripting.properties not found, using "
+ + "default engine mappings.");
}
}
if (in != null) {
props.load(in);
- }
+ }
} catch (Exception ex) {
- log.warn("Unable to load struts-scripting.properties, using
default engine mappings.");
+ LOG.warn("Unable to load struts-scripting.properties, using "
+ + " default engine mappings.");
}
int pos = ENGINE_BASE.length();
- for (Enumeration e = props.propertyNames(); e.hasMoreElements(); ) {
+ for (Enumeration e = props.propertyNames(); e.hasMoreElements();) {
String name = (String) e.nextElement();
if (name.startsWith(ENGINE_BASE) && name.endsWith(".class")) {
String type = name.substring(pos, name.indexOf('.', pos));
String cls = props.getProperty(name);
- String ext = props.getProperty(ENGINE_BASE + type +
".extensions", "");
+ String ext = props.getProperty(ENGINE_BASE + type
+ + ".extensions", "");
String[] exts = split(ext, ",");
- if (log.isInfoEnabled()) {
- log.info("Loading BSF engine name:" + type + " class:" +
cls + " ext:" + ext);
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Loading BSF engine name:" + type + " class:"
+ + cls + " ext:" + ext);
}
BSFManager.registerScriptingEngine(type, cls, exts);
}
@@ -142,7 +177,7 @@
/**
- * Executes the script
+ * Executes the script.
*
[EMAIL PROTECTED] mapping The action mapping
[EMAIL PROTECTED] form The action form
@@ -163,16 +198,16 @@
try {
scriptName = parseScriptName(mapping.getParameter(), bsfManager);
} catch (Exception ex) {
- log.error("Unable to parse " + mapping.getParameter(), ex);
+ LOG.error("Unable to parse " + mapping.getParameter(), ex);
throw new Exception("Unable to parse " + mapping.getParameter());
}
if (scriptName == null) {
- log.error("No script specified in the parameter attribute");
+ LOG.error("No script specified in the parameter attribute");
throw new Exception("No script specified");
}
- if (log.isDebugEnabled()) {
- log.debug("Executing script: " + scriptName);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Executing script: " + scriptName);
}
HttpSession session = request.getSession();
@@ -187,7 +222,7 @@
HttpServletResponse.class);
if (session == null) {
- log.debug("HTTP session is null");
+ LOG.debug("HTTP session is null");
} else {
bsfManager.declareBean("session", session, HttpSession.class);
}
@@ -195,8 +230,9 @@
bsfManager.declareBean("application", application,
ServletContext.class);
- bsfManager.declareBean("log", log, Log.class);
- StrutsInfo struts = new StrutsInfo(this, mapping, form,
getResources(request));
+ bsfManager.declareBean("log", LOG, Log.class);
+ StrutsInfo struts = new StrutsInfo(this, mapping, form,
+ getResources(request));
bsfManager.declareBean("struts", struts, StrutsInfo.class);
for (int x = 0; x < filters.length; x++) {
@@ -212,7 +248,7 @@
/**
- * Parses the script name and puts any url parameters in the context
+ * Parses the script name and puts any url parameters in the context.
*
[EMAIL PROTECTED] url The script url consisting of a path and
optional
* parameters
@@ -220,34 +256,37 @@
[EMAIL PROTECTED] The name of the script to execute
[EMAIL PROTECTED] Exception If something goes wrong
*/
- protected String parseScriptName(String url, BSFManager manager) throws
Exception {
- if (log.isDebugEnabled()) {
- log.debug("Parsing " + url);
+ protected String parseScriptName(String url, BSFManager manager)
+ throws Exception {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Parsing " + url);
}
String name = null;
if (url != null) {
String[] parsed = split(url, "?");
name = parsed[0];
if (parsed.length == 2) {
- if (log.isDebugEnabled()) {
- log.debug("Found a query string");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Found a query string");
}
String[] args = split(parsed[1], "&");
for (int x = 0; x < args.length; x++) {
String[] param = split(args[x], "=");
Object o = manager.lookupBean(param[0]);
if (o != null) {
- log.warn("BSF variable " + param[0] + " already
exists");
+ LOG.warn("BSF variable " + param[0]
+ + " already exists");
param[0] = "_" + param[0];
}
manager.declareBean(param[0], param[1], String.class);
- if (log.isDebugEnabled()) {
- log.debug("Registering param " + param[0] + " with
value " + param[1]);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Registering param " + param[0]
+ + " with value " + param[1]);
}
}
} else {
- if (log.isDebugEnabled()) {
- log.debug("No query string:" + parsed.length);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("No query string:" + parsed.length);
}
}
}
@@ -270,36 +309,38 @@
script = new Script();
script.file = new File(context.getRealPath(name));
try {
- script.lang =
BSFManager.getLangFromFilename(script.file.getName());
+ script.lang =
+ BSFManager.getLangFromFilename(script.file.getName());
} catch (BSFException ex) {
- log.warn(ex, ex);
+ LOG.warn(ex, ex);
}
}
boolean reloadScript = false;
long scriptLastModified = script.file.lastModified();
if (scriptLastModified > script.timeLastLoaded) {
- if (log.isDebugEnabled()) {
- log.debug("Loading updated or new script: " +
script.file.getName());
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Loading updated or new script: "
+ + script.file.getName());
}
reloadScript = true;
}
if (reloadScript || script.string == null) {
synchronized (this) {
- if (reloadScript || script.string == null) {
- script.timeLastLoaded = System.currentTimeMillis();
- FileReader reader = null;
- try {
- reader = new FileReader(script.file);
- script.string = IOUtils.getStringFromReader(reader);
- } catch (IOException ex) {
- log.error("Unable to load script: "+script.file, ex);
- } finally {
- if (reader != null) {
- try {
- reader.close();
- } catch (IOException ex) {}
+ script.timeLastLoaded = System.currentTimeMillis();
+ FileReader reader = null;
+ try {
+ reader = new FileReader(script.file);
+ script.string = IOUtils.getStringFromReader(reader);
+ } catch (IOException ex) {
+ LOG.error("Unable to load script: " + script.file, ex);
+ } finally {
+ if (reader != null) {
+ try {
+ reader.close();
+ } catch (IOException ex) {
+ LOG.debug(ex, ex);
}
}
}
@@ -311,28 +352,29 @@
/**
- * Loads and initializes the filters
+ * Loads and initializes the filters.
*
[EMAIL PROTECTED] props The properties defining the filters
[EMAIL PROTECTED] An array of the loaded filters
*/
protected static BSFManagerFilter[] loadFilters(Properties props) {
ArrayList list = new ArrayList();
- for (Enumeration e = props.propertyNames(); e.hasMoreElements(); ) {
+ for (Enumeration e = props.propertyNames(); e.hasMoreElements();) {
String prop = (String) e.nextElement();
if (prop.startsWith(FILTERS_BASE) && prop.endsWith("class")) {
- String type = prop.substring(FILTERS_BASE.length(),
prop.indexOf(".", FILTERS_BASE.length()));
+ String type = prop.substring(FILTERS_BASE.length(),
+ prop.indexOf(".", FILTERS_BASE.length()));
String claz = props.getProperty(prop);
try {
Class cls = Class.forName(claz);
BSFManagerFilter f = (BSFManagerFilter) cls.newInstance();
f.init(type, props);
list.add(f);
- if (log.isInfoEnabled()) {
- log.info("Loaded " + type + " filter: " + claz);
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Loaded " + type + " filter: " + claz);
}
} catch (Exception ex) {
- log.error("Unable to load " + type + " filter: " + claz);
+ LOG.error("Unable to load " + type + " filter: " + claz);
}
}
}
@@ -343,7 +385,7 @@
/**
- * Splits a line with the given delimiter
+ * Splits a line with the given delimiter.
*
[EMAIL PROTECTED] line The line to split
[EMAIL PROTECTED] delimiter The string to split with
@@ -355,7 +397,8 @@
}
List lst = new ArrayList();
- for (Enumeration e = new StringTokenizer(line, delimiter);
e.hasMoreElements(); ) {
+ for (Enumeration e = new StringTokenizer(line, delimiter);
+ e.hasMoreElements();) {
lst.add(e.nextElement());
}
String[] ret = new String[lst.size()];
@@ -367,7 +410,7 @@
// access Action's protected methods. Ugly? yes... any suggestions?
/**
- * Saves a token
+ * Saves a token.
*
[EMAIL PROTECTED] req The request object
*/
@@ -377,7 +420,7 @@
/**
- * Checks to see if the request is cancelled
+ * Checks to see if the request is cancelled.
*
[EMAIL PROTECTED] req The request object
[EMAIL PROTECTED] True if cancelled
@@ -388,7 +431,7 @@
/**
- * Checks to see if the token is valid
+ * Checks to see if the token is valid.
*
[EMAIL PROTECTED] req The request object
[EMAIL PROTECTED] True if valid
@@ -399,19 +442,20 @@
/**
- * Resets the token
+ * Resets the token.
*
[EMAIL PROTECTED] req The request object
*/
public void resetToken(HttpServletRequest req) {
super.resetToken(req);
}
-
-
+
+
/**
- * Gets the locale
+ * Gets the locale.
*
[EMAIL PROTECTED] req The request object
+ [EMAIL PROTECTED] The locale value
*/
public Locale getLocale(HttpServletRequest req) {
return super.getLocale(req);
@@ -419,7 +463,7 @@
/**
- * Saves the messages to the request
+ * Saves the messages to the request.
*
[EMAIL PROTECTED] req The request object
[EMAIL PROTECTED] mes The action messages
@@ -430,31 +474,31 @@
/**
- * Saves the errors to the request
+ * Saves the errors to the request.
*
- [EMAIL PROTECTED] req The request object
- [EMAIL PROTECTED] errs The action errors
- [EMAIL PROTECTED] Use saveErrors(HttpServletRequest, ActionMessages)
instead.
- * This will be removed after Struts 1.2.
+ [EMAIL PROTECTED] req The request object
+ [EMAIL PROTECTED] errs The action errors
+ [EMAIL PROTECTED] Use saveErrors(HttpServletRequest, ActionMessages)
instead.
+ * This will be removed after Struts 1.2.
*/
public void saveErrors(HttpServletRequest req, ActionErrors errs) {
super.saveErrors(req, errs);
}
- /** Represents a saved script */
+ /** Represents a saved script. */
class Script {
- /** The script file */
+ /** The script file. */
public File file;
- /** The language the script is in */
+ /** The language the script is in. */
public String lang = null;
- /** The time when the script was last used */
+ /** The time when the script was last used. */
public long timeLastLoaded = 0;
- /** The contents of the script file */
+ /** The contents of the script file. */
public String string = null;
}
}
Modified:
struts/scripting/trunk/src/java/org/apache/struts/scripting/StrutsInfo.java
URL:
http://svn.apache.org/viewcvs/struts/scripting/trunk/src/java/org/apache/struts/scripting/StrutsInfo.java?rev=357368&r1=357367&r2=357368&view=diff
==============================================================================
--- struts/scripting/trunk/src/java/org/apache/struts/scripting/StrutsInfo.java
(original)
+++ struts/scripting/trunk/src/java/org/apache/struts/scripting/StrutsInfo.java
Sat Dec 17 11:17:51 2005
@@ -1,3 +1,21 @@
+/*
+ * $Id$
+ *
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.struts.scripting;
// struts imports:
@@ -8,18 +26,30 @@
/**
- * Holds Struts objects
+ * Holds Struts objects.
*/
public class StrutsInfo {
+
+ /** Forward name. */
private String forwardName = null;
+
+ /** Forward object. */
private ActionForward forward = null;
+
+ /** ActionForm for this request. */
private ActionForm form = null;
+
+ /** ActionMapping for this request. */
private ActionMapping mapping = null;
+
+ /** ScriptAction instance for this request. */
private ScriptAction action = null;
+
+ /** The message resources for this request. */
private MessageResources res = null;
/**
- * Constructor
+ * Constructor.
*
* @param action The action instance
* @param mapping The action mapping
@@ -35,7 +65,7 @@
}
/**
- * Sets the forward name
+ * Sets the forward name.
*
* @param f The forward name
*/
@@ -59,7 +89,7 @@
}
/**
- * Sets the action forward object
+ * Sets the action forward object.
*
* @param f The action forward
*/
@@ -68,7 +98,7 @@
}
/**
- * Sets the action form
+ * Sets the action form.
*
* @param form The action form
*/
@@ -77,7 +107,7 @@
}
/**
- * Sets the action mapping
+ * Sets the action mapping.
*
* @param mapping The action mapping
*/
@@ -86,7 +116,7 @@
}
/**
- * Sets the action instance
+ * Sets the action instance.
*
* @param action The Struts action
*/
@@ -95,7 +125,7 @@
}
/**
- * Sets the message resources
+ * Sets the message resources.
*
* @param res The message resources
*/
@@ -104,7 +134,7 @@
}
/**
- * Gets the action form
+ * Gets the action form.
*
* @return The action form
*/
@@ -113,7 +143,7 @@
}
/**
- * Gets the action mapping
+ * Gets the action mapping.
*
* @return The action mapping
*/
@@ -122,7 +152,7 @@
}
/**
- * Gets the action instance
+ * Gets the action instance.
*
* @return The Struts action
*/
@@ -131,7 +161,7 @@
}
/**
- * Gets the message resources
+ * Gets the message resources.
*
* @return The message resources
*/
Modified:
struts/scripting/trunk/src/java/org/apache/struts/scripting/TestFilter.java
URL:
http://svn.apache.org/viewcvs/struts/scripting/trunk/src/java/org/apache/struts/scripting/TestFilter.java?rev=357368&r1=357367&r2=357368&view=diff
==============================================================================
--- struts/scripting/trunk/src/java/org/apache/struts/scripting/TestFilter.java
(original)
+++ struts/scripting/trunk/src/java/org/apache/struts/scripting/TestFilter.java
Sat Dec 17 11:17:51 2005
@@ -1,3 +1,21 @@
+/*
+ * $Id$
+ *
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.struts.scripting;
// util imports:
@@ -12,30 +30,31 @@
/**
- * Tests to make sure the filtering system is working
+ * Tests to make sure the filtering system is working.
*/
public class TestFilter implements BSFManagerFilter {
- private static final Log log = LogFactory.getLog(TestFilter.class);
+ /** Logging instance. */
+ private static final Log LOG = LogFactory.getLog(TestFilter.class);
/**
- * Initializes the filter
+ * Initializes the filter.
*
* @param name The name of the filter
* @param props The properties
*/
public void init(String name, Properties props) {
- log.info("Initializing TestFilter");
+ LOG.info("Initializing TestFilter");
}
/**
- * Applies the filter
+ * Applies the filter.
*
* @param mgr The bsf manager
* @return The bsf manager
*/
public BSFManager apply(BSFManager mgr) {
- log.info("Filtering in TestFilter");
+ LOG.info("Filtering in TestFilter");
return mgr;
}
}
Added: struts/scripting/trunk/src/java/org/apache/struts/scripting/package.html
URL:
http://svn.apache.org/viewcvs/struts/scripting/trunk/src/java/org/apache/struts/scripting/package.html?rev=357368&view=auto
==============================================================================
--- struts/scripting/trunk/src/java/org/apache/struts/scripting/package.html
(added)
+++ struts/scripting/trunk/src/java/org/apache/struts/scripting/package.html
Sat Dec 17 11:17:51 2005
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+ <body bgcolor="white">
+
+<p> The scripting package is the core of the Struts Scripting framework,
+ which builds on Struts Action to allow Struts Actions be written
+ with the scripting language of your choice.</p>
+</body>
+</html>
Propchange:
struts/scripting/trunk/src/java/org/apache/struts/scripting/package.html
------------------------------------------------------------------------------
svn:executable = *
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]