dgraham 2003/03/10 19:09:00
Modified: src/share/org/apache/struts/util RequestUtils.java
Log:
Removed redundant code for getModuleConfig methods, moved the methods
next to each other for readability.
Revision Changes Path
1.93 +16 -20
jakarta-struts/src/share/org/apache/struts/util/RequestUtils.java
Index: RequestUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/util/RequestUtils.java,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- RequestUtils.java 11 Mar 2003 02:04:19 -0000 1.92
+++ RequestUtils.java 11 Mar 2003 03:08:59 -0000 1.93
@@ -1741,22 +1741,6 @@
}
/**
- * Return the ModuleConfig object if it exists, null if otherwise.
- * @param pageContext The page context.
- * @return the ModuleConfig object
- * @since 1.1
- */
- public static ModuleConfig getModuleConfig(PageContext pageContext) {
- ModuleConfig moduleConfig =
- (ModuleConfig)
pageContext.getRequest().getAttribute(Globals.MODULE_KEY);
- if (moduleConfig == null) { // Backwards compatibility hack
- moduleConfig =
- (ModuleConfig)
pageContext.getServletContext().getAttribute(Globals.MODULE_KEY);
- }
- return moduleConfig;
- }
-
- /**
* Return the current ModuleConfig object stored in request, if it exists,
* null otherwise.
* This method can be used by plugin to retrieve the current module config
@@ -1789,6 +1773,18 @@
moduleConfig = (ModuleConfig) context.getAttribute(Globals.MODULE_KEY);
}
return moduleConfig;
+ }
+
+ /**
+ * Return the ModuleConfig object if it exists, null if otherwise.
+ * @param pageContext The page context.
+ * @return the ModuleConfig object
+ * @since 1.1
+ */
+ public static ModuleConfig getModuleConfig(PageContext pageContext) {
+ return getModuleConfig(
+ (HttpServletRequest) pageContext.getRequest(),
+ pageContext.getServletContext());
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]