You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2006/02/09 15:11:14 UTC
svn commit: r376300 [2/6] - in
/struts/action/trunk/src/java/org/apache/struts: ./ action/ chain/
chain/commands/ chain/commands/generic/ chain/commands/servlet/
chain/commands/util/ chain/contexts/ config/ config/impl/ mock/ upload/
util/ validator/ v...
Modified: struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformInclude.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformInclude.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformInclude.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformInclude.java Thu Feb 9 06:11:07 2006
@@ -39,13 +39,12 @@
* @param uri The uri to be included
*/
protected void perform(ActionContext context, String uri)
- throws Exception {
+ throws Exception {
ServletActionContext swcontext = (ServletActionContext) context;
HttpServletRequest request = swcontext.getRequest();
- RequestDispatcher rd =
- swcontext.getContext().getRequestDispatcher(uri);
+ RequestDispatcher rd = swcontext.getContext().getRequestDispatcher(uri);
rd.forward(request, swcontext.getResponse());
}
Modified: struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java Thu Feb 9 06:11:07 2006
@@ -34,30 +34,28 @@
* $
*/
public class PopulateActionForm extends AbstractPopulateActionForm {
- private static final Log log =
- LogFactory.getLog(PopulateActionForm.class);
+ private static final Log log = LogFactory.getLog(PopulateActionForm.class);
// ------------------------------------------------------- Protected Methods
protected void populate(ActionContext context, ActionConfig actionConfig,
- ActionForm actionForm)
- throws Exception {
+ ActionForm actionForm)
+ throws Exception {
ServletActionContext saContext = (ServletActionContext) context;
RequestUtils.populate(actionForm, actionConfig.getPrefix(),
- actionConfig.getSuffix(), saContext.getRequest());
+ actionConfig.getSuffix(), saContext.getRequest());
}
protected void reset(ActionContext context, ActionConfig actionConfig,
- ActionForm actionForm) {
+ ActionForm actionForm) {
ServletActionContext saContext = (ServletActionContext) context;
- actionForm
- .reset((ActionMapping) actionConfig, saContext.getRequest());
+ actionForm.reset((ActionMapping) actionConfig, saContext.getRequest());
// Set the multipart class
if (actionConfig.getMultipartClass() != null) {
saContext.getRequestScope().put(Globals.MULTIPART_KEY,
- actionConfig.getMultipartClass());
+ actionConfig.getMultipartClass());
}
}
}
Modified: struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectAction.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectAction.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectAction.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectAction.java Thu Feb 9 06:11:07 2006
@@ -47,8 +47,8 @@
// For extension matching, match on the servlet path
if (path == null) {
- path = (String) request
- .getAttribute(Constants.INCLUDE_SERVLET_PATH);
+ path =
+ (String) request.getAttribute(Constants.INCLUDE_SERVLET_PATH);
if (path == null) {
path = request.getServletPath();
@@ -56,7 +56,7 @@
if (path == null) {
throw new IllegalArgumentException(
- "No path information in request");
+ "No path information in request");
}
extension = true;
@@ -68,7 +68,7 @@
if (!path.startsWith(prefix)) {
throw new IllegalArgumentException("Path does not start with '"
- + prefix + "'");
+ + prefix + "'");
}
path = path.substring(prefix.length());
Modified: struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectForward.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectForward.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectForward.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectForward.java Thu Feb 9 06:11:07 2006
@@ -40,10 +40,7 @@
* @param uri The module-relative URI to be the destination
*/
protected ForwardConfig forward(ActionContext context,
- ModuleConfig moduleConfig, String uri) {
- return (new ActionForward(null,
- uri,
- false,
- moduleConfig.getPrefix()));
+ ModuleConfig moduleConfig, String uri) {
+ return (new ActionForward(null, uri, false, moduleConfig.getPrefix()));
}
}
Modified: struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectInput.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectInput.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectInput.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectInput.java Thu Feb 9 06:11:07 2006
@@ -41,10 +41,7 @@
* @param uri The module-relative URI to be the destination
*/
protected ForwardConfig forward(ActionContext context,
- ModuleConfig moduleConfig, String uri) {
- return (new ActionForward(null,
- uri,
- false,
- moduleConfig.getPrefix()));
+ ModuleConfig moduleConfig, String uri) {
+ return (new ActionForward(null, uri, false, moduleConfig.getPrefix()));
}
}
Modified: struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectLocale.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectLocale.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectLocale.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectLocale.java Thu Feb 9 06:11:07 2006
@@ -23,6 +23,7 @@
import org.apache.struts.chain.contexts.ServletActionContext;
import javax.servlet.http.HttpSession;
+
import java.util.Locale;
/**
Modified: struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectModule.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectModule.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectModule.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SelectModule.java Thu Feb 9 06:11:07 2006
@@ -38,21 +38,20 @@
ServletActionContext sacontext = (ServletActionContext) context;
HttpServletRequest request = sacontext.getRequest();
String uri =
- (String) request.getAttribute(Constants.INCLUDE_SERVLET_PATH);
+ (String) request.getAttribute(Constants.INCLUDE_SERVLET_PATH);
if (uri == null) {
uri = request.getServletPath();
}
if (uri == null) {
- throw new IllegalArgumentException(
- "No path information in request");
+ throw new IllegalArgumentException("No path information in request");
}
// Identify the module prefix for the current module
String prefix = ""; // Initialize to default prefix
- String[] prefixes = (String[]) sacontext.getApplicationScope()
- .get(Globals.MODULE_PREFIXES_KEY);
+ String[] prefixes =
+ (String[]) sacontext.getApplicationScope().get(Globals.MODULE_PREFIXES_KEY);
int lastSlash = 0;
while (prefix.equals("") && ((lastSlash = uri.lastIndexOf("/")) > 0)) {
Modified: struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SetOriginalURI.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SetOriginalURI.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SetOriginalURI.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/SetOriginalURI.java Thu Feb 9 06:11:07 2006
@@ -34,7 +34,6 @@
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/action/trunk/src/java/org/apache/struts/chain/commands/servlet/ValidateActionForm.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/ValidateActionForm.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/ValidateActionForm.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/ValidateActionForm.java Thu Feb 9 06:11:07 2006
@@ -36,8 +36,7 @@
*/
public class ValidateActionForm extends AbstractValidateActionForm {
// ------------------------------------------------------ Instance Variables
- private static final Log log =
- LogFactory.getLog(ValidateActionForm.class);
+ private static final Log log = LogFactory.getLog(ValidateActionForm.class);
// ------------------------------------------------------- Protected Methods
@@ -49,12 +48,11 @@
* @param actionForm The form bean for this request
*/
protected ActionErrors validate(ActionContext context,
- ActionConfig actionConfig,
- ActionForm actionForm) {
+ ActionConfig actionConfig, ActionForm actionForm) {
ServletActionContext saContext = (ServletActionContext) context;
ActionErrors errors =
- (actionForm.validate((ActionMapping) actionConfig,
- saContext.getRequest()));
+ (actionForm.validate((ActionMapping) actionConfig,
+ saContext.getRequest()));
// Special handling for multipart request
if ((errors != null) && !errors.isEmpty()) {
Modified: struts/action/trunk/src/java/org/apache/struts/chain/commands/util/ClassUtils.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/commands/util/ClassUtils.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/commands/util/ClassUtils.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/commands/util/ClassUtils.java Thu Feb 9 06:11:07 2006
@@ -33,14 +33,14 @@
* @throws ClassNotFoundException if the specified class cannot be loaded
*/
public static Class getApplicationClass(String className)
- throws ClassNotFoundException {
+ throws ClassNotFoundException {
if (className == null) {
throw new NullPointerException(
- "getApplicationClass called with null className");
+ "getApplicationClass called with null className");
}
ClassLoader classLoader =
- Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().getContextClassLoader();
if (classLoader == null) {
classLoader = ClassUtils.class.getClassLoader();
@@ -61,7 +61,7 @@
* constructor
*/
public static Object getApplicationInstance(String className)
- throws ClassNotFoundException, IllegalAccessException,
+ throws ClassNotFoundException, IllegalAccessException,
InstantiationException {
return (getApplicationClass(className).newInstance());
}
Modified: struts/action/trunk/src/java/org/apache/struts/chain/contexts/ActionContextBase.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/contexts/ActionContextBase.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/contexts/ActionContextBase.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/contexts/ActionContextBase.java Thu Feb 9 06:11:07 2006
@@ -43,7 +43,7 @@
* <code>getSessionScope</code>. </p>
*/
public abstract class ActionContextBase extends ContextWrapper
- implements ActionContext {
+ implements ActionContext {
/**
* @see Constants.ACTION_KEY
*/
@@ -52,8 +52,7 @@
/**
* @see
*/
- public static final String ACTION_CONFIG_KEY =
- Constants.ACTION_CONFIG_KEY;
+ public static final String ACTION_CONFIG_KEY = Constants.ACTION_CONFIG_KEY;
/**
* @see Constants.ACTION_FORM_KEY
@@ -64,13 +63,12 @@
* @see Constants.FORWARD_CONFIG_KEY
*/
public static final String FORWARD_CONFIG_KEY =
- Constants.FORWARD_CONFIG_KEY;
+ Constants.FORWARD_CONFIG_KEY;
/**
* @see Constants.MODULE_CONFIG_KEY
*/
- public static final String MODULE_CONFIG_KEY =
- Constants.MODULE_CONFIG_KEY;
+ public static final String MODULE_CONFIG_KEY = Constants.MODULE_CONFIG_KEY;
/**
* @see Constants.EXCEPTION_KEY
@@ -93,7 +91,7 @@
* @see Constants.MESSAGE_RESOURCES_KEY
*/
public static final String MESSAGE_RESOURCES_KEY =
- Constants.MESSAGE_RESOURCES_KEY;
+ Constants.MESSAGE_RESOURCES_KEY;
/**
* @see Constants.INCLUDE_KEY
@@ -119,8 +117,7 @@
* Provide the default context attribute under which to store the
* transaction token key.
*/
- public static final String TRANSACTION_TOKEN_KEY =
- "TRANSACTION_TOKEN_KEY";
+ public static final String TRANSACTION_TOKEN_KEY = "TRANSACTION_TOKEN_KEY";
/**
* Provide the default context attribute under which to store the token
@@ -333,7 +330,7 @@
* @param messages
*/
public void saveActionMessages(String scopeId, String key,
- ActionMessages messages) {
+ ActionMessages messages) {
Map scope = getScope(scopeId);
if ((messages == null) || messages.isEmpty()) {
@@ -493,11 +490,10 @@
* @throws InstantiationException If object cannot be created
* @see this.findOrCreateActionForm(String, String, ModuleConfig)
*/
- public ActionForm findOrCreateActionForm(String formName,
- String scopeName)
- throws IllegalAccessException, InstantiationException {
+ public ActionForm findOrCreateActionForm(String formName, String scopeName)
+ throws IllegalAccessException, InstantiationException {
return this.findOrCreateActionForm(formName, scopeName,
- this.getModuleConfig());
+ this.getModuleConfig());
}
/**
@@ -514,19 +510,18 @@
* @throws IllegalArgumentException If form config is missing from module or
* scopeName is invalid
*/
- public ActionForm findOrCreateActionForm(String formName,
- String scopeName,
- ModuleConfig moduleConfig)
- throws IllegalAccessException, InstantiationException {
+ public ActionForm findOrCreateActionForm(String formName, String scopeName,
+ ModuleConfig moduleConfig)
+ throws IllegalAccessException, InstantiationException {
Map scope = this.getScope(scopeName);
ActionForm instance;
FormBeanConfig formBeanConfig =
- moduleConfig.findFormBeanConfig(formName);
+ moduleConfig.findFormBeanConfig(formName);
if (formBeanConfig == null) {
throw new IllegalArgumentException("No form config found under "
- + formName + " in module " + moduleConfig.getPrefix());
+ + formName + " in module " + moduleConfig.getPrefix());
}
instance = (ActionForm) scope.get(formName);
@@ -534,7 +529,7 @@
// ISSUE: Can we recycle the existing instance (if any)?
if (instance != null) {
getLogger().trace("Found an instance in scope " + scopeName
- + "; test for reusability");
+ + "; test for reusability");
if (formBeanConfig.canReuse(instance)) {
return instance;
Modified: struts/action/trunk/src/java/org/apache/struts/chain/contexts/ServletActionContext.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/contexts/ServletActionContext.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/contexts/ServletActionContext.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/contexts/ServletActionContext.java Thu Feb 9 06:11:07 2006
@@ -52,8 +52,7 @@
* @param response The instant HttpServletResponse
*/
public ServletActionContext(ServletContext context,
- HttpServletRequest request,
- HttpServletResponse response) {
+ HttpServletRequest request, HttpServletResponse response) {
this(new ServletWebContext(context, request, response));
}
@@ -131,8 +130,7 @@
}
public MessageResources getMessageResources() {
- return ((MessageResources) getRequest()
- .getAttribute(Globals.MESSAGES_KEY));
+ return ((MessageResources) getRequest().getAttribute(Globals.MESSAGES_KEY));
}
// ISSUE: This method would probably be better handled by a "Struts"
@@ -143,7 +141,7 @@
// Return the requested message resources instance
return (MessageResources) context.getAttribute(key
- + getModuleConfig().getPrefix());
+ + getModuleConfig().getPrefix());
}
public void setMessageResources(MessageResources resources) {
@@ -160,7 +158,7 @@
*/
public void setMessageResources(String key, MessageResources resources) {
this.getRequest().setAttribute(key + getModuleConfig().getPrefix(),
- resources);
+ resources);
}
// -------------------------------
@@ -219,13 +217,11 @@
}
public ActionMessages getErrors() {
- return (ActionMessages) this.getRequest()
- .getAttribute(Globals.ERROR_KEY);
+ return (ActionMessages) this.getRequest().getAttribute(Globals.ERROR_KEY);
}
public ActionMessages getMessages() {
- return (ActionMessages) this.getRequest()
- .getAttribute(Globals.MESSAGE_KEY);
+ return (ActionMessages) this.getRequest().getAttribute(Globals.MESSAGE_KEY);
}
// -------------------------------
Modified: struts/action/trunk/src/java/org/apache/struts/chain/contexts/WebActionContext.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/contexts/WebActionContext.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/contexts/WebActionContext.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/contexts/WebActionContext.java Thu Feb 9 06:11:07 2006
@@ -141,8 +141,7 @@
ModuleConfig mc = super.getModuleConfig();
if (mc == null) {
- mc = (ModuleConfig) this.getRequestScope()
- .get(Globals.MODULE_KEY);
+ mc = (ModuleConfig) this.getRequestScope().get(Globals.MODULE_KEY);
}
return mc;
@@ -170,7 +169,7 @@
if (cancelled == null) {
cancelled =
- (Boolean) this.getRequestScope().get(Globals.CANCEL_KEY);
+ (Boolean) this.getRequestScope().get(Globals.CANCEL_KEY);
}
return cancelled;
Modified: struts/action/trunk/src/java/org/apache/struts/config/ActionConfig.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/config/ActionConfig.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/config/ActionConfig.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/config/ActionConfig.java Thu Feb 9 06:11:07 2006
@@ -23,6 +23,7 @@
import org.apache.struts.util.RequestUtils;
import java.lang.reflect.InvocationTargetException;
+
import java.util.ArrayList;
import java.util.HashMap;
@@ -41,146 +42,146 @@
// ----------------------------------------------------- Instance Variables
/**
- * The set of exception handling configurations for this action, if any,
- * keyed by the <code>type</code> property.
+ * <p> The set of exception handling configurations for this action, if
+ * any, keyed by the <code>type</code> property. </p>
*/
protected HashMap exceptions = new HashMap();
/**
- * The set of local forward configurations for this action, if any, keyed
- * by the <code>name</code> property.
+ * <p> The set of local forward configurations for this action, if any,
+ * keyed by the <code>name</code> property. </p>
*/
protected HashMap forwards = new HashMap();
// ------------------------------------------------------------- Properties
/**
- * The module configuration with which we are associated.
+ * <p> The module configuration with which we are associated. </p>
*/
protected ModuleConfig moduleConfig = null;
/**
- * The request-scope or session-scope attribute name under which our form
- * bean is accessed, if it is different from the form bean's specified
- * <code>name</code>.
+ * <p> The request-scope or session-scope attribute name under which our
+ * form bean is accessed, if it is different from the form bean's
+ * specified <code>name</code>. </p>
*/
protected String attribute = null;
/**
* <p>The path of the ActionConfig that this object should inherit
- * properties from.</p>
+ * properties from.</p> </p>
*/
protected String inherit = null;
/**
- * Have the inheritance values for this class been applied?
+ * <p> Have the inheritance values for this class been applied?
*/
protected boolean extensionProcessed = false;
/**
- * Context-relative path of the web application resource that will process
- * this request via RequestDispatcher.forward(), instead of instantiating
- * and calling the <code>Action</code> class specified by "type". Exactly
- * one of <code>forward</code>, <code>include</code>, or <code>type</code>
- * must be specified.
+ * <p> Context-relative path of the web application resource that will
+ * process this request via RequestDispatcher.forward(), instead of
+ * instantiating and calling the <code>Action</code> class specified by
+ * "type". Exactly one of <code>forward</code>, <code>include</code>, or
+ * <code>type</code> must be specified. </p>
*/
protected String forward = null;
/**
- * Context-relative path of the web application resource that will process
- * this request via RequestDispatcher.include(), instead of instantiating
- * and calling the <code>Action</code> class specified by "type". Exactly
- * one of <code>forward</code>, <code>include</code>, or <code>type</code>
- * must be specified.
+ * <p> Context-relative path of the web application resource that will
+ * process this request via RequestDispatcher.include(), instead of
+ * instantiating and calling the <code>Action</code> class specified by
+ * "type". Exactly one of <code>forward</code>, <code>include</code>, or
+ * <code>type</code> must be specified. </p>
*/
protected String include = null;
/**
- * Context-relative path of the input form to which control should be
+ * <p> Context-relative path of the input form to which control should be
* returned if a validation error is encountered. Required if "name" is
- * specified and the input bean returns validation errors.
+ * specified and the input bean returns validation errors. </p>
*/
protected String input = null;
/**
- * Fully qualified Java class name of the <code>MultipartRequestHandler</code>
+ * <p> Fully qualified Java class name of the <code>MultipartRequestHandler</code>
* implementation class used to process multi-part request data for this
- * Action.
+ * Action. </p>
*/
protected String multipartClass = null;
/**
- * Name of the form bean, if any, associated with this Action.
+ * <p> Name of the form bean, if any, associated with this Action. </p>
*/
protected String name = null;
/**
- * General purpose configuration parameter that can be used to pass extra
- * information to the Action instance selected by this Action. Struts does
- * not itself use this value in any way.
+ * <p> General purpose configuration parameter that can be used to pass
+ * extra information to the Action instance selected by this Action.
+ * Struts does not itself use this value in any way. </p>
*/
protected String parameter = null;
/**
- * Context-relative path of the submitted request, starting with a slash
- * ("/") character, and omitting any filename extension if extension
- * mapping is being used.
+ * <p> Context-relative path of the submitted request, starting with a
+ * slash ("/") character, and omitting any filename extension if extension
+ * mapping is being used. </p>
*/
protected String path = null;
/**
- * Prefix used to match request parameter names to form bean property
- * names, if any.
+ * <p> Prefix used to match request parameter names to form bean property
+ * names, if any. </p>
*/
protected String prefix = null;
/**
- * Comma-delimited list of security role names allowed to request this
- * Action.
+ * <p> Comma-delimited list of security role names allowed to request this
+ * Action. </p>
*/
protected String roles = null;
/**
- * The set of security role names used to authorize access to this Action,
- * as an array for faster access.
+ * <p> The set of security role names used to authorize access to this
+ * Action, as an array for faster access. </p>
*/
protected String[] roleNames = new String[0];
/**
- * Identifier of the scope ("request" or "session") within which our form
- * bean is accessed, if any.
+ * <p> Identifier of the scope ("request" or "session") within which our
+ * form bean is accessed, if any. </p>
*/
protected String scope = "session";
/**
- * Suffix used to match request parameter names to form bean property
- * names, if any.
+ * <p> Suffix used to match request parameter names to form bean property
+ * names, if any. </p>
*/
protected String suffix = null;
/**
- * Fully qualified Java class name of the <code>Action</code> class to be
- * used to process requests for this mapping if the <code>forward</code>
- * and <code>include</code> properties are not set. Exactly one of
- * <code>forward</code>, <code>include</code>, or <code>type</code> must
- * be specified.
+ * <p> Fully qualified Java class name of the <code>Action</code> class to
+ * be used to process requests for this mapping if the
+ * <code>forward</code> and <code>include</code> properties are not set.
+ * Exactly one of <code>forward</code>, <code>include</code>, or
+ * <code>type</code> must be specified.
*/
protected String type = null;
/**
- * Indicates Action be configured as the default one for this module, when
- * true.
+ * <p> Indicates Action be configured as the default one for this module,
+ * when true.
*/
protected boolean unknown = false;
/**
- * Should the <code>validate()</code> method of the form bean associated
- * with this action be called?
+ * <p> Should the <code>validate()</code> method of the form bean
+ * associated with this action be called?
*/
protected boolean validate = true;
/**
- * The name of a <code>commons-chain</code> command which should be
+ * <p> The name of a <code>commons-chain</code> command which should be
* executed as part of the processing of this action.
*
* @since Struts 1.3.0
@@ -188,7 +189,7 @@
protected String command = null;
/**
- * The name of a <code>commons-chain</code> catalog in which
+ * <p> The name of a <code>commons-chain</code> catalog in which
* <code>command</code> should be sought. If a <code>command</code> is
* defined and this property is undefined, the "default" catalog will be
* used. This is likely to be infrequently used after a future release of
@@ -200,14 +201,14 @@
protected String catalog = null;
/**
- * The module configuration with which we are associated.
+ * <p> The module configuration with which we are associated.
*/
public ModuleConfig getModuleConfig() {
return (this.moduleConfig);
}
/**
- * The module configuration with which we are associated.
+ * <p> The module configuration with which we are associated.
*/
public void setModuleConfig(ModuleConfig moduleConfig) {
if (configured) {
@@ -218,9 +219,9 @@
}
/**
- * Returns the request-scope or session-scope attribute name under which
- * our form bean is accessed, if it is different from the form bean's
- * specified <code>name</code>.
+ * <p> Returns the request-scope or session-scope attribute name under
+ * which our form bean is accessed, if it is different from the form
+ * bean's specified <code>name</code>.
*
* @return attribute name under which our form bean is accessed.
*/
@@ -233,8 +234,8 @@
}
/**
- * Set the request-scope or session-scope attribute name under which our
- * form bean is accessed, if it is different from the form bean's
+ * <p> Set the request-scope or session-scope attribute name under which
+ * our form bean is accessed, if it is different from the form bean's
* specified <code>name</code>.
*
* @param attribute the request-scope or session-scope attribute name
@@ -279,8 +280,8 @@
}
/**
- * Returns context-relative path of the web application resource that will
- * process this request.
+ * <p> Returns context-relative path of the web application resource that
+ * will process this request.
*
* @return context-relative path of the web application resource that will
* process this request.
@@ -290,8 +291,8 @@
}
/**
- * Set the context-relative path of the web application resource that will
- * process this request. Exactly one of <code>forward</code>,
+ * <p> Set the context-relative path of the web application resource that
+ * will process this request. Exactly one of <code>forward</code>,
* <code>include</code>, or <code>type</code> must be specified.
*
* @param forward context-relative path of the web application resource
@@ -306,8 +307,8 @@
}
/**
- * Context-relative path of the web application resource that will process
- * this request.
+ * <p> Context-relative path of the web application resource that will
+ * process this request.
*
* @return Context-relative path of the web application resource that will
* process this request.
@@ -317,7 +318,7 @@
}
/**
- * Set context-relative path of the web application resource that will
+ * <p> Set context-relative path of the web application resource that will
* process this request. Exactly one of <code>forward</code>,
* <code>include</code>, or <code>type</code> must be specified.
*
@@ -333,8 +334,8 @@
}
/**
- * Get the context-relative path of the input form to which control should
- * be returned if a validation error is encountered.
+ * <p> Get the context-relative path of the input form to which control
+ * should be returned if a validation error is encountered.
*
* @return context-relative path of the input form to which control should
* be returned if a validation error is encountered.
@@ -344,9 +345,9 @@
}
/**
- * Set the context-relative path of the input form to which control should
- * be returned if a validation error is encountered. Required if "name"
- * is specified and the input bean returns validation errors.
+ * <p> Set the context-relative path of the input form to which control
+ * should be returned if a validation error is encountered. Required if
+ * "name" is specified and the input bean returns validation errors.
*
* @param input context-relative path of the input form to which control
* should be returned if a validation error is encountered.
@@ -360,7 +361,7 @@
}
/**
- * Return the fully qualified Java class name of the
+ * <p> Return the fully qualified Java class name of the
* <code>MultipartRequestHandler</code> implementation class used to
* process multi-part request data for this Action.
*/
@@ -369,9 +370,9 @@
}
/**
- * Set the fully qualified Java class name of the <code>MultipartRequestHandler</code>
- * implementation class used to process multi-part request data for this
- * Action.
+ * <p> Set the fully qualified Java class name of the
+ * <code>MultipartRequestHandler</code> implementation class used to
+ * process multi-part request data for this Action.
*
* @param multipartClass fully qualified class name of the
* <code>MultipartRequestHandler</code>
@@ -386,7 +387,7 @@
}
/**
- * Return name of the form bean, if any, associated with this Action.
+ * <p> Return name of the form bean, if any, associated with this Action.
*/
public String getName() {
return (this.name);
@@ -404,8 +405,8 @@
}
/**
- * Return general purpose configuration parameter that can be used to pass
- * extra information to the Action instance selected by this Action.
+ * <p> Return general purpose configuration parameter that can be used to
+ * pass extra information to the Action instance selected by this Action.
* Struts does not itself use this value in any way.
*/
public String getParameter() {
@@ -413,9 +414,9 @@
}
/**
- * General purpose configuration parameter that can be used to pass extra
- * information to the Action instance selected by this Action. Struts does
- * not itself use this value in any way.
+ * <p> General purpose configuration parameter that can be used to pass
+ * extra information to the Action instance selected by this Action.
+ * Struts does not itself use this value in any way.
*
* @param parameter General purpose configuration parameter.
*/
@@ -428,16 +429,16 @@
}
/**
- * Return context-relative path of the submitted request, starting with a
- * slash ("/") character, and omitting any filename extension if extension
- * mapping is being used.
+ * <p> Return context-relative path of the submitted request, starting
+ * with a slash ("/") character, and omitting any filename extension if
+ * extension mapping is being used.
*/
public String getPath() {
return (this.path);
}
/**
- * Set context-relative path of the submitted request, starting with a
+ * <p> Set context-relative path of the submitted request, starting with a
* slash ("/") character, and omitting any filename extension if extension
* mapping is being used.
*
@@ -452,7 +453,7 @@
}
/**
- * Retruns prefix used to match request parameter names to form bean
+ * <p> Retruns prefix used to match request parameter names to form bean
* property names, if any.
*/
public String getPrefix() {
@@ -511,7 +512,7 @@
}
/**
- * Get array of security role names used to authorize access to this
+ * <p> Get array of security role names used to authorize access to this
* Action.
*/
public String[] getRoleNames() {
@@ -519,8 +520,8 @@
}
/**
- * Get the scope ("request" or "session") within which our form bean is
- * accessed, if any.
+ * <p> Get the scope ("request" or "session") within which our form bean
+ * is accessed, if any.
*/
public String getScope() {
return (this.scope);
@@ -539,8 +540,8 @@
}
/**
- * Return suffix used to match request parameter names to form bean
- * property names, if any.
+ * <p> Return suffix used to match request parameter names to form bean
+ * property names, if any. </p>
*/
public String getSuffix() {
return (this.suffix);
@@ -571,8 +572,8 @@
}
/**
- * Determine whether Action is configured as the default one for this
- * module.
+ * <p> Determine whether Action is configured as the default one for this
+ * module. </p>
*/
public boolean getUnknown() {
return (this.unknown);
@@ -603,8 +604,8 @@
}
/**
- * Get the name of a <code>commons-chain</code> command which should be
- * executed as part of the processing of this action.
+ * <p> Get the name of a <code>commons-chain</code> command which should
+ * be executed as part of the processing of this action. </p>
*
* @return name of a <code>commons-chain</code> command which should be
* executed as part of the processing of this action.
@@ -615,10 +616,10 @@
}
/**
- * Get the name of a <code>commons-chain</code> catalog in which a
+ * <p> Get the name of a <code>commons-chain</code> catalog in which a
* specified command should be sought. This is likely to be infrequently
* used after a future release of <code>commons-chain</code> supports a
- * one-string expression of a catalog/chain combination.
+ * one-string expression of a catalog/chain combination. </p>
*
* @return name of a <code>commons-chain</code> catalog in which a
* specified command should be sought.
@@ -629,8 +630,8 @@
}
/**
- * Set the name of a <code>commons-chain</code> command which should be
- * executed as part of the processing of this action.
+ * <p> Set the name of a <code>commons-chain</code> command which should
+ * be executed as part of the processing of this action. </p>
*
* @param command name of a <code>commons-chain</code> command which
* should be executed as part of the processing of this
@@ -646,10 +647,10 @@
}
/**
- * Set the name of a <code>commons-chain</code> catalog in which a
+ * <p> Set the name of a <code>commons-chain</code> catalog in which a
* specified command should be sought. This is likely to be infrequently
* used after a future release of <code>commons-chain</code> supports a
- * one-string expression of a catalog/chain combination.
+ * one-string expression of a catalog/chain combination. </p>
*
* @param catalog name of a <code>commons-chain</code> catalog in which a
* specified command should be sought.
@@ -682,8 +683,7 @@
}
// get our ancestor's ancestor
- ActionConfig ancestor =
- moduleConfig.findActionConfig(ancestorPath);
+ ActionConfig ancestor = moduleConfig.findActionConfig(ancestorPath);
if (ancestor != null) {
ancestorPath = ancestor.getExtends();
@@ -703,7 +703,7 @@
* @see #inheritFrom(ActionConfig)
*/
protected void inheritExceptionHandlers(ActionConfig baseConfig)
- throws ClassNotFoundException, IllegalAccessException,
+ throws ClassNotFoundException, IllegalAccessException,
InstantiationException, InvocationTargetException {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
@@ -717,13 +717,13 @@
// Do we have this handler?
ExceptionConfig copy =
- this.findExceptionConfig(baseHandler.getType());
+ this.findExceptionConfig(baseHandler.getType());
if (copy == null) {
// We don't have this, so let's copy it
- copy = (ExceptionConfig) RequestUtils
- .applicationInstance(baseHandler.getClass()
- .getName());
+ copy =
+ (ExceptionConfig) RequestUtils.applicationInstance(baseHandler.getClass()
+ .getName());
BeanUtils.copyProperties(copy, baseHandler);
this.addExceptionConfig(copy);
@@ -743,7 +743,7 @@
* @see #inheritFrom(ActionConfig)
*/
protected void inheritForwards(ActionConfig baseConfig)
- throws ClassNotFoundException, IllegalAccessException,
+ throws ClassNotFoundException, IllegalAccessException,
InstantiationException, InvocationTargetException {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
@@ -756,14 +756,13 @@
ForwardConfig baseForward = baseForwards[i];
// Do we have this forward?
- ForwardConfig copy =
- this.findForwardConfig(baseForward.getName());
+ ForwardConfig copy = this.findForwardConfig(baseForward.getName());
if (copy == null) {
// We don't have this, so let's copy it
- copy = (ForwardConfig) RequestUtils
- .applicationInstance(baseForward.getClass()
- .getName());
+ copy =
+ (ForwardConfig) RequestUtils.applicationInstance(baseForward.getClass()
+ .getName());
BeanUtils.copyProperties(copy, baseForward);
this.addForwardConfig(copy);
@@ -778,8 +777,8 @@
// --------------------------------------------------------- Public Methods
/**
- * Add a new <code>ExceptionConfig</code> instance to the set associated
- * with this action.
+ * <p> Add a new <code>ExceptionConfig</code> instance to the set
+ * associated with this action. </p>
*
* @param config The new configuration instance to be added
* @throws IllegalStateException if this module configuration has been
@@ -794,8 +793,8 @@
}
/**
- * Add a new <code>ForwardConfig</code> instance to the set of global
- * forwards associated with this action.
+ * <p> Add a new <code>ForwardConfig</code> instance to the set of global
+ * forwards associated with this action. </p>
*
* @param config The new configuration instance to be added
* @throws IllegalStateException if this module configuration has been
@@ -810,8 +809,8 @@
}
/**
- * Return the exception configuration for the specified type, if any;
- * otherwise return <code>null</code>.
+ * <p> Return the exception configuration for the specified type, if any;
+ * otherwise return <code>null</code>. </p>
*
* @param type Exception class name to find a configuration for
*/
@@ -820,8 +819,8 @@
}
/**
- * Return the exception configurations for this action. If there are
- * none, a zero-length array is returned.
+ * <p> Return the exception configurations for this action. If there are
+ * none, a zero-length array is returned. </p>
*/
public ExceptionConfig[] findExceptionConfigs() {
ExceptionConfig[] results = new ExceptionConfig[exceptions.size()];
@@ -878,8 +877,8 @@
}
/**
- * Return the forward configuration for the specified key, if any;
- * otherwise return <code>null</code>.
+ * <p> Return the forward configuration for the specified key, if any;
+ * otherwise return <code>null</code>. </p>
*
* @param name Name of the forward configuration to return
*/
@@ -888,8 +887,8 @@
}
/**
- * Return all forward configurations for this module. If there are none,
- * a zero-length array is returned.
+ * <p> Return all forward configurations for this module. If there are
+ * none, a zero-length array is returned. </p>
*/
public ForwardConfig[] findForwardConfigs() {
ForwardConfig[] results = new ForwardConfig[forwards.size()];
@@ -898,7 +897,7 @@
}
/**
- * Freeze the configuration of this action.
+ * <p> Freeze the configuration of this action. </p>
*/
public void freeze() {
super.freeze();
@@ -942,7 +941,7 @@
* @see #processExtends(ModuleConfig)
*/
public void inheritFrom(ActionConfig config)
- throws ClassNotFoundException, IllegalAccessException,
+ throws ClassNotFoundException, IllegalAccessException,
InstantiationException, InvocationTargetException {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
@@ -1032,7 +1031,7 @@
* @see #inheritFrom(ActionConfig)
*/
public void processExtends(ModuleConfig moduleConfig)
- throws ClassNotFoundException, IllegalAccessException,
+ throws ClassNotFoundException, IllegalAccessException,
InstantiationException, InvocationTargetException {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
@@ -1042,19 +1041,18 @@
if ((!extensionProcessed) && (ancestorPath != null)) {
ActionConfig baseConfig =
- moduleConfig.findActionConfig(ancestorPath);
+ moduleConfig.findActionConfig(ancestorPath);
if (baseConfig == null) {
throw new NullPointerException("Unable to find "
- + "action for '" + ancestorPath + "' to extend.");
+ + "action for '" + ancestorPath + "' to extend.");
}
// Check against circular inheritance and make sure the base
// config's own extends has been processed already
if (checkCircularInheritance(moduleConfig)) {
throw new IllegalArgumentException(
- "Circular inheritance detected for action "
- + getPath());
+ "Circular inheritance detected for action " + getPath());
}
// Make sure the ancestor's own extension has been processed.
@@ -1070,7 +1068,7 @@
}
/**
- * Remove the specified exception configuration instance.
+ * <p> Remove the specified exception configuration instance. </p>
*
* @param config ExceptionConfig instance to be removed
* @throws IllegalStateException if this module configuration has been
@@ -1085,7 +1083,7 @@
}
/**
- * Remove the specified forward configuration instance.
+ * <p> Remove the specified forward configuration instance. </p>
*
* @param config ForwardConfig instance to be removed
* @throws IllegalStateException if this module configuration has been
@@ -1100,7 +1098,7 @@
}
/**
- * Return a String representation of this object.
+ * <p> Return a String representation of this object. </p>
*/
public String toString() {
StringBuffer sb = new StringBuffer("ActionConfig[");
Modified: struts/action/trunk/src/java/org/apache/struts/config/ActionConfigMatcher.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/config/ActionConfigMatcher.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/config/ActionConfigMatcher.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/config/ActionConfigMatcher.java Thu Feb 9 06:11:07 2006
@@ -24,6 +24,7 @@
import org.apache.struts.util.WildcardHelper;
import java.io.Serializable;
+
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -32,36 +33,35 @@
import java.util.Properties;
/**
- * Matches paths against pre-compiled wildcard expressions pulled from action
- * configs. It uses the wildcard matcher from the Apache Cocoon project.
- * Patterns will be matched in the order they exist in the Struts config file.
- * The last match wins, so more specific patterns should be defined after less
- * specific patterns.
+ * <p> Matches paths against pre-compiled wildcard expressions pulled from
+ * action configs. It uses the wildcard matcher from the Apache Cocoon
+ * project. Patterns will be matched in the order they exist in the Struts
+ * config file. The last match wins, so more specific patterns should be
+ * defined after less specific patterns.
*
* @since Struts 1.2
*/
public class ActionConfigMatcher implements Serializable {
/**
- * The logging instance
+ * <p> The logging instance </p>
*/
- private static final Log log =
- LogFactory.getLog(ActionConfigMatcher.class);
+ private static final Log log = LogFactory.getLog(ActionConfigMatcher.class);
/**
- * Handles all wildcard pattern matching.
+ * <p> Handles all wildcard pattern matching. </p>
*/
private static final WildcardHelper wildcard = new WildcardHelper();
/**
- * The compiled paths and their associated ActionConfig's
+ * <p> The compiled paths and their associated ActionConfig's </p>
*/
private List compiledPaths;
/**
- * Finds and precompiles the wildcard patterns from the ActionConfig
+ * <p> Finds and precompiles the wildcard patterns from the ActionConfig
* "path" attributes. ActionConfig's will be evaluated in the order they
* exist in the Struts config file. Only paths that actually contain a
- * wildcard will be compiled.
+ * wildcard will be compiled. </p>
*
* @param configs An array of ActionConfig's to process
*/
@@ -90,7 +90,7 @@
}
/**
- * Matches the path against the compiled wildcard patterns.
+ * <p> Matches the path against the compiled wildcard patterns. </p>
*
* @param path The portion of the request URI for selecting a config.
* @return The action config if matched, else null
@@ -101,7 +101,7 @@
if (compiledPaths.size() > 0) {
if (log.isDebugEnabled()) {
log.debug("Attempting to match '" + path
- + "' to a wildcard pattern");
+ + "' to a wildcard pattern");
}
if ((path.length() > 0) && (path.charAt(0) == '/')) {
@@ -117,10 +117,11 @@
if (wildcard.match(vars, path, m.getPattern())) {
if (log.isDebugEnabled()) {
log.debug("Path matches pattern '"
- + m.getActionConfig().getPath() + "'");
+ + m.getActionConfig().getPath() + "'");
}
- config = convertActionConfig(path,
+ config =
+ convertActionConfig(path,
(ActionConfig) m.getActionConfig(), vars);
}
}
@@ -130,8 +131,8 @@
}
/**
- * Clones the ActionConfig and its children, replacing various properties
- * with the values of the wildcard-matched strings.
+ * <p> Clones the ActionConfig and its children, replacing various
+ * properties with the values of the wildcard-matched strings. </p>
*
* @param path The requested path
* @param orig The original ActionConfig
@@ -140,15 +141,14 @@
* wildcard-matched values
*/
protected ActionConfig convertActionConfig(String path, ActionConfig orig,
- Map vars) {
+ Map vars) {
ActionConfig config = null;
try {
config = (ActionConfig) BeanUtils.cloneBean(orig);
- }
- catch (Exception ex) {
+ } catch (Exception ex) {
log.warn("Unable to clone action config, recommend not using "
- + "wildcards", ex);
+ + "wildcards", ex);
return null;
}
@@ -169,8 +169,7 @@
config.setInput(convertParam(orig.getInput(), vars));
config.setCatalog(convertParam(orig.getCatalog(), vars));
config.setCommand(convertParam(orig.getCommand(), vars));
- config.setMultipartClass(convertParam(orig.getMultipartClass(),
- vars));
+ config.setMultipartClass(convertParam(orig.getMultipartClass(), vars));
config.setPrefix(convertParam(orig.getPrefix(), vars));
config.setSuffix(convertParam(orig.getSuffix(), vars));
@@ -185,9 +184,8 @@
cfg.setCommand(convertParam(fConfigs[x].getCommand(), vars));
cfg.setCatalog(convertParam(fConfigs[x].getCatalog(), vars));
- replaceProperties(fConfigs[x].getProperties(),
- cfg.getProperties(),
- vars);
+ replaceProperties(fConfigs[x].getProperties(), cfg.getProperties(),
+ vars);
config.removeForwardConfig(fConfigs[x]);
config.addForwardConfig(cfg);
@@ -207,25 +205,26 @@
}
/**
- * Replaces placeholders from one Properties values set to another.
+ * <p> Replaces placeholders from one Properties values set to another.
+ * </p>
*
* @param orig The original properties set with placehold values
* @param props The target properties to store the processed values
* @param vars A Map of wildcard-matched strings
*/
- protected void replaceProperties(Properties orig, Properties props,
- Map vars) {
+ protected void replaceProperties(Properties orig, Properties props, Map vars) {
Map.Entry entry = null;
for (Iterator i = orig.entrySet().iterator(); i.hasNext();) {
entry = (Map.Entry) i.next();
props.setProperty((String) entry.getKey(),
- convertParam((String) entry.getValue(), vars));
+ convertParam((String) entry.getValue(), vars));
}
}
/**
- * Inserts into a value wildcard-matched strings where specified.
+ * <p> Inserts into a value wildcard-matched strings where specified.
+ * </p>
*
* @param val The value to convert
* @param vars A Map of wildcard-matched strings
@@ -259,21 +258,22 @@
}
/**
- * Stores a compiled wildcard pattern and the ActionConfig it came from.
+ * <p> Stores a compiled wildcard pattern and the ActionConfig it came
+ * from. </p>
*/
private class Mapping implements Serializable {
/**
- * The compiled pattern.
+ * <p> The compiled pattern. </p>
*/
private int[] pattern;
/**
- * The original ActionConfig.
+ * <p> The original ActionConfig. </p>
*/
private ActionConfig config;
/**
- * Contructs a read-only Mapping instance.
+ * <p> Contructs a read-only Mapping instance. </p>
*
* @param pattern The compiled pattern
* @param config The original ActionConfig
@@ -284,7 +284,7 @@
}
/**
- * Gets the compiled wildcard pattern.
+ * <p> Gets the compiled wildcard pattern. </p>
*
* @return The compiled pattern
*/
@@ -293,7 +293,7 @@
}
/**
- * Gets the ActionConfig that contains the pattern.
+ * <p> Gets the ActionConfig that contains the pattern. </p>
*
* @return The associated ActionConfig
*/
Modified: struts/action/trunk/src/java/org/apache/struts/config/BaseConfig.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/config/BaseConfig.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/config/BaseConfig.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/config/BaseConfig.java Thu Feb 9 06:11:07 2006
@@ -18,12 +18,13 @@
package org.apache.struts.config;
import java.io.Serializable;
+
import java.util.Enumeration;
import java.util.Properties;
/**
- * A abstract base class for all config classes. Provide basic support for
- * arbitrary properties
+ * <p> A abstract base class for all config classes. Provide basic support
+ * for arbitrary properties </p>
*
* @since Struts 1.3
*/
@@ -60,12 +61,12 @@
}
/**
- * Set an arbitary key/value pair which can be retrieved by this config
- * class. This facility should eliminate many use cases for subclassing
- * <code>*Config</code> classes by providing a mechanism to pass any
- * amount of arbitrary configuration information into an config class. <p
- * /> This method must not be called after configuration is complete, or
- * an <code>IllegalStateException</code> will be thrown.</p>
+ * <p> Set an arbitary key/value pair which can be retrieved by this
+ * config class. This facility should eliminate many use cases for
+ * subclassing <code>*Config</code> classes by providing a mechanism to
+ * pass any amount of arbitrary configuration information into an config
+ * class. <p /> This method must not be called after configuration is
+ * complete, or an <code>IllegalStateException</code> will be thrown.</p>
*
* <p><b>Example</b>
* <code><pre>
@@ -99,11 +100,11 @@
}
/**
- * Return the entire set of properties configured for this object. At this
- * time, this only needs to be exposed to support inheritance, so choosing
- * a conservative access modifier ("protected").
+ * <p> Return the entire set of properties configured for this object. At
+ * this time, this only needs to be exposed to support inheritance, so
+ * choosing a conservative access modifier ("protected"). </p>
*
- * @return
+ * @return set of properties configured for this object
*/
protected Properties getProperties() {
return this.properties;
Modified: struts/action/trunk/src/java/org/apache/struts/config/ConfigHelper.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/config/ConfigHelper.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/config/ConfigHelper.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/config/ConfigHelper.java Thu Feb 9 06:11:07 2006
@@ -33,25 +33,18 @@
import javax.servlet.http.HttpSession;
/**
- * NOTE: THIS CLASS IS UNDER ACTIVE DEVELOPMENT. THE CURRENT CODE IS WRITTEN
- * FOR CLARITY NOT EFFICIENCY. NOT EVERY API FUNCTION HAS BEEN IMPLEMENTED
- * YET.
- *
- * A helper object to expose the Struts shared resources, which are be stored
- * in the application, session, or request contexts, as appropriate.
- *
- * An instance should be created for each request processed. The methods
- * which return resources from the request or session contexts are not
- * thread-safe.
- *
- * Provided for use by other servlets in the application so they can easily
- * access the Struts shared resources.
- *
- * The resources are stored under attributes in the application, session, or
- * request contexts.
- *
- * The ActionConfig methods simply return the resources from under the context
- * and key used by the Struts ActionServlet when the resources are created.
+ * <p> NOTE: THIS CLASS IS UNDER ACTIVE DEVELOPMENT. THE CURRENT CODE IS
+ * WRITTEN FOR CLARITY NOT EFFICIENCY. NOT EVERY API FUNCTION HAS BEEN
+ * IMPLEMENTED YET. </p><p> A helper object to expose the Struts shared
+ * resources, which are be stored in the application, session, or request
+ * contexts, as appropriate. </p><p> An instance should be created for each
+ * request processed. The methods which return resources from the request or
+ * session contexts are not thread-safe. </p><p> Provided for use by other
+ * servlets in the application so they can easily access the Struts shared
+ * resources. </p><p> The resources are stored under attributes in the
+ * application, session, or request contexts. </p><p> The ActionConfig methods
+ * simply return the resources from under the context and key used by the
+ * Struts ActionServlet when the resources are created. </p>
*
* @version $Rev$ $Date: 2005-05-14 02:09:06 -0400 (Sat, 14 May 2005)
* $
@@ -61,27 +54,27 @@
// -------------------------------------------------------- Properites
/**
- * The application associated with this instance.
+ * <p> The application associated with this instance. </p>
*/
private ServletContext application = null;
/**
- * The session associated with this instance.
+ * <p> The session associated with this instance. </p>
*/
private HttpSession session = null;
/**
- * The request associated with this instance.
+ * <p> The request associated with this instance. </p>
*/
private HttpServletRequest request = null;
/**
- * The response associated with this instance.
+ * <p> The response associated with this instance. </p>
*/
private HttpServletResponse response = null;
/**
- * The forward associated with this instance.
+ * <p> The forward associated with this instance. </p>
*/
private ActionForward forward = null;
@@ -89,31 +82,30 @@
super();
}
- public ConfigHelper(ServletContext application,
- HttpServletRequest request,
- HttpServletResponse response) {
+ public ConfigHelper(ServletContext application, HttpServletRequest request,
+ HttpServletResponse response) {
super();
this.setResources(application, request, response);
}
/**
- * Set the application associated with this instance.
- * [servlet.getServletContext()]
+ * <p> Set the application associated with this instance.
+ * [servlet.getServletContext()] </p>
*/
public void setApplication(ServletContext application) {
this.application = application;
}
/**
- * Set the session associated with this instance.
+ * <p> Set the session associated with this instance. </p>
*/
public void setSession(HttpSession session) {
this.session = session;
}
/**
- * Set the request associated with this object. Session object is also set
- * or cleared.
+ * <p> Set the request associated with this object. Session object is also
+ * set or cleared. </p>
*/
public void setRequest(HttpServletRequest request) {
this.request = request;
@@ -126,8 +118,8 @@
}
/**
- * Set the response associated with this isntance. Session object is also
- * set or cleared.
+ * <p> Set the response associated with this isntance. Session object is
+ * also set or cleared. </p>
*/
public void setResponse(HttpServletResponse response) {
this.response = response;
@@ -141,20 +133,19 @@
}
/**
- * Set the application and request for this object instance. The
+ * <p> Set the application and request for this object instance. The
* ServletContext can be set by any servlet in the application. The
* request should be the instant request. Most of the other methods
* retrieve their own objects by reference to the application, request, or
* session attributes. Do not call other methods without setting these
- * first! This is also called by the convenience constructor.
+ * first! This is also called by the convenience constructor. </p>
*
* @param application - The associated ServletContext.
* @param request - The associated HTTP request.
* @param response - The associated HTTP response.
*/
public void setResources(ServletContext application,
- HttpServletRequest request,
- HttpServletResponse response) {
+ HttpServletRequest request, HttpServletResponse response) {
setApplication(application);
setRequest(request);
setResponse(response);
@@ -166,26 +157,24 @@
return null;
}
- return (ActionMessages) this.application
- .getAttribute(Globals.MESSAGE_KEY);
+ return (ActionMessages) this.application.getAttribute(Globals.MESSAGE_KEY);
}
/**
- * The application resources for this application.
+ * <p> The application resources for this application. </p>
*/
public MessageResources getMessageResources() {
if (this.application == null) {
return null;
}
- return (MessageResources) this.application
- .getAttribute(Globals.MESSAGES_KEY);
+ return (MessageResources) this.application.getAttribute(Globals.MESSAGES_KEY);
}
/**
- * The path-mapped pattern (<code>/action/*</code>) or extension mapped
- * pattern ((<code>*.do</code>) used to determine our Action URIs in this
- * application.
+ * <p> The path-mapped pattern (<code>/action/*</code>) or extension
+ * mapped pattern ((<code>*.do</code>) used to determine our Action URIs
+ * in this application. </p>
*/
public String getServletMapping() {
if (this.application == null) {
@@ -198,7 +187,7 @@
// ---------------------------------------------------- Session Context
/**
- * The transaction token stored in this session, if it is used.
+ * <p> The transaction token stored in this session, if it is used. </p>
*/
public String getToken() {
if (this.session == null) {
@@ -211,9 +200,9 @@
// ---------------------------------------------------- Request Context
/**
- * The runtime JspException that may be been thrown by a Struts tag
+ * <p> The runtime JspException that may be been thrown by a Struts tag
* extension, or compatible presentation extension, and placed in the
- * request.
+ * request. </p>
*/
public Throwable getException() {
if (this.request == null) {
@@ -224,20 +213,19 @@
}
/**
- * The multipart object for this request.
+ * <p> The multipart object for this request. </p>
*/
public MultipartRequestWrapper getMultipartRequestWrapper() {
if (this.request == null) {
return null;
}
- return (MultipartRequestWrapper) this.request
- .getAttribute(Globals.MULTIPART_KEY);
+ return (MultipartRequestWrapper) this.request.getAttribute(Globals.MULTIPART_KEY);
}
/**
- * The <code>org.apache.struts.ActionMapping</code> instance for this
- * request.
+ * <p> The <code>org.apache.struts.ActionMapping</code> instance for this
+ * request. </p>
*/
public ActionMapping getMapping() {
if (this.request == null) {
@@ -250,8 +238,8 @@
// ---------------------------------------------------- Utility Methods
/**
- * Return true if a message string for the specified message key is
- * present for the user's Locale.
+ * <p> Return true if a message string for the specified message key is
+ * present for the user's Locale. </p>
*
* @param key Message key
*/
@@ -265,14 +253,15 @@
// Return the requested message presence indicator
return resources.isPresent(RequestUtils.getUserLocale(request, null),
- key);
+ key);
}
/*
+ * <p>
* Retrieve and return the <code>ActionForm</code> bean associated with
* this mapping, creating and stashing one if necessary. If there is no
* form bean associated with this mapping, return <code>null</code>.
- *
+ * </p>
*/
public ActionForm getActionForm() {
// Is there a mapping associated with this request?
@@ -290,7 +279,7 @@
}
// Look up the existing form bean, if any
- ActionForm instance = null;
+ ActionForm instance;
if ("request".equals(mapping.getScope())) {
instance = (ActionForm) this.request.getAttribute(attribute);
@@ -302,8 +291,8 @@
}
/**
- * Return the form bean definition associated with the specified logical
- * name, if any; otherwise return <code>null</code>.
+ * <p> Return the form bean definition associated with the specified
+ * logical name, if any; otherwise return <code>null</code>. </p>
*
* @param name Logical name of the requested form bean definition
*/
@@ -312,8 +301,8 @@
}
/**
- * Return the forwarding associated with the specified logical name, if
- * any; otherwise return <code>null</code>.
+ * <p> Return the forwarding associated with the specified logical name,
+ * if any; otherwise return <code>null</code>. </p>
*
* @param name Logical name of the requested forwarding
*/
@@ -322,8 +311,8 @@
}
/**
- * Return the mapping associated with the specified request path, if any;
- * otherwise return <code>null</code>.
+ * <p> Return the mapping associated with the specified request path, if
+ * any; otherwise return <code>null</code>. </p>
*
* @param path Request path for which a mapping is requested
*/
@@ -332,12 +321,19 @@
}
/**
- * Return the form action converted into an action mapping path. The
+ * <p> Return the form action converted into an action mapping path. The
* value of the <code>action</code> property is manipulated as follows in
- * computing the name of the requested mapping: <ul> <li>Any filename
- * extension is removed (on the theory that extension mapping is being
- * used to select the controller servlet).</li> <li>If the resulting value
- * does not start with a slash, then a slash is prepended.</li> </ul>
+ * computing the name of the requested mapping:</p>
+ *
+ * <ul>
+ *
+ * <li>Any filename extension is removed (on the theory that extension
+ * mapping is being used to select the controller servlet).</li>
+ *
+ * <li>If the resulting value does not start with a slash, then a slash is
+ * prepended.</li>
+ *
+ * </ul>
*/
public String getActionMappingName(String action) {
String value = action;
@@ -362,7 +358,7 @@
}
/**
- * Return the form action converted into a server-relative URL.
+ * <p> Return the form action converted into a server-relative URL. </p>
*/
public String getActionMappingURL(String action) {
StringBuffer value = new StringBuffer(this.request.getContextPath());
@@ -393,7 +389,6 @@
value.append(queryString);
}
}
-
// Otherwise, assume extension mapping is in use and extension is
// already included in the action property
else {
@@ -409,7 +404,7 @@
}
/**
- * Return the url encoded to maintain the user session, if any.
+ * <p> Return the url encoded to maintain the user session, if any. </p>
*/
public String getEncodeURL(String url) {
if ((session != null) && (response != null)) {
@@ -432,7 +427,7 @@
// ------------------------------------------------ Presentation API
/**
- * Renders the reference for a HTML <base> element
+ * <p> Renders the reference for a HTML <base> element </p>
*/
public String getOrigRef() {
// HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
@@ -441,22 +436,21 @@
}
StringBuffer result =
- RequestUtils.requestToServerUriStringBuffer(request);
+ RequestUtils.requestToServerUriStringBuffer(request);
return result.toString();
}
/**
- * Renders the reference for a HTML <base> element.
+ * <p> Renders the reference for a HTML <base> element. </p>
*/
public String getBaseRef() {
if (request == null) {
return null;
}
- StringBuffer result =
- RequestUtils.requestToServerStringBuffer(request);
- String path = null;
+ StringBuffer result = RequestUtils.requestToServerStringBuffer(request);
+ String path;
if (forward == null) {
path = request.getRequestURI();
@@ -470,8 +464,8 @@
}
/**
- * Return the path for the specified forward, otherwise return
- * <code>null</code>.
+ * <p> Return the path for the specified forward, otherwise return
+ * <code>null</code>. </p>
*
* @param name Name given to local or global forward.
*/
@@ -491,8 +485,8 @@
}
/**
- * Return the localized message for the specified key, otherwise return
- * <code>null</code>.
+ * <p> Return the localized message for the specified key, otherwise
+ * return <code>null</code>. </p>
*
* @param key Message key
*/
@@ -504,12 +498,12 @@
}
return resources.getMessage(RequestUtils.getUserLocale(request, null),
- key);
+ key);
}
/**
- * Look up and return a message string, based on the specified
- * parameters.
+ * <p> Look up and return a message string, based on the specified
+ * parameters. </p>
*
* @param key Message key to be looked up and returned
* @param args Replacement parameters for this message
@@ -523,19 +517,17 @@
// Return the requested message
if (args == null) {
- return resources
- .getMessage(RequestUtils.getUserLocale(request, null),
- key);
+ return resources.getMessage(RequestUtils.getUserLocale(request, null),
+ key);
} else {
- return resources
- .getMessage(RequestUtils.getUserLocale(request, null),
- key, args);
+ return resources.getMessage(RequestUtils.getUserLocale(request, null),
+ key, args);
}
}
/**
- * Return the URL for the specified ActionMapping, otherwise return
- * <code>null</code>.
+ * <p> Return the URL for the specified ActionMapping, otherwise return
+ * <code>null</code>. </p>
*
* @param path Name given to local or global forward.
*/
@@ -546,7 +538,7 @@
// --------------------------------------------- Presentation Wrappers
/**
- * Wrapper for getLink(String)
+ * <p> Wrapper for getLink(String) </p>
*
* @param name Name given to local or global forward.
*/
@@ -555,7 +547,7 @@
}
/**
- * Wrapper for getMessage(String)
+ * <p> Wrapper for getMessage(String) </p>
*
* @param key Message key
*/
@@ -564,7 +556,7 @@
}
/**
- * Wrapper for getMessage(String,Object[])
+ * <p> Wrapper for getMessage(String,Object[]) </p>
*
* @param key Message key to be looked up and returned
* @param args Replacement parameters for this message
@@ -574,7 +566,7 @@
}
/**
- * Wrapper for getAction(String)
+ * <p> Wrapper for getAction(String) </p>
*
* @param path Name given to local or global forward.
*/
Modified: struts/action/trunk/src/java/org/apache/struts/config/ConfigHelperInterface.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/config/ConfigHelperInterface.java?rev=376300&r1=376299&r2=376300&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/config/ConfigHelperInterface.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/config/ConfigHelperInterface.java Thu Feb 9 06:11:07 2006
@@ -26,25 +26,27 @@
import org.apache.struts.util.MessageResources;
/**
+ * <p>
* NOTE: THIS CLASS IS UNDER ACTIVE DEVELOPMENT. THE CURRENT CODE IS WRITTEN
* FOR CLARITY NOT EFFICIENCY. NOT EVERY API FUNCTION HAS BEEN IMPLEMENTED
* YET.
- *
+ * </p><p>
* A helper object to expose the Struts shared resources, which are be stored
* in the application, session, or request contexts, as appropriate.
- *
+ * </p><p>
* An instance should be created for each request processed. The methods
* which return resources from the request or session contexts are not
* thread-safe.
- *
+ * </p><p>
* Provided for use by other servlets in the application so they can easily
* access the Struts shared resources.
- *
+ * </p><p>
* The resources are stored under attributes in the application, session, or
* request contexts.
- *
+ * </p><p>
* The ActionConfig methods simply return the resources from under the context
* and key used by the Struts ActionServlet when the resources are created.
+ * </p>
*
* @version $Rev$ $Date: 2005-05-07 12:11:38 -0400 (Sat, 07 May 2005)
* $
@@ -54,144 +56,192 @@
// ------------------------------------------------ Application Context
/**
+ * <p>
* The <code>org.apache.struts.action.ActionFormBeans</code> collection
* for this application.
+ * </p>
*/
public ActionMessages getActionMessages();
/**
+ * <p>
* The application resources for this application.
+ * </p>
*/
public MessageResources getMessageResources();
/**
+ * <p>
* The path-mapped pattern (<code>/action/*</code>) or extension mapped
* pattern ((<code>*.do</code>) used to determine our Action URIs in this
* application.
+ * </p>
*/
public String getServletMapping();
// ---------------------------------------------------- Session Context
/**
+ * <p>
* The transaction token stored in this session, if it is used.
+ * </p>
*/
public String getToken();
// ---------------------------------------------------- Request Context
/**
+ * <p>
* The runtime JspException that may be been thrown by a Struts tag
* extension, or compatible presentation extension, and placed in the
* request.
+ * </p>
*/
public Throwable getException();
/**
+ * <p>
* The multipart object for this request.
+ * </p>
*/
public MultipartRequestWrapper getMultipartRequestWrapper();
/**
+ * <p>
* The <code>org.apache.struts.ActionMapping</code> instance for this
* request.
+ * </p>
*/
public ActionMapping getMapping();
// ---------------------------------------------------- Utility Methods
/**
+ * <p>
* Return true if a message string for the specified message key is
* present for the user's Locale.
+ * </p>
*
* @param key Message key
*/
public boolean isMessage(String key);
- /*
+ /**
+ * <p>
* Retrieve and return the <code>ActionForm</code> bean associated with
* this mapping, creating and stashing one if necessary. If there is no
* form bean associated with this mapping, return <code>null</code>.
- *
+ * </p>
*/
public ActionForm getActionForm();
/**
+ * <p>
* Return the form bean definition associated with the specified logical
* name, if any; otherwise return <code>null</code>.
+ * </p>
*
* @param name Logical name of the requested form bean definition
*/
public ActionFormBean getFormBean(String name);
/**
+ * <p>
* Return the forwarding associated with the specified logical name, if
* any; otherwise return <code>null</code>.
+ * </p>
*
* @param name Logical name of the requested forwarding
*/
public ActionForward getActionForward(String name);
/**
+ * <p>
* Return the mapping associated with the specified request path, if any;
* otherwise return <code>null</code>.
+ * </p>
*
* @param path Request path for which a mapping is requested
*/
public ActionMapping getActionMapping(String path);
/**
+ * <p>
* Return the form action converted into an action mapping path. The
* value of the <code>action</code> property is manipulated as follows in
- * computing the name of the requested mapping: <ul> <li>Any filename
+ * computing the name of the requested mapping:
+ *
+ * <ul>
+ *
+ * <li>Any filename
* extension is removed (on the theory that extension mapping is being
- * used to select the controller servlet).</li> <li>If the resulting value
- * does not start with a slash, then a slash is prepended.</li> </ul>
+ * used to select the controller servlet).</li>
+ *
+ * <li>If the resulting value
+ * does not start with a slash, then a slash is prepended.</li>
+ *
+ * </ul>
+ * <p>
* :FIXME: Bad assumption =:o)
+ * </p>
*/
public String getActionMappingName(String action);
/**
+ * <p>
* Return the form action converted into a server-relative URL.
+ * </p>
*/
public String getActionMappingURL(String action);
/**
+ * <p>
* Return the url encoded to maintain the user session, if any.
+ * </p>
*/
public String getEncodeURL(String url);
// ------------------------------------------------ Presentation API
/**
+ * <p>
* Renders the reference for a HTML <base> element
+ * </p>
*/
public String getOrigRef();
/**
+ * <p>
* Renders the reference for a HTML <base> element
+ * </p>
*/
public String getBaseRef();
/**
+ * <p>
* Return the path for the specified forward, otherwise return
* <code>null</code>.
+ * </p>
*
* @param name Name given to local or global forward.
*/
public String getLink(String name);
/**
+ * <p>
* Return the localized message for the specified key, otherwise return
* <code>null</code>.
+ * </p>
*
* @param key Message key
*/
public String getMessage(String key);
/**
+ * <p>
* Look up and return a message string, based on the specified
* parameters.
+ * </p>
*
* @param key Message key to be looked up and returned
* @param args Replacement parameters for this message
@@ -199,8 +249,10 @@
public String getMessage(String key, Object[] args);
/**
+ * <p>
* Return the URL for the specified ActionMapping, otherwise return
* <code>null</code>.
+ * </p>
*
* @param path Name given to local or global forward.
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org