You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hr...@apache.org on 2005/11/12 19:02:10 UTC
svn commit: r332804 - in
/struts/core/trunk/src/java/org/apache/struts/chain: ./ commands/
commands/generic/ commands/servlet/ commands/util/ contexts/
Author: hrabago
Date: Sat Nov 12 10:01:44 2005
New Revision: 332804
URL: http://svn.apache.org/viewcvs?rev=332804&view=rev
Log:
Formatting changes and isTraceEnabled()/isDebugEnabled() checks.
Otherwise, no functional changes made.
Modified:
struts/core/trunk/src/java/org/apache/struts/chain/ComposableRequestProcessor.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractAuthorizeAction.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractCreateAction.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractExceptionHandler.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSelectLocale.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSelectModule.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSetContentType.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSetOriginalURI.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/ActionCommandBase.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/CreateActionForm.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/ExceptionCatcher.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/ExecuteCommand.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/ExecuteForwardCommand.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/generic/WrappingLookupCommand.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/AuthorizeAction.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/CreateAction.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformForward.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/SetOriginalURI.java
struts/core/trunk/src/java/org/apache/struts/chain/commands/util/ClassUtils.java
struts/core/trunk/src/java/org/apache/struts/chain/contexts/ActionContextBase.java
struts/core/trunk/src/java/org/apache/struts/chain/contexts/WebActionContext.java
Modified: struts/core/trunk/src/java/org/apache/struts/chain/ComposableRequestProcessor.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/ComposableRequestProcessor.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/ComposableRequestProcessor.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/ComposableRequestProcessor.java Sat Nov 12 10:01:44 2005
@@ -68,7 +68,10 @@
// ------------------------------------------------------ Instance Variables
- private static final Class[] SERVLET_ACTION_CONTEXT_CTOR_SIGNATURE = new Class[] { ServletContext.class, HttpServletRequest.class, HttpServletResponse.class };
+ private static final Class[] SERVLET_ACTION_CONTEXT_CTOR_SIGNATURE =
+ new Class[] { ServletContext.class,
+ HttpServletRequest.class,
+ HttpServletResponse.class };
public static final String ACTION_CONTEXT_CLASS = "ACTION_CONTEXT_CLASS";
@@ -157,16 +160,22 @@
commandName + "'");
}
- this.setActionContextClassName( controllerConfig.getProperty(ACTION_CONTEXT_CLASS) );
+ this.setActionContextClassName(
+ controllerConfig.getProperty(ACTION_CONTEXT_CLASS) );
}
- private void setActionContextClass(Class actionContextClass) throws ServletException {
+ private void setActionContextClass(Class actionContextClass)
+ throws ServletException {
this.actionContextClass = actionContextClass;
- // if there is a custom class provided and if it uses our "preferred" constructor,
- // cache a reference to that constructor rather than looking it up every time.
+ // if there is a custom class provided and if it uses our "preferred"
+ // constructor, cache a reference to that constructor rather than
+ // looking it up every time.
if (actionContextClass != null) {
- this.servletActionContextConstructor = ConstructorUtils.getAccessibleConstructor(actionContextClass, SERVLET_ACTION_CONTEXT_CTOR_SIGNATURE);
+ this.servletActionContextConstructor =
+ ConstructorUtils.getAccessibleConstructor(
+ actionContextClass,
+ SERVLET_ACTION_CONTEXT_CTOR_SIGNATURE);
} else {
this.servletActionContextConstructor = null;
}
@@ -174,39 +183,55 @@
}
/**
- * Make sure that the specified <code>className</code> identfies a class which can be found
- * and which implements the <code>ActionContext</code> interface.
+ * <p>Make sure that the specified <code>className</code> identfies a class
+ * which can be found and which implements the <code>ActionContext</code>
+ * interface.</p>
+ *
* @param className
* @throws ServletException
*/
- private void setActionContextClassName(String className) throws ServletException {
+ private void setActionContextClassName(String className)
+ throws ServletException {
if (className != null && className.trim().length() > 0) {
- log.debug("setActionContextClassName: requested context class: " + className);
+ if (log.isDebugEnabled()) {
+ log.debug("setActionContextClassName: requested context class: "
+ + className);
+ }
try {
- Class actionContextClass = RequestUtils.applicationClass(className);
+ Class actionContextClass =
+ RequestUtils.applicationClass(className);
if (!ActionContext.class.isAssignableFrom(actionContextClass)) {
- throw new UnavailableException("ActionContextClass [" + className + "] must implement ActionContext interface.");
+ throw new UnavailableException("ActionContextClass "
+ + "[" + className + "]"
+ + " must implement ActionContext interface.");
}
this.setActionContextClass(actionContextClass);
} catch (ClassNotFoundException e) {
- throw new UnavailableException("ActionContextClass " + className + " not found.");
+ throw new UnavailableException("ActionContextClass "
+ + className + " not found.");
}
} else {
- log.debug("setActionContextClassName: no actionContextClass specified");
+ if (log.isDebugEnabled()) {
+ log.debug("setActionContextClassName: no className specified");
+ }
this.setActionContextClass(null);
}
}
/**
- * <p>Establish the <code>CatalogFactory</code> which will be used to look up
- * the catalog which has the request processing command.</p>
- * <p>The base implementation simply calls <code>CatalogFactory.getInstance()</code>,
- * unless the <code>catalogFactory</code> property of this object has already been set,
- * in which case it is not changed.</p>
+ * <p>Establish the <code>CatalogFactory</code> which will be used to look
+ * up the catalog which has the request processing command.</p>
+ *
+ * <p>The base implementation simply calls
+ * <code>CatalogFactory.getInstance()</code>, unless the
+ * <code>catalogFactory</code> property of this object has already been
+ * set, in which case it is not changed.</p>
+ *
* @param servlet
* @param moduleConfig
*/
- protected void initCatalogFactory(ActionServlet servlet, ModuleConfig moduleConfig) {
+ protected void initCatalogFactory(ActionServlet servlet,
+ ModuleConfig moduleConfig) {
if (this.catalogFactory != null) {
return;
}
@@ -251,49 +276,77 @@
}
/**
- * Provide the initialized <code>ActionContext</code> instance which will be used by this request.
- * Internally, this simply calls <code>createActionContextInstance</code> followed by
- * <code>initializeActionContext</code>.
+ * <p>Provide the initialized <code>ActionContext</code> instance which
+ * will be used by this request. Internally, this simply calls
+ * <code>createActionContextInstance</code> followed by
+ * <code>initializeActionContext</code>.</p>
+ *
* @param request
* @param response
* @return
* @throws ServletException
*/
protected ActionContext contextInstance(HttpServletRequest request,
- HttpServletResponse response) throws ServletException {
- ActionContext context = createActionContextInstance(getServletContext(), request, response);
+ HttpServletResponse response)
+ throws ServletException {
+
+ ActionContext context = createActionContextInstance(
+ getServletContext(), request, response);
initializeActionContext(context);
return context;
}
/**
- * Create a new instance of <code>ActionContext</code> according to configuration. If no alternative was specified at initialization,
- * a new instance <code>ServletActionContext</code> is returned. If an alternative was specified using the
- * <code>ACTION_CONTEXT_CLASS</code> property, then that value is treated as a classname, and an instance of that class
- * is created. If that class implements the same constructor that <code>ServletActionContext</code> does, then that constructor
- * will be used: <code>ServletContext, HttpServletRequest, HttpServletResponse</code>; otherwise, it is assumed that the class
- * has a no-arguments constructor. If these constraints do not suit you, simply override this method in a subclass.
+ * <p>Create a new instance of <code>ActionContext</code> according to
+ * configuration. If no alternative was specified at initialization,
+ * a new instance <code>ServletActionContext</code> is returned. If
+ * an alternative was specified using the <code>ACTION_CONTEXT_CLASS</code>
+ * property, then that value is treated as a classname, and an instance of
+ * that class is created. If that class implements the same constructor
+ * that <code>ServletActionContext</code> does, then that constructor
+ * will be used: <code>ServletContext, HttpServletRequest,
+ * HttpServletResponse</code>; otherwise, it is assumed that the class
+ * has a no-arguments constructor. If these constraints do not suit you,
+ * simply override this method in a subclass.</p>
+ *
* @param servletContext
* @param request
* @param response
* @return
* @throws ServletException
*/
- protected ActionContext createActionContextInstance(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response) throws ServletException {
- if (this.actionContextClass == null) return new ServletActionContext(servletContext, request, response);
+ protected ActionContext createActionContextInstance(
+ ServletContext servletContext,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException {
+
+ if (this.actionContextClass == null) {
+ return new ServletActionContext(servletContext, request, response);
+ }
+
try {
- if (this.servletActionContextConstructor == null) return (ActionContext) this.actionContextClass.newInstance();
- return (ActionContext) this.servletActionContextConstructor.newInstance(new Object[] { servletContext, request, response });
+ if (this.servletActionContextConstructor == null) {
+ return (ActionContext) this.actionContextClass.newInstance();
+ }
+ return (ActionContext) this.servletActionContextConstructor
+ .newInstance(
+ new Object[]{ servletContext, request, response });
} catch (Exception e) {
- throw new ServletException("Error creating ActionContext instance of type " + this.actionContextClass, e);
+ throw new ServletException(
+ "Error creating ActionContext instance of type "
+ + this.actionContextClass, e);
}
}
/**
- * Set common properties on the given <code>ActionContext</code> instance so that commands in the chain
- * can count on their presence. Note that while this method does not require that its argument
- * be an instance of <code>ServletActionContext</code>, at this time many common Struts
- * commands will be expecting to receive an <code>ActionContext</code> which is also a <code>ServletActionContext</code>.
+ * <p>Set common properties on the given <code>ActionContext</code> instance
+ * so that commands in the chain can count on their presence. Note that
+ * while this method does not require that its argument be an instance of
+ * <code>ServletActionContext</code>, at this time many common Struts
+ * commands will be expecting to receive an <code>ActionContext</code>
+ * which is also a <code>ServletActionContext</code>.</p>
+ *
* @param context
*/
protected void initializeActionContext(ActionContext context) {
@@ -303,6 +356,7 @@
context.setModuleConfig(this.moduleConfig);
}
+
/**
* If this is a multipart request, wrap it with a special wrapper.
* Otherwise, return the request unchanged.
@@ -326,9 +380,10 @@
}
/**
- * <p>Set the <code>CatalogFactory</code> instance which should be used to find
- * the request-processing command. In the base implementation, if this value is not
- * already set, then it will be initialized when {@link initCatalogFactory} is called.
+ * <p>Set the <code>CatalogFactory</code> instance which should be used to
+ * find the request-processing command. In the base implementation, if
+ * this value is not already set, then it will be initialized when
+ * {@link #initCatalogFactory} is called.
* </p>
* @param catalogFactory
*/
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractAuthorizeAction.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractAuthorizeAction.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractAuthorizeAction.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractAuthorizeAction.java Sat Nov 12 10:01:44 2005
@@ -64,7 +64,8 @@
boolean throwEx = false;
try {
- throwEx = !(isAuthorized(actionCtx, actionConfig.getRoleNames(), actionConfig));
+ throwEx = !(isAuthorized(actionCtx, actionConfig.getRoleNames(),
+ actionConfig));
}
catch (Exception ex) {
throwEx = true;
@@ -74,7 +75,8 @@
if (throwEx) {
// The current user is not authorized for this action
- throw new UnauthorizedActionException(getErrorMessage(actionCtx, actionConfig));
+ throw new UnauthorizedActionException(
+ getErrorMessage(actionCtx, actionConfig));
} else {
return (false);
}
@@ -82,9 +84,9 @@
}
/**
- * <p>Must authorization rules be consulted? The base implementation returns
- * <code>true</code> if the given <code>ActionConfig</code> has one or more
- * roles defined.</p>
+ * <p>Must authorization rules be consulted? The base implementation
+ * returns <code>true</code> if the given <code>ActionConfig</code> has
+ * one or more roles defined.</p>
*
* @param actionConfig the current ActionConfig object
* @return true if the <code>isAuthorized</code> method should be consulted.
@@ -109,11 +111,13 @@
* <code>false</code>
* @exception Exception If the action cannot be tested for authorization
*/
- protected abstract boolean isAuthorized(ActionContext context, String[] roles,
+ protected abstract boolean isAuthorized(ActionContext context,
+ String[] roles,
ActionConfig actionConfig)
throws Exception;
- protected abstract String getErrorMessage(ActionContext context, ActionConfig actionConfig);
+ protected abstract String getErrorMessage(ActionContext context,
+ ActionConfig actionConfig);
}
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractCreateAction.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractCreateAction.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractCreateAction.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractCreateAction.java Sat Nov 12 10:01:44 2005
@@ -35,7 +35,8 @@
// ------------------------------------------------------ Instance Variables
- private static final Log log = LogFactory.getLog(AbstractCreateAction.class);
+ private static final Log log =
+ LogFactory.getLog(AbstractCreateAction.class);
// ---------------------------------------------------------- Public Methods
@@ -74,7 +75,9 @@
// Create (if necessary) and cache an Action instance
Action action = getAction(actionCtx, type, actionConfig);
- log.trace("setting action to " + action);
+ if (log.isTraceEnabled()) {
+ log.trace("setting action to " + action);
+ }
actionCtx.setAction(action);
return (false);
@@ -86,17 +89,22 @@
/**
- * Create and return the appropriate <code>Action</code> class for the given <code>type</code>
- * and <code>actionConfig</code>.
+ * Create and return the appropriate <code>Action</code> class for the
+ * given <code>type</code> and <code>actionConfig</code>.
* @param context
* @param type
* @param actionConfig
* @return
- * @throws Exception if there are any problems instantiating the Action class.
- * @todo The dependence on ActionServlet suggests that this should be broken up
- * along the lines of the other Abstract/concrete pairs in the org.apache.struts.chain.commands package.
+ * @throws Exception if there are any problems instantiating the Action
+ * class.
+ * @todo The dependence on ActionServlet suggests that this should be
+ * broken up along the lines of the other Abstract/concrete pairs in the
+ * org.apache.struts.chain.commands package.
*/
- protected abstract Action getAction(ActionContext context, String type, ActionConfig actionConfig) throws Exception;
+ protected abstract Action getAction(ActionContext context,
+ String type,
+ ActionConfig actionConfig)
+ throws Exception;
}
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractExceptionHandler.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractExceptionHandler.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractExceptionHandler.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractExceptionHandler.java Sat Nov 12 10:01:44 2005
@@ -75,11 +75,19 @@
if (actionConfig != null) {
- log.debug("See if actionConfig " + actionConfig + " has an exceptionConfig for " + exception.getClass().getName());
+ if (log.isDebugEnabled()) {
+ log.debug("See if actionConfig " + actionConfig
+ + " has an exceptionConfig for "
+ + exception.getClass().getName());
+ }
exceptionConfig =
actionConfig.findException(exception.getClass());
} else if (moduleConfig != null) {
- log.debug("No action yet, see if moduleConfig " + moduleConfig + " has an exceptionConfig " + exception.getClass().getName());
+ if (log.isDebugEnabled()) {
+ log.debug("No action yet, see if moduleConfig " + moduleConfig
+ + " has an exceptionConfig "
+ + exception.getClass().getName());
+ }
exceptionConfig = moduleConfig.findException(exception.getClass());
}
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java Sat Nov 12 10:01:44 2005
@@ -98,10 +98,11 @@
/**
- * For a given request parameter name, trim off any prefix and/or suffix which
- * are defined in <code>actionConfig</code> and return what remains. If
- * either prefix or suffix is defined, then return null for <code>name</code>
- * values which do not begin or end accordingly.
+ * <p>For a given request parameter name, trim off any prefix and/or suffix
+ * which are defined in <code>actionConfig</code> and return what remains.
+ * If either prefix or suffix is defined, then return null for
+ * <code>name</code> values which do not begin or end accordingly.</p>
+ *
* @param actionConfig
* @param name
* @return
@@ -121,7 +122,8 @@
if (!stripped.endsWith(suffix)) {
return null;
}
- stripped = stripped.substring(0, stripped.length() - suffix.length());
+ stripped =
+ stripped.substring(0, stripped.length() - suffix.length());
}
return stripped;
@@ -129,7 +131,9 @@
}
/**
- * Take into account whether the request includes any defined value for the global "cancel" parameter.
+ * <p>Take into account whether the request includes
+ * any defined value for the global "cancel" parameter.</p>
+ *
* @param context
* @param actionConfig
* @param actionForm
@@ -137,13 +141,17 @@
* @see Globals.CANCEL_PROPERTY
* @see Globals.CANCEL_PROPERTY_X
*/
- protected void handleCancel(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) throws Exception {
+ protected void handleCancel(ActionContext context,
+ ActionConfig actionConfig,
+ ActionForm actionForm)
+ throws Exception {
Map paramValues = context.getParameterMap();
// Set the cancellation attribute if appropriate
- /** @todo An issue was raised (but I don't think a Bugzilla ticket created) about
- * the security implications of using a well-known cancel property which skips form validation,
- * as you may not write your actions to deal with the cancellation case. */
+ /** @todo An issue was raised (but I don't think a Bugzilla ticket
+ * created) about the security implications of using a well-known
+ * cancel property which skips form validation, as you may not write
+ * your actions to deal with the cancellation case. */
if ((paramValues.get(Globals.CANCEL_PROPERTY) != null) ||
(paramValues.get(Globals.CANCEL_PROPERTY_X) != null)) {
context.setCancelled(Boolean.TRUE);
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSelectLocale.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSelectLocale.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSelectLocale.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSelectLocale.java Sat Nov 12 10:01:44 2005
@@ -33,7 +33,8 @@
public abstract class AbstractSelectLocale extends ActionCommandBase {
- private static final Log log = LogFactory.getLog(AbstractSelectLocale.class);
+ private static final Log log =
+ LogFactory.getLog(AbstractSelectLocale.class);
// ---------------------------------------------------------- Public Methods
@@ -51,13 +52,18 @@
log.trace("retrieve config...");
ModuleConfig moduleConfig = actionCtx.getModuleConfig();
if (!moduleConfig.getControllerConfig().getLocale()) {
- log.debug("module is not configured for a specific locale; nothing to do");
+ if (log.isDebugEnabled()) {
+ log.debug("module is not configured for a specific locale; "
+ + "nothing to do");
+ }
return (false);
}
// Retrieve and cache appropriate Locale for this request
Locale locale = getLocale(actionCtx);
- log.debug("set context locale to " + locale);
+ if (log.isDebugEnabled()) {
+ log.debug("set context locale to " + locale);
+ }
actionCtx.setLocale(locale);
return (false);
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSelectModule.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSelectModule.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSelectModule.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSelectModule.java Sat Nov 12 10:01:44 2005
@@ -73,7 +73,9 @@
MessageResources messageResources = (MessageResources)
actionCtx.getApplicationScope().get(key);
if (messageResources == null) {
- throw new IllegalArgumentException("No message resources found in application scope under " + key);
+ throw new IllegalArgumentException(
+ "No message resources found in application scope under "
+ + key);
}
actionCtx.setMessageResources(messageResources);
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSetContentType.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSetContentType.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSetContentType.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSetContentType.java Sat Nov 12 10:01:44 2005
@@ -47,7 +47,9 @@
ModuleConfig moduleConfig = actionCtx.getModuleConfig();
// If the content type is configured, set it for the response
- String contentType = moduleConfig.getControllerConfig().getContentType();
+ String contentType =
+ moduleConfig.getControllerConfig().getContentType();
+
if (contentType != null) {
setContentType(actionCtx, contentType);
}
@@ -65,7 +67,8 @@
* @param context The <code>Context</code> for this request
* @param contentType The content type for the response
*/
- protected abstract void setContentType(ActionContext context, String contentType);
+ protected abstract void setContentType(ActionContext context,
+ String contentType);
}
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSetOriginalURI.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSetOriginalURI.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSetOriginalURI.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/AbstractSetOriginalURI.java Sat Nov 12 10:01:44 2005
@@ -44,10 +44,14 @@
* @return <code>false</code> so that processing continues
*/
public boolean execute(ActionContext actionCtx) throws Exception {
+
// Set the original uri if not already set
- if (!actionCtx.getRequestScope().containsKey(Globals.ORIGINAL_URI_KEY)) {
+ if (!actionCtx.getRequestScope()
+ .containsKey(Globals.ORIGINAL_URI_KEY)) {
+
setOriginalURI(actionCtx);
- }
+ }
+
return (false);
}
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/ActionCommandBase.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/ActionCommandBase.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/ActionCommandBase.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/ActionCommandBase.java Sat Nov 12 10:01:44 2005
@@ -22,12 +22,14 @@
import org.apache.struts.chain.contexts.ActionContext;
/**
- * <p>Simple abstract class which avoids frequent casting to <code>ActionContext</code>
- * in commands explicitly intended for use with that class.</code>.</p>
+ * <p>Simple abstract class which avoids frequent casting to
+ * <code>ActionContext</code> in commands explicitly intended
+ * for use with that class.</code>.</p>
*/
public abstract class ActionCommandBase implements ActionCommand {
- public abstract boolean execute(ActionContext actionContext) throws Exception;
+ public abstract boolean execute(ActionContext actionContext)
+ throws Exception;
/**
* <p>Simply cast the <code>Context</code> to <code>ActionContext</code>
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/CreateActionForm.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/CreateActionForm.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/CreateActionForm.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/CreateActionForm.java Sat Nov 12 10:01:44 2005
@@ -62,7 +62,9 @@
return (false);
}
- log.trace("Look up form-bean " + name);
+ if (log.isTraceEnabled()) {
+ log.trace("Look up form-bean " + name);
+ }
// Look up the corresponding FormBeanConfig (if any)
FormBeanConfig formBeanConfig =
@@ -85,7 +87,8 @@
instance = formBeanConfig.createActionForm(actionCtx);
}
- // TODO Remove this when ActionForm no longer directly depends on ActionServlet
+ // TODO Remove this when ActionForm no longer directly depends on
+ // ActionServlet
if (actionCtx instanceof ServletActionContext) {
// The servlet property of ActionForm is transient, so
// ActionForms which are restored from a serialized state
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/ExceptionCatcher.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/ExceptionCatcher.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/ExceptionCatcher.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/ExceptionCatcher.java Sat Nov 12 10:01:44 2005
@@ -24,7 +24,6 @@
import org.apache.commons.chain.Filter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.struts.chain.Constants;
import org.apache.struts.chain.contexts.ActionContext;
@@ -45,7 +44,6 @@
private String catalogName = null;
private String exceptionCommand = null;
- private String exceptionKey = Constants.EXCEPTION_KEY;
private static final Log log = LogFactory.getLog(ExceptionCatcher.class);
@@ -168,7 +166,8 @@
}
- protected Command lookupExceptionCommand() throws IllegalArgumentException, IllegalStateException {
+ protected Command lookupExceptionCommand()
+ throws IllegalArgumentException, IllegalStateException {
String catalogName = getCatalogName();
Catalog catalog = null;
if (catalogName == null) {
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/ExecuteCommand.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/ExecuteCommand.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/ExecuteCommand.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/ExecuteCommand.java Sat Nov 12 10:01:44 2005
@@ -24,14 +24,17 @@
import org.apache.struts.config.ActionConfig;
/**
- * <p>Invoke the appropriate <code>Command</code> for this request. If the context's
- * <code>ActionConfig</code> has no <code>command</code> property defined, no action
- * will be taken. If the specified command cannot be found, a warning will be logged,
- * but processing will continue. Depending on how the chain is configured, this can
- * be used in place of an <code>Action</code> or as a method of performing pre-processing.
- * </p>
- * <p>If used instead of an action, the command which is looked up should put an ActionForward
- * into the context, unless it has already dealt with the response.</p>
+ * <p>Invoke the appropriate <code>Command</code> for this request. If the
+ * context's <code>ActionConfig</code> has no <code>command</code> property
+ * defined, no action will be taken. If the specified command cannot be
+ * found, a warning will be logged, but processing will continue. Depending
+ * on how the chain is configured, this can be used in place of an
+ * <code>Action</code> or as a method of performing pre-processing. </p>
+ *
+ * <p>If used instead of an action, the command which is looked up should
+ * put an ActionForward into the context, unless it has already dealt with
+ * the response.</p>
+ *
* @version $Id$
*/
public class ExecuteCommand extends ActionCommandBase {
@@ -47,12 +50,13 @@
/**
- * <p>If the <code>context</code> is "valid", lookup a command and execute it.</p>
+ * <p>If the <code>context</code> is "valid", lookup a command and
+ * execute it.</p>
*
* @param actionCtx The <code>Context</code> for the current request
*
- * @return the result of the lookup command's <code>execute</code> method, if executed,
- * or <code>false</code> if it was not executed.
+ * @return the result of the lookup command's <code>execute</code> method,
+ * if executed, or <code>false</code> if it was not executed.
*/
public boolean execute(ActionContext actionCtx) throws Exception {
if (shouldProcess(actionCtx)) {
@@ -70,8 +74,9 @@
}
/**
- * Evaluate the current context to see if a command should even be
- * executed.
+ * <p>Evaluate the current context to see if a command should even be
+ * executed.</p>
+ *
* @param context
* @return
*/
@@ -83,8 +88,10 @@
}
/**
- * Find the <code>ActionConfig</code> in the current context and, if it is
- * properly configured, lookup the appropriate <code>commons-chain</code> command.
+ * <p>Find the <code>ActionConfig</code> in the current context and,
+ * if it is properly configured, lookup the appropriate
+ * <code>commons-chain</code> command.</p>
+ *
* @param context
* @return a <code>Command</code> to execute, or null if none is specified
* or if the specified command cannot be found.
@@ -116,13 +123,13 @@
return null;
}
- Command command = null;
Catalog catalog = null;
if (catalogName != null) {
catalog = CatalogFactory.getInstance().getCatalog(catalogName);
if (catalog == null) {
- log.warn("When looking up " + commandName + ", no catalog found under " + catalogName);
+ log.warn("When looking up " + commandName + ","
+ + " no catalog found under " + catalogName);
return null;
}
@@ -130,12 +137,16 @@
catalogName = "the default catalog";
catalog = CatalogFactory.getInstance().getCatalog();
if (catalog == null) {
- log.warn("When looking up " + commandName + ", no default catalog found.");
+ log.warn("When looking up " + commandName + ","
+ + " no default catalog found.");
return null;
}
}
- log.debug("looking up command " + commandName + " in " + catalogName);
+ if (log.isDebugEnabled()) {
+ log.debug("looking up command " + commandName
+ + " in " + catalogName);
+ }
return catalog.getCommand(commandName);
}
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/ExecuteForwardCommand.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/ExecuteForwardCommand.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/ExecuteForwardCommand.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/ExecuteForwardCommand.java Sat Nov 12 10:01:44 2005
@@ -23,8 +23,8 @@
import org.apache.struts.config.ForwardConfig;
/**
- * <p>Look up and execute a commons-chain <code>Command</code> based on properties of
- * the ActionContext's <code>forwardConfig</code> property.
+ * <p>Look up and execute a commons-chain <code>Command</code> based on
+ * properties of the ActionContext's <code>forwardConfig</code> property.
* </p>
*/
public class ExecuteForwardCommand extends ExecuteCommand {
@@ -32,15 +32,16 @@
/**
* <p>Return the command specified by the <code>command</code> and
* <code>catalog</code> properties of the <code>forwardConfig</code>
- * property of the given <code>ActionContext</code>. If <code>forwardConfig</code>
- * is null, return null.</p>
+ * property of the given <code>ActionContext</code>. If
+ * <code>forwardConfig</code> is null, return null.</p>
*/
protected Command getCommand(ActionContext context) {
ForwardConfig forwardConfig = context.getForwardConfig();
- if (forwardConfig == null) {
- return null;
+ if (forwardConfig == null) {
+ return null;
}
- return getCommand(forwardConfig.getCommand(), forwardConfig.getCatalog());
+ return getCommand(forwardConfig.getCommand(),
+ forwardConfig.getCatalog());
}
/**
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java Sat Nov 12 10:01:44 2005
@@ -36,12 +36,11 @@
// ------------------------------------------------------ Instance Variables
/**
- * <p>The name of a form bean as configured in a <code>struts-config.xml</code> file
- * for this module. </p>
-
- * <p>
- * Either <code>actionPath</code> or both this and <code>scope</code> are required
- * configuration properties.</p>
+ * <p>The name of a form bean as configured in a
+ * <code>struts-config.xml</code> file for this module. </p>
+ *
+ * <p> Either <code>actionPath</code> or both this and <code>scope</code>
+ * are required configuration properties.</p>
*/
private String formName = null;
@@ -49,53 +48,62 @@
* <p>The name of a scope, such as "request" or "session" in which
* the form to be prepared will be placed for reference by the view and
* other parts of Struts.</p>
-
- * <p>
- * Either <code>actionPath</code> or both this and <code>formName</code> are required
- * configuration properties.</p>
+ *
+ * <p>Either <code>actionPath</code> or both this and <code>formName</code>
+ * are required configuration properties.</p>
*/
private String scope = null;
/**
- * <p>The path of an <code><action></code> mapping as configured in a <code>struts-config.xml</code> file
- * for this module. This action will be looked up, and its <code>name</code> and
- * <code>scope</code> values will be used as if those values were configured directly
- * in this instance's <code>formName</code> and <code>scope</code> properties.</p>
-
- * <p>Either <code>this</code> or both <code>scope</code> and <code>formName</code> are required
- * configuration properties.</p>
+ * <p>The path of an <code><action></code> mapping as configured in
+ * a <code>struts-config.xml</code> file for this module. This action will
+ * be looked up, and its <code>name</code> and <code>scope</code> values
+ * will be used as if those values were configured directly in this
+ * instance's <code>formName</code> and <code>scope</code> properties.</p>
+ *
+ * <p>Either <code>this</code> or both <code>scope</code> and
+ * <code>formName</code> are required configuration properties.</p>
*/
private String actionPath = null;
/**
- * The context key under which the form which was looked up will be stored. Defaults
- * to "actionForm" but may be overridden in cases where the "request" ActionForm must
- * be preserved.
+ * The context key under which the form which was looked up will be stored.
+ * Defaults to "actionForm" but may be overridden in cases where the
+ * "request" ActionForm must be preserved.
*/
private String toKey = ActionContextBase.ACTION_FORM_KEY;
+
// ------------------------------------------------------ Properties
+
public String getActionPath() {
return this.actionPath;
}
+
public void setActionPath(String actionPath) {
this.actionPath = actionPath;
}
+
public String getFormName() {
return this.formName;
}
+
public void setFormName(String formName) {
this.formName = formName;
}
+
public String getScope() {
return this.scope;
}
+
public void setScope(String scope) {
this.scope = scope;
}
+
public String getToKey() {
return this.toKey;
}
+
public void setToKey(String toKey) {
this.toKey = toKey;
}
@@ -104,41 +112,48 @@
// ------------------------------------------------------
/**
- * <p>Look up an ActionForm instance based on the configured properties of this command and
- * copy it into the <code>Context</code>. After this command successfully
- * executes, an ActionForm instance will exist in the specified scope
- * and will be available, for example for backing fields in an HTML form. It
- * will also be in the <code>ActionContext</code> available for another command
+ * <p>Look up an ActionForm instance based on the configured properties of
+ * this command and copy it into the <code>Context</code>. After this
+ * command successfully executes, an ActionForm instance will exist in
+ * the specified scope and will be available, for example for backing
+ * fields in an HTML form. It will also be in the
+ * <code>ActionContext</code> available for another command
* to do prepopulation of values or other preparation.</p>
*/
public boolean execute(ActionContext actionContext) throws Exception {
ActionForm form = findOrCreateForm(actionContext);
if (isEmpty(getToKey())) {
- throw new IllegalStateException("Property 'toKey' must be defined.");
+ throw new IllegalStateException(
+ "Property 'toKey' must be defined.");
}
actionContext.put(getToKey(), form);
return false;
}
/**
- * <p>Based on the properties of this command and the given <code>ActionContext</code>,
- * find or create an ActionForm instance for preparation.</p>
+ * <p>Based on the properties of this command and the given
+ * <code>ActionContext</code>, find or create an ActionForm instance for
+ * preparation.</p>
*
* @param context
* @return
* @throws IllegalAccessException
* @throws InstantiationException
*/
- protected ActionForm findOrCreateForm(ActionContext context) throws IllegalAccessException, InstantiationException {
+ protected ActionForm findOrCreateForm(ActionContext context)
+ throws IllegalAccessException, InstantiationException {
String effectiveFormName = null;
String effectiveScope = null;
if ( !(isEmpty(this.getActionPath())) ) {
- ActionConfig actionConfig = context.getModuleConfig().findActionConfig(this.getActionPath());
+ ActionConfig actionConfig = context.getModuleConfig()
+ .findActionConfig(this.getActionPath());
if (actionConfig == null) {
- throw new IllegalArgumentException("No ActionConfig found for path " + this.getActionPath());
+ throw new IllegalArgumentException(
+ "No ActionConfig found for path "
+ + this.getActionPath());
}
effectiveFormName = actionConfig.getName();
@@ -160,10 +175,11 @@
}
/**
- * Actually find or create an instance of ActionForm configured under
+ * <p>Actually find or create an instance of ActionForm configured under
* the form-bean-name <code>effectiveFormName</code>, looking in
- * in the <code>ActionContext's</code> scope as identified by <code>effectiveScope</code>.
- * If a form is created, it will also be stored in that scope.
+ * in the <code>ActionContext's</code> scope as identified by
+ * <code>effectiveScope</code>. If a form is created, it will also be
+ * stored in that scope.</p>
*
* <p><b>NOTE:</b> This specific method depends on the instance of
* <code>ActionContext</code> which is passed being a subclass of
@@ -179,14 +195,22 @@
* @throws InstantiationException
* @throws IllegalArgumentException
*/
- protected ActionForm findOrCreateForm(ActionContext ctx, String effectiveFormName, String effectiveScope) throws IllegalAccessException, InstantiationException, IllegalArgumentException {
+ protected ActionForm findOrCreateForm(ActionContext ctx,
+ String effectiveFormName,
+ String effectiveScope)
+ throws IllegalAccessException,
+ InstantiationException,
+ IllegalArgumentException {
+
ActionContextBase context;
try {
context = (ActionContextBase) ctx;
} catch (ClassCastException e) {
- throw new IllegalStateException("ActionContext [" + ctx + "] must be subclass of ActionContextBase");
+ throw new IllegalStateException("ActionContext [" + ctx + "]"
+ + " must be subclass of ActionContextBase");
}
- ActionForm form = context.findOrCreateActionForm(effectiveFormName, effectiveScope);
+ ActionForm form = context.findOrCreateActionForm(
+ effectiveFormName, effectiveScope);
if (form == null) {
throw new IllegalArgumentException("No form found under scope ["
+ effectiveScope
@@ -196,8 +220,10 @@
}
return form;
}
+
private boolean isEmpty(String test) {
return test == null || test.trim().length() == 0;
}
+
}
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/generic/WrappingLookupCommand.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/generic/WrappingLookupCommand.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/generic/WrappingLookupCommand.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/generic/WrappingLookupCommand.java Sat Nov 12 10:01:44 2005
@@ -50,7 +50,8 @@
private String wrapperClassName = null;
private boolean optional = false;
- private static final Log log = LogFactory.getLog(WrappingLookupCommand.class);
+ private static final Log log =
+ LogFactory.getLog(WrappingLookupCommand.class);
public String getCatalogName() {
@@ -95,12 +96,15 @@
public boolean execute(Context context)
throws Exception {
- log.trace("execute ["+this+"]");
+ if (log.isTraceEnabled()) {
+ log.trace("execute ["+this+"]");
+ }
+
Command command = getCommand(context);
if(command != null) {
return command.execute(getContext(context));
} else {
- return false;
+ return false;
}
}
@@ -108,7 +112,8 @@
Command command = getCommand(context);
if(command != null && (command instanceof Filter)) {
try {
- return ((Filter)command).postprocess(getContext(context), exception);
+ return ((Filter)command).postprocess(
+ getContext(context), exception);
}
catch (NoSuchMethodException ex) {
log.error("Error wrapping context in postprocess", ex);
@@ -136,7 +141,8 @@
catalog = catalogFactory.getCatalog(catalogName);
}
if(catalog == null) {
- throw new IllegalArgumentException("Cannot find catalog '" + catalogName + "'");
+ throw new IllegalArgumentException(
+ "Cannot find catalog '" + catalogName + "'");
}
Command command = null;
@@ -147,11 +153,18 @@
}
if(name != null) {
- log.debug("Lookup command " + name + " in catalog " + catalogName);
+ if (log.isDebugEnabled()) {
+ log.debug("Lookup command " + name
+ + " in catalog " + catalogName);
+ }
command = catalog.getCommand(name);
- log.debug("Found command " + command + "; optional: " + isOptional());
+ if (log.isDebugEnabled()) {
+ log.debug("Found command " + command + ";"
+ + " optional: " + isOptional());
+ }
if(command == null && !isOptional()) {
- throw new IllegalArgumentException("Cannot find command '" + name + "' in catalog '" + catalogName + "'");
+ throw new IllegalArgumentException("Cannot find command "
+ + "'" + name + "' in catalog '" + catalogName + "'");
} else {
return command;
}
@@ -161,13 +174,17 @@
}
/**
- * If the <code>wrapperClassName</code> property is not null, return a <code>Context</code>
- * of the type specified by <code>wrapperClassName</code>, instantiated using a single-arg
- * constructor which takes the <code>context</code> passed as an argument to this method.
+ * <p>If the <code>wrapperClassName</code> property is not null, return a
+ * <code>Context</code> of the type specified by
+ * <code>wrapperClassName</code>, instantiated using a single-arg
+ * constructor which takes the <code>context</code> passed as an
+ * argument to this method.</p>
+ *
+ * <p>This method throws an exception if the wrapperClass cannot be found,
+ * or if there are any errors instantiating the wrapping context.</p>
+ *
* @param context
* @return
- * @throws Exception if the wrapperClass cannot be found, or if there are any errors instantiating
- * the wrapping context.
*/
protected Context getContext(Context context)
throws ClassNotFoundException,
@@ -177,13 +194,25 @@
NoSuchMethodException
{
if (wrapperClassName == null) {
- log.debug("No defined wrapper class; returning original context.");
+ if (log.isDebugEnabled()) {
+ log.debug("No defined wrapper class; " +
+ "returning original context.");
+ }
return context;
}
- log.debug("Looking for wrapper class: " + wrapperClassName);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Looking for wrapper class: " + wrapperClassName);
+ }
+
Class wrapperClass = ClassUtils.getApplicationClass(wrapperClassName);
- log.debug("Instantiating wrapper class");
- return (Context) ConstructorUtils.invokeConstructor(wrapperClass, new Object[] { context });
+
+ if (log.isDebugEnabled()) {
+ log.debug("Instantiating wrapper class");
+ }
+
+ return (Context) ConstructorUtils
+ .invokeConstructor(wrapperClass, new Object[] { context });
}
}
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/AuthorizeAction.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/AuthorizeAction.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/AuthorizeAction.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/AuthorizeAction.java Sat Nov 12 10:01:44 2005
@@ -43,7 +43,8 @@
ActionConfig mapping) throws Exception {
// Identify the HTTP request object
- ServletActionContext servletActionContext = (ServletActionContext) context;
+ ServletActionContext servletActionContext =
+ (ServletActionContext) context;
HttpServletRequest request = servletActionContext.getRequest();
// Check the current user against the list of required roles
@@ -59,10 +60,14 @@
}
- protected String getErrorMessage(ActionContext context, ActionConfig actionConfig) {
- ServletActionContext servletActionContext = (ServletActionContext) context;
+ protected String getErrorMessage(ActionContext context,
+ ActionConfig actionConfig) {
+
+ ServletActionContext servletActionContext =
+ (ServletActionContext) context;
+
// Retrieve internal message resources
- ActionServlet servlet = (ActionServlet) servletActionContext.getActionServlet();
+ ActionServlet servlet = servletActionContext.getActionServlet();
MessageResources resources = servlet.getInternal();
return resources.getMessage("notAuthorized", actionConfig.getPath());
}
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/CreateAction.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/CreateAction.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/CreateAction.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/CreateAction.java Sat Nov 12 10:01:44 2005
@@ -33,19 +33,20 @@
import org.apache.struts.config.ModuleConfig;
/**
- * <p>Concrete implementation of <code>org.apache.struts.chain.commands.CreateAction</code>
- * for use in a Servlet API chain. Expects that the ActionContext passed into it
- * can safely be cast to <code>ServletActionContext</code>.</p>
+ * <p>Concrete implementation of <code>AbstractCreateAction</code>
+ * for use in a Servlet API chain. Expects that the ActionContext passed
+ * into it can safely be cast to <code>ServletActionContext</code>.</p>
*/
-public class CreateAction extends org.apache.struts.chain.commands.AbstractCreateAction {
+public class CreateAction
+ extends org.apache.struts.chain.commands.AbstractCreateAction {
// ------------------------------------------------------ Instance Variables
private static final Log log = LogFactory.getLog(CreateAction.class);
- /* :TODO The Action class' dependency on having its "servlet" property set requires this
- * API-dependent subclass of AbstractCreateAction.
+ /* :TODO The Action class' dependency on having its "servlet" property set
+ * requires this API-dependent subclass of AbstractCreateAction.
*/
protected synchronized Action getAction(ActionContext context, String type,
ActionConfig actionConfig) throws Exception {
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformForward.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformForward.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformForward.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformForward.java Sat Nov 12 10:01:44 2005
@@ -62,7 +62,8 @@
// Retrieve internal message resources
ActionServlet servlet = (ActionServlet) sacontext.getActionServlet();
MessageResources resources = servlet.getInternal();
- throw new IllegalArgumentException(resources.getMessage("forwardPathNull"));
+ throw new IllegalArgumentException(
+ resources.getMessage("forwardPathNull"));
}
ModuleConfig moduleConfig = context.getModuleConfig();
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java Sat Nov 12 10:01:44 2005
@@ -47,7 +47,8 @@
ActionConfig actionConfig,
ActionForm actionForm) throws Exception {
ServletActionContext saContext = (ServletActionContext) context;
- RequestUtils.populate(actionForm, actionConfig.getPrefix(), actionConfig.getSuffix(), saContext.getRequest());
+ RequestUtils.populate(actionForm, actionConfig.getPrefix(),
+ actionConfig.getSuffix(), saContext.getRequest());
}
protected void reset(ActionContext context,
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/SetOriginalURI.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/SetOriginalURI.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/SetOriginalURI.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/servlet/SetOriginalURI.java Sat Nov 12 10:01:44 2005
@@ -42,7 +42,8 @@
ServletActionContext swcontext = (ServletActionContext) context;
HttpServletRequest request = swcontext.getRequest();
- request.setAttribute(Globals.ORIGINAL_URI_KEY, request.getServletPath());
+ request.setAttribute(
+ Globals.ORIGINAL_URI_KEY, request.getServletPath());
}
Modified: struts/core/trunk/src/java/org/apache/struts/chain/commands/util/ClassUtils.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/commands/util/ClassUtils.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/commands/util/ClassUtils.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/commands/util/ClassUtils.java Sat Nov 12 10:01:44 2005
@@ -41,7 +41,8 @@
throws ClassNotFoundException {
if (className == null) {
- throw new NullPointerException("getApplicationClass called with null className");
+ throw new NullPointerException(
+ "getApplicationClass called with null className");
}
ClassLoader classLoader =
Modified: struts/core/trunk/src/java/org/apache/struts/chain/contexts/ActionContextBase.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/contexts/ActionContextBase.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/contexts/ActionContextBase.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/contexts/ActionContextBase.java Sat Nov 12 10:01:44 2005
@@ -48,7 +48,9 @@
* <code>getSessionScope</code>.
* </p>
*/
-public abstract class ActionContextBase extends ContextWrapper implements ActionContext {
+public abstract class ActionContextBase
+ extends ContextWrapper
+ implements ActionContext {
/**
* @see Constants.ACTION_KEY
@@ -68,7 +70,8 @@
/**
* @see Constants.FORWARD_CONFIG_KEY
*/
- public static final String FORWARD_CONFIG_KEY = Constants.FORWARD_CONFIG_KEY;
+ public static final String FORWARD_CONFIG_KEY =
+ Constants.FORWARD_CONFIG_KEY;
/**
* @see Constants.MODULE_CONFIG_KEY
@@ -99,7 +102,8 @@
/**
* @see Constants.MESSAGE_RESOURCES_KEY
*/
- public static final String MESSAGE_RESOURCES_KEY = Constants.MESSAGE_RESOURCES_KEY;
+ public static final String MESSAGE_RESOURCES_KEY =
+ Constants.MESSAGE_RESOURCES_KEY;
/**
* @see Constants.INCLUDE_KEY
@@ -328,13 +332,15 @@
}
/**
- * <p>Save the given <code>messages</code> into the map identified by the given <code>scopeId</code> under
- * the given <code>key</code>.</p>
+ * <p>Save the given <code>messages</code> into the map identified by the
+ * given <code>scopeId</code> under the given <code>key</code>.</p>
* @param scopeId
* @param key
* @param messages
*/
- public void saveActionMessages(String scopeId, String key, ActionMessages messages) {
+ public void saveActionMessages(String scopeId,
+ String key,
+ ActionMessages messages) {
Map scope = getScope(scopeId);
if ((messages == null) || messages.isEmpty()) {
scope.remove(key);
@@ -378,8 +384,9 @@
}
- // ISSUE: The original implementation was based on the HttpSession identifier;
- // what would be a way to do that without depending on the Servlet API?
+ // ISSUE: The original implementation was based on the HttpSession
+ // identifier; what would be a way to do that without depending on the
+ // Servlet API?
// REPLY: uuid's
// http://java.sun.com/products/jini/2.0/doc/specs/api/net/jini/id/Uuid.html
Modified: struts/core/trunk/src/java/org/apache/struts/chain/contexts/WebActionContext.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/java/org/apache/struts/chain/contexts/WebActionContext.java?rev=332804&r1=332803&r2=332804&view=diff
==============================================================================
--- struts/core/trunk/src/java/org/apache/struts/chain/contexts/WebActionContext.java (original)
+++ struts/core/trunk/src/java/org/apache/struts/chain/contexts/WebActionContext.java Sat Nov 12 10:01:44 2005
@@ -155,14 +155,16 @@
return mc;
}
- // ISSUE: AbstractSelectModule set the precedent of doing this at the "web context" level
- // instead of the ServletWebContext level. Consider whether that's how we want to do it
- // universally for other manipulations of the RequestScope or not...
+ // ISSUE: AbstractSelectModule set the precedent of doing this at the
+ // "web context" level instead of the ServletWebContext level. Consider
+ // whether that's how we want to do it universally for other manipulations
+ // of the RequestScope or not...
public void setCancelled(Boolean cancelled) {
super.setCancelled(cancelled);
- // historic semantics of "isCancelled" are to consider any non-null
- // value in the request under Globals.CANCEL_KEY as "yes, this was cancelled."
+ // historic semantics of "isCancelled" are to consider any non-null
+ // value in the request under Globals.CANCEL_KEY as "yes, this was
+ // cancelled."
if (cancelled != null && cancelled.booleanValue()) {
this.getRequestScope().put(Globals.CANCEL_KEY, cancelled);
} else {
@@ -174,7 +176,8 @@
public Boolean getCancelled() {
Boolean cancelled = super.getCancelled();
if (cancelled == null) {
- cancelled = (Boolean) this.getRequestScope().get(Globals.CANCEL_KEY);
+ cancelled = (Boolean) this.getRequestScope()
+ .get(Globals.CANCEL_KEY);
}
return cancelled;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org