You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ma...@apache.org on 2005/05/15 01:54:24 UTC
svn commit: r170184 - in
/struts/core/trunk/src/share/org/apache/struts/action: ActionMessages.java
ActionRedirect.java ActionServlet.java DynaActionForm.java
DynaActionFormClass.java ExceptionHandler.java RequestProcessor.java
Author: martinc
Date: Sat May 14 16:54:24 2005
New Revision: 170184
URL: http://svn.apache.org/viewcvs?rev=170184&view=rev
Log:
Another round of Checkstyle fixes.
Modified:
struts/core/trunk/src/share/org/apache/struts/action/ActionMessages.java
struts/core/trunk/src/share/org/apache/struts/action/ActionRedirect.java
struts/core/trunk/src/share/org/apache/struts/action/ActionServlet.java
struts/core/trunk/src/share/org/apache/struts/action/DynaActionForm.java
struts/core/trunk/src/share/org/apache/struts/action/DynaActionFormClass.java
struts/core/trunk/src/share/org/apache/struts/action/ExceptionHandler.java
struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java
Modified: struts/core/trunk/src/share/org/apache/struts/action/ActionMessages.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/action/ActionMessages.java?rev=170184&r1=170183&r2=170184&view=diff
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/action/ActionMessages.java (original)
+++ struts/core/trunk/src/share/org/apache/struts/action/ActionMessages.java Sat May 14 16:54:24 2005
@@ -394,6 +394,14 @@
protected String property = null;
+ /**
+ * <p>Construct an instance of this class.</p>
+ *
+ * @param list The list of <code>ActionMessage</code>s.
+ * @param iOrder The position in the list of messages.
+ * @param property The property associated with
+ * <code>ActionMessage</code>.
+ */
public ActionMessageItem(List list, int iOrder, String property) {
this.list = list;
this.iOrder = iOrder;
@@ -401,36 +409,71 @@
}
+ /**
+ * <p>Retrieve the list of messages associated with this item.</p>
+ *
+ * @return The list of messages associated with this item.
+ */
public List getList() {
return list;
}
+ /**
+ * <p>Set the list of messages associated with this item.</p>
+ *
+ * @param list The list of messages associated with this item.
+ */
public void setList(List list) {
this.list = list;
}
+ /**
+ * <p>Retrieve the position in the message list.</p>
+ *
+ * @return The position in the message list.
+ */
public int getOrder() {
return iOrder;
}
+ /**
+ * <p>Set the position in the message list.</p>
+ *
+ * @param iOrder The position in the message list.
+ */
public void setOrder(int iOrder) {
this.iOrder = iOrder;
}
+ /**
+ * <p>Retrieve the property associated with this item.</p>
+ *
+ * @return The property associated with this item.
+ */
public String getProperty() {
return property;
}
+ /**
+ * <p>Set the property associated with this item.</p>
+ *
+ * @param property The property associated with this item.
+ */
public void setProperty(String property) {
this.property = property;
}
+ /**
+ * <p>Construct a string representation of this object.</p>
+ *
+ * @return A string representation of this object.
+ */
public String toString() {
return this.list.toString();
}
Modified: struts/core/trunk/src/share/org/apache/struts/action/ActionRedirect.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/action/ActionRedirect.java?rev=170184&r1=170183&r2=170184&view=diff
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/action/ActionRedirect.java (original)
+++ struts/core/trunk/src/share/org/apache/struts/action/ActionRedirect.java Sat May 14 16:54:24 2005
@@ -58,6 +58,14 @@
*/
public class ActionRedirect extends ActionForward {
+ // ----------------------------------------------------- Manifest constants
+
+ /**
+ * <p>Default allocation size for string buffers.</p>
+ */
+ private static final int DEFAULT_BUFFER_SIZE = 256;
+
+
// ----------------------------------------------------- Static variables
/**
@@ -204,6 +212,8 @@
/**
* <p>Get the path for this object, including any parameters
* that may have been added at runtime.</p>
+ *
+ * @return The path for this object.
*/
public String getPath() {
// get the original path and the parameter string that was formed
@@ -249,7 +259,7 @@
* mark (?).
*/
public String getParameterString() {
- StringBuffer strParam = new StringBuffer(256);
+ StringBuffer strParam = new StringBuffer(DEFAULT_BUFFER_SIZE);
// loop through all parameters
Iterator iterator = parameterValues.keySet().iterator();
@@ -297,7 +307,7 @@
* and the parameters it currently holds
*/
public String toString() {
- StringBuffer result = new StringBuffer(256);
+ StringBuffer result = new StringBuffer(DEFAULT_BUFFER_SIZE);
result.append("ActionRedirect [");
result.append("originalPath=").append(getOriginalPath()).append(";");
result.append("parameterString=")
Modified: struts/core/trunk/src/share/org/apache/struts/action/ActionServlet.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/action/ActionServlet.java?rev=170184&r1=170183&r2=170184&view=diff
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/action/ActionServlet.java (original)
+++ struts/core/trunk/src/share/org/apache/struts/action/ActionServlet.java Sat May 14 16:54:24 2005
@@ -50,7 +50,6 @@
import org.apache.commons.beanutils.converters.IntegerConverter;
import org.apache.commons.beanutils.converters.LongConverter;
import org.apache.commons.beanutils.converters.ShortConverter;
-import org.apache.commons.chain.Catalog;
import org.apache.commons.chain.CatalogFactory;
import org.apache.commons.chain.config.ConfigParser;
import org.apache.commons.digester.Digester;
@@ -241,7 +240,7 @@
* the versions of the configuration file DTDs that we know about. There
* <strong>MUST</strong> be an even number of Strings in this list!</p>
*/
- protected String registrations[] = {
+ protected String[] registrations = {
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN",
"/org/apache/struts/resources/struts-config_1_0.dtd",
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN",
@@ -289,7 +288,8 @@
getServletContext().removeAttribute(Globals.ACTION_SERVLET_KEY);
// Release our LogFactory and Log instances (if any)
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader classLoader =
+ Thread.currentThread().getContextClassLoader();
if (classLoader == null) {
classLoader = ActionServlet.class.getClassLoader();
}
@@ -297,7 +297,7 @@
LogFactory.release(classLoader);
} catch (Throwable t) {
; // Servlet container doesn't have the latest version
- ; // of commons-logging-api.jar installed
+ // of commons-logging-api.jar installed
// :FIXME: Why is this dependent on the container's version of
// commons-logging? Shouldn't this depend on the version packaged
@@ -323,6 +323,8 @@
* @exception ServletException if we cannot configure ourselves correctly
*/
public void init() throws ServletException {
+ final String configPrefix = "config/";
+ final int configPrefixLength = configPrefix.length();
// Wraps the entire initialization in a try/catch to better handle
// unexpected exceptions and errors to provide better feedback
@@ -348,10 +350,10 @@
Enumeration names = getServletConfig().getInitParameterNames();
while (names.hasMoreElements()) {
String name = (String) names.nextElement();
- if (!name.startsWith("config/")) {
+ if (!name.startsWith(configPrefix)) {
continue;
}
- String prefix = name.substring(6);
+ String prefix = name.substring(configPrefixLength);
moduleConfig = initModuleConfig
(prefix, getServletConfig().getInitParameter(name));
initModuleMessageResources(moduleConfig);
@@ -460,8 +462,8 @@
public void addServletMapping(String servletName, String urlPattern) {
if (log.isDebugEnabled()) {
- log.debug("Process servletName=" + servletName +
- ", urlPattern=" + urlPattern);
+ log.debug("Process servletName=" + servletName
+ + ", urlPattern=" + urlPattern);
}
if (servletName == null) {
return;
@@ -477,6 +479,9 @@
* <p>Return the <code>MessageResources</code> instance containing our
* internal message strings.</p>
*
+ * @return the <code>MessageResources</code> instance containing our
+ * internal message strings.
+ *
* @since Struts 1.1
*/
public MessageResources getInternal() {
@@ -519,7 +524,7 @@
getServletContext().removeAttribute(name);
- PlugIn plugIns[] =
+ PlugIn[] plugIns =
(PlugIn[]) getServletContext().getAttribute(
Globals.PLUG_INS_KEY + config.getPrefix());
@@ -565,10 +570,13 @@
* module.</p>
*
* @param request The servlet request we are processing
+ *
+ * @return The module configuration object for the currently selected
+ * module.
+ *
* @since Struts 1.1
*/
- protected ModuleConfig getModuleConfig
- (HttpServletRequest request) {
+ protected ModuleConfig getModuleConfig(HttpServletRequest request) {
ModuleConfig config = (ModuleConfig)
request.getAttribute(Globals.MODULE_KEY);
@@ -588,8 +596,12 @@
* @param config The module configuration for which to
* acquire and return a RequestProcessor.
*
+ * @return The {@link RequestProcessor} responsible for the
+ * specified module,
+ *
* @exception ServletException if we cannot instantiate a RequestProcessor
- * instance
+ * instance
+ *
* @since Struts 1.1
*/
protected synchronized RequestProcessor getRequestProcessor(
@@ -631,6 +643,9 @@
* not exist. This method will not create a RequestProcessor.</p>
*
* @param config The ModuleConfig.
+ *
+ * @return The <code>RequestProcessor</code> for the given module, or
+ * <code>null</code> if one does not exist.
*/
private RequestProcessor getProcessorForModule(ModuleConfig config) {
String key = Globals.REQUEST_PROCESSOR_KEY + config.getPrefix();
@@ -659,6 +674,8 @@
* @param paths Comma-separated list of context-relative resource path(s)
* for this modules's configuration resource(s)
*
+ * @return The new module configuration instance.
+ *
* @exception ServletException if initialization cannot be performed
* @since Struts 1.1
*/
@@ -686,8 +703,8 @@
List urls = splitAndResolvePaths(paths);
URL url = null;
- for (Iterator i = urls.iterator(); i.hasNext(); ) {
- url = (URL)i.next();
+ for (Iterator i = urls.iterator(); i.hasNext();) {
+ url = (URL) i.next();
digester.push(config);
this.parseModuleConfigFile(digester, url);
}
@@ -718,10 +735,10 @@
List paths = splitAndResolvePaths(path);
if (paths.size() > 0) {
// Get first path as was the old behavior
- URL url = (URL)paths.get(0);
+ URL url = (URL) paths.get(0);
parseModuleConfigFile(digester, url);
} else {
- throw new UnavailableException("Cannot locate path "+path);
+ throw new UnavailableException("Cannot locate path " + path);
}
} catch (UnavailableException ex) {
throw ex;
@@ -767,8 +784,11 @@
/**
* <p>Simplifies exception handling in the
- * <code>parseModuleConfigFile</code> method.<p> @param path
- * @param e
+ * <code>parseModuleConfigFile</code> method.<p>
+ *
+ * @param path The path to which the exception relates.
+ * @param e The exception to be wrapped and thrown.
+ *
* @throws UnavailableException as a wrapper around Exception
*/
private void handleConfigException(String path, Exception e)
@@ -860,8 +880,8 @@
+ "' plug ins");
}
- PlugInConfig plugInConfigs[] = config.findPlugInConfigs();
- PlugIn plugIns[] = new PlugIn[plugInConfigs.length];
+ PlugInConfig[] plugInConfigs = config.findPlugInConfigs();
+ PlugIn[] plugIns = new PlugIn[plugInConfigs.length];
getServletContext().setAttribute(
Globals.PLUG_INS_KEY + config.getPrefix(), plugIns);
@@ -880,6 +900,7 @@
"currentPlugInConfigObject",
plugInConfigs[i]);
} catch (Exception e) {
+ ;
// FIXME Whenever we fail silently, we must document a valid
// reason for doing so. Why should we fail silently if a
// property can't be set on the plugin?
@@ -1500,7 +1521,7 @@
protected void initModuleMessageResources(ModuleConfig config)
throws ServletException {
- MessageResourcesConfig mrcs[] = config.findMessageResourcesConfigs();
+ MessageResourcesConfig[] mrcs = config.findMessageResourcesConfigs();
for (int i = 0; i < mrcs.length; i++) {
if ((mrcs[i].getFactory() == null)
|| (mrcs[i].getParameter() == null)) {
@@ -1538,6 +1559,8 @@
* <code>ModuleConfig</code> object (which must be pushed on to the
* evaluation stack before parsing begins).</p>
*
+ * @return A new configured <code>Digester</code> instance.
+ *
* @exception ServletException if a Digester cannot be configured
* @since Struts 1.1
*/
@@ -1558,7 +1581,7 @@
configDigester.addRuleSet(new ConfigRuleSet());
for (int i = 0; i < registrations.length; i += 2) {
- URL url = this.getClass().getResource(registrations[i+1]);
+ URL url = this.getClass().getResource(registrations[i + 1]);
if (url != null) {
configDigester.register(registrations[i], url.toString());
}
@@ -1575,7 +1598,7 @@
* <p>Add any custom RuleSet instances to configDigester that have
* been specified in the <code>rulesets</code> init parameter.</p>
*
- * @throws ServletException
+ * @throws ServletException if an error occurs
*/
private void addRuleSets() throws ServletException {
@@ -1663,6 +1686,8 @@
* <code>chainConfig</code> init-param to configure the default
* {@link Catalog} that is registered in the {@link CatalogFactory}
* instance for this application.</p>
+ *
+ * @throws ServletException if an error occurs.
*/
protected void initChain() throws ServletException {
@@ -1677,9 +1702,9 @@
ConfigParser parser = new ConfigParser();
List urls = splitAndResolvePaths(chainConfig);
URL resource = null;
- for (Iterator i = urls.iterator(); i.hasNext(); ) {
- resource = (URL)i.next();
- log.info("Loading chain catalog from "+resource);
+ for (Iterator i = urls.iterator(); i.hasNext();) {
+ resource = (URL) i.next();
+ log.info("Loading chain catalog from " + resource);
parser.parse(resource);
}
} catch (Exception e) {
@@ -1756,7 +1781,7 @@
// Register our local copy of the DTDs that we can find
for (int i = 0; i < registrations.length; i += 2) {
- URL url = this.getClass().getResource(registrations[i+1]);
+ URL url = this.getClass().getResource(registrations[i + 1]);
if (url != null) {
digester.register(registrations[i], url.toString());
}
@@ -1803,8 +1828,8 @@
// Record a servlet context attribute (if appropriate)
if (log.isDebugEnabled()) {
- log.debug("Mapping for servlet '" + servletName + "' = '" +
- servletMapping + "'");
+ log.debug("Mapping for servlet '" + servletName + "' = '"
+ + servletMapping + "'");
}
if (servletMapping != null) {
@@ -1857,8 +1882,9 @@
if (resource == null) {
if (log.isDebugEnabled()) {
- log.debug("Unable to locate "+path+" in the servlet "
- + "context, trying classloader.");
+ log.debug("Unable to locate " + path
+ + " in the servlet context, "
+ + "trying classloader.");
}
Enumeration e = loader.getResources(path);
if (!e.hasMoreElements()) {
Modified: struts/core/trunk/src/share/org/apache/struts/action/DynaActionForm.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/action/DynaActionForm.java?rev=170184&r1=170183&r2=170184&view=diff
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/action/DynaActionForm.java (original)
+++ struts/core/trunk/src/share/org/apache/struts/action/DynaActionForm.java Sat May 14 16:54:24 2005
@@ -95,6 +95,11 @@
initialize(config);
}
+ /**
+ * <p>Initialize the specified form bean.</p>
+ *
+ * @param config The configuration for the form bean to initialize.
+ */
public void initialize(FormBeanConfig config) {
FormPropertyConfig[] props = config.findFormPropertyConfigs();
@@ -153,6 +158,9 @@
* @param name Name of the property to check
* @param key Name of the key to check
*
+ * @return <code>true</code> if the specified mapped property contains a
+ * value for the specified key value; <code>true</code> otherwise.
+ *
* @exception IllegalArgumentException if there is no property
* of the specified name
*/
@@ -177,6 +185,8 @@
*
* @param name Name of the property whose value is to be retrieved
*
+ * @return The value of a simple property with the specified name.
+ *
* @exception IllegalArgumentException if there is no property
* of the specified name
* @exception NullPointerException if the type specified for the
@@ -231,6 +241,8 @@
* @param name Name of the property whose value is to be retrieved
* @param index Index of the value to be retrieved
*
+ * @return The value of an indexed property with the specified name.
+ *
* @exception IllegalArgumentException if there is no property
* of the specified name
* @exception IllegalArgumentException if the specified property
@@ -266,6 +278,9 @@
* @param name Name of the property whose value is to be retrieved
* @param key Key of the value to be retrieved
*
+ * @return The value of a mapped property with the specified name, or
+ * <code>null</code> if there is no value for the specified key.
+ *
* @exception IllegalArgumentException if there is no property
* of the specified name
* @exception IllegalArgumentException if the specified property
@@ -292,7 +307,10 @@
* name. This is equivalent to calling
* <code>(String) dynaForm.get(name)</code>.</p>
*
- * @param name Name of the property whose value is to be retrieved
+ * @param name Name of the property whose value is to be retrieved.
+ *
+ * @return The value of a <code>String</code> property with the specified
+ * name.
*
* @throws IllegalArgumentException if there is no property
* of the specified name
@@ -313,7 +331,10 @@
* specified name. This is equivalent to calling
* <code>(String[]) dynaForm.get(name)</code>.</p>
*
- * @param name Name of the property whose value is to be retrieved
+ * @param name Name of the property whose value is to be retrieved.
+ *
+ * @return The value of a <code>String[]</code> property with the
+ * specified name.
*
* @throws IllegalArgumentException if there is no property
* of the specified name
@@ -332,6 +353,9 @@
/**
* <p>Return the <code>DynaClass</code> instance that describes the set
* of properties available for this <code>DynaBean</code>.</p>
+ *
+ * @return The <code>DynaClass</code> instance that describes the set
+ * of properties available for this <code>DynaBean</code>.
*/
public DynaClass getDynaClass() {
@@ -341,7 +365,7 @@
/**
- * <p>Returns the <code>Map</code> containing the property values. This is
+ * <p>Returns the <code>Map</code> containing the property values. This is
* done mostly to facilitate accessing the <code>DynaActionForm</code>
* through JavaBeans accessors, in order to use the JavaServer Pages
* Standard Tag Library (JSTL).</p>
@@ -356,6 +380,8 @@
* <pre>
* ${dynabean.map.prop}</pre>
* </p>
+ *
+ * @return The <code>Map</code> containing the property values.
*/
public Map getMap() {
@@ -502,6 +528,8 @@
/**
* <p>Render a String representation of this object.</p>
+ *
+ * @return A string representation of this object.
*/
public String toString() {
@@ -512,7 +540,7 @@
}
sb.append(dynaClass.getName());
- DynaProperty props[] = dynaClass.getDynaProperties();
+ DynaProperty[] props = dynaClass.getDynaProperties();
if (props == null) {
props = new DynaProperty[0];
}
@@ -592,6 +620,8 @@
*
* @param name Name of the property for which to retrieve the descriptor
*
+ * @return The property descriptor for the specified property name.
+ *
* @exception IllegalArgumentException if this is not a valid property
* name for our DynaClass
*/
@@ -613,18 +643,21 @@
*
* @param dest Destination class
* @param source Source class
+ *
+ * @return <code>true</code> if the source is assignable to the destination;
+ * <code>false</code> otherwise.
*/
protected boolean isDynaAssignable(Class dest, Class source) {
- if (dest.isAssignableFrom(source) ||
- ((dest == Boolean.TYPE) && (source == Boolean.class))
+ if (dest.isAssignableFrom(source)
+ || ((dest == Boolean.TYPE) && (source == Boolean.class))
|| ((dest == Byte.TYPE) && (source == Byte.class))
|| ((dest == Character.TYPE) && (source == Character.class))
|| ((dest == Double.TYPE) && (source == Double.class))
|| ((dest == Float.TYPE) && (source == Float.class))
|| ((dest == Integer.TYPE) && (source == Integer.class))
|| ((dest == Long.TYPE) && (source == Long.class))
- ||((dest == Short.TYPE) && (source == Short.class))) {
+ || ((dest == Short.TYPE) && (source == Short.class))) {
return (true);
} else {
return (false);
Modified: struts/core/trunk/src/share/org/apache/struts/action/DynaActionFormClass.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/action/DynaActionFormClass.java?rev=170184&r1=170183&r2=170184&view=diff
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/action/DynaActionFormClass.java (original)
+++ struts/core/trunk/src/share/org/apache/struts/action/DynaActionFormClass.java Sat May 14 16:54:24 2005
@@ -114,6 +114,8 @@
* <code>getName()</code> method of <code>java.lang.Class</code>, which
* allows the same <code>DynaClass</code> implementation class to support
* different dynamic classes, with different sets of properties.
+ *
+ * @return The name of this <code>DynaClass</code>.
*/
public String getName() {
@@ -129,6 +131,8 @@
* @param name Name of the dynamic property for which a descriptor
* is requested
*
+ * @return A property descriptor for the specified property.
+ *
* @exception IllegalArgumentException if no property name is specified
*/
public DynaProperty getDynaProperty(String name) {
@@ -146,6 +150,8 @@
* <p>Return an array of <code>DynaProperty</code>s for the properties
* currently defined in this <code>DynaClass</code>. If no properties are
* defined, a zero-length array will be returned.</p>
+ *
+ * @return An array of property instances for this class.
*/
public DynaProperty[] getDynaProperties() {
@@ -164,6 +170,8 @@
* initialized to the default values specified in the form bean
* configuration information.</p>
*
+ * @return A new {@link DynaActionForm} instance.
+ *
* @exception IllegalAccessException if the Class or the appropriate
* constructor is not accessible
* @exception InstantiationException if this Class represents an abstract
@@ -190,6 +198,8 @@
/**
* <p>Render a <code>String</code> representation of this object.</p>
+ *
+ * @return The string representation of this instance.
*/
public String toString() {
@@ -226,9 +236,13 @@
/**
* Return the <code>DynaActionFormClass</code> instance for the specified
* form bean configuration instance.
+ *
+ * @param config The config for which the class should be created.
+ *
+ * @return The instance for the specified form bean config.
*/
- public static DynaActionFormClass
- createDynaActionFormClass(FormBeanConfig config) {
+ public static DynaActionFormClass createDynaActionFormClass(
+ FormBeanConfig config) {
return config.getDynaActionFormClass();
@@ -243,6 +257,8 @@
* instances, re-introspecting our {@link FormBeanConfig} if necessary
* (that is, after being deserialized, since <code>beanClass</code> is
* marked transient).</p>
+ *
+ * @return The implementation class used to construct new instances.
*/
protected Class getBeanClass() {
Modified: struts/core/trunk/src/share/org/apache/struts/action/ExceptionHandler.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/action/ExceptionHandler.java?rev=170184&r1=170183&r2=170184&view=diff
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/action/ExceptionHandler.java (original)
+++ struts/core/trunk/src/share/org/apache/struts/action/ExceptionHandler.java Sat May 14 16:54:24 2005
@@ -65,6 +65,9 @@
* @param request The servlet request we are processing
* @param response The servlet response we are creating
*
+ * @return The <code>ActionForward</code> instance (if any) returned by
+ * the called <code>ExceptionHandler</code>.
+ *
* @exception ServletException if a servlet exception occurs
*
* @since Struts 1.1
Modified: struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java?rev=170184&r1=170183&r2=170184&view=diff
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java (original)
+++ struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java Sat May 14 16:54:24 2005
@@ -242,6 +242,9 @@
* @param response The servlet response we are creating
* @param mapping The mapping we are using
*
+ * @return An <code>Action</code> instance that will be used to process
+ * the current request.
+ *
* @exception IOException if an input/output error occurs
*/
protected Action processActionCreate(HttpServletRequest request,
@@ -308,6 +311,8 @@
* <code>ActionForm</code> associated with this mapping, return
* <code>null</code>.</p>
*
+ * @return The <code>ActionForm</code> associated with this mapping.
+ *
* @param request The servlet request we are processing
* @param response The servlet response we are creating
* @param mapping The mapping we are using
@@ -407,6 +412,9 @@
* @param form The ActionForm instance to pass to this Action
* @param mapping The ActionMapping instance to pass to this Action
*
+ * @return The <code>ActionForward</code> instance (if any) returned by the
+ * called <code>Action</code>.
+ *
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet exception occurs
*/
@@ -504,6 +512,9 @@
* @param form The ActionForm we are processing
* @param mapping The ActionMapping we are using
*
+ * @return The <code>ActionForward</code> instance (if any) returned by the
+ * called <code>ExceptionHandler</code>.
+ *
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet exception occurs
*/
@@ -549,6 +560,9 @@
* @param request The servlet request we are processing
* @param response The servlet response we are creating
* @param mapping The ActionMapping we are using
+ *
+ * @return <code>true</code> to continue normal processing;
+ * <code>false</code> if a response has been created.
*/
protected boolean processForward(HttpServletRequest request,
HttpServletResponse response,
@@ -575,6 +589,12 @@
* @param request The servlet request we are processing
* @param response The servlet response we are creating
* @param mapping The ActionMapping we are using
+ *
+ * @return <code>true</code> to continue normal processing;
+ * <code>false</code> if a response has been created.
+ *
+ * @throws IOException if an input/output error occurs
+ * @throws ServletException if thrown by invoked methods
*/
protected boolean processInclude(HttpServletRequest request,
HttpServletResponse response,
@@ -636,6 +656,8 @@
* @param response The servlet response we are creating
* @param path The portion of the request URI for selecting a mapping
*
+ * @return The mapping used to process the selection path for this request.
+ *
* @exception IOException if an input/output error occurs
*/
protected ActionMapping processMapping(HttpServletRequest request,
@@ -677,6 +699,9 @@
* Otherwise, return the request unchanged.</p>
*
* @param request The HttpServletRequest we are processing
+ *
+ * @return A wrapped request, if the request is multipart; otherwise the
+ * original request.
*/
protected HttpServletRequest processMultipart(HttpServletRequest request) {
@@ -685,8 +710,8 @@
}
String contentType = request.getContentType();
- if ((contentType != null) &&
- contentType.startsWith("multipart/form-data")) {
+ if ((contentType != null)
+ && contentType.startsWith("multipart/form-data")) {
return (new MultipartRequestWrapper(request));
} else {
return (request);
@@ -725,6 +750,8 @@
* @param request The servlet request we are processing
* @param response The servlet response we are creating
*
+ * @return The path that will be used to select an action mapping.
+ *
* @exception IOException if an input/output error occurs
*/
protected String processPath(HttpServletRequest request,
@@ -827,6 +854,9 @@
*
* @param request The servlet request we are processing
* @param response The servlet response we are creating
+ *
+ * @return <code>true</code> to continue normal processing;
+ * <code>false</code> if a response has been created.
*/
protected boolean processPreprocess(HttpServletRequest request,
HttpServletResponse response) {
@@ -846,6 +876,9 @@
* @param response The servlet response we are creating
* @param mapping The mapping we are using
*
+ * @return <code>true</code> to continue normal processing;
+ * <code>false</code> if a response has been created.
+ *
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet exception occurs
*/
@@ -855,7 +888,7 @@
throws IOException, ServletException {
// Is this action protected by role requirements?
- String roles[] = mapping.getRoleNames();
+ String[] roles = mapping.getRoleNames();
if ((roles == null) || (roles.length < 1)) {
return (true);
}
@@ -900,6 +933,9 @@
* @param form The ActionForm instance we are populating
* @param mapping The ActionMapping we are using
*
+ * @return <code>true</code> to continue normal processing;
+ * <code>false</code> if a response has been created.
+ *
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet exception occurs
*/
@@ -965,7 +1001,7 @@
if (moduleConfig.getControllerConfig().getInputForward()) {
ForwardConfig forward = mapping.findForward(input);
- processForwardConfig( request, response, forward);
+ processForwardConfig(request, response, forward);
} else {
internalModuleRelativeForward(input, request, response);
}
@@ -1007,11 +1043,11 @@
/**
- * <p>Do a module relative include to specified URI using request dispatcher.
- * URI is relative to the current module. The real URI is compute by prefixing
- * the module name.</p>
- * <p>This method is used internally and is not part of the public API. It is
- * advised to not use it in subclasses.</p>
+ * <p>Do a module relative include to specified URI using request
+ * dispatcher. URI is relative to the current module. The real URI is
+ * compute by prefixing the module name.</p>
+ * <p>This method is used internally and is not part of the public API. It
+ * is advised to not use it in subclasses.</p>
*
* @param uri Module-relative URI to include
* @param request Current page request
@@ -1105,6 +1141,9 @@
/**
* <p>Return the <code>MessageResources</code> instance containing our
* internal message strings.</p>
+ *
+ * @return The <code>MessageResources</code> instance containing our
+ * internal message strings.
*/
protected MessageResources getInternal() {
@@ -1115,7 +1154,9 @@
/**
* <p>Return the <code>ServletContext</code> for the web application in
- * which we are running.
+ * which we are running.</p>
+ *
+ * @return The <code>ServletContext</code> for the web application.
*/
protected ServletContext getServletContext() {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org