dgraham 2003/07/25 18:22:31
Modified: src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java FormTag.java
src/share/org/apache/struts/taglib/bean StrutsTag.java
src/share/org/apache/struts/taglib/logic ForwardTag.java
src/share/org/apache/struts/util RequestUtils.java
src/share/org/apache/struts/taglib TagUtils.java
Log:
Moved getModuleConfig() to TagUtils.
Revision Changes Path
1.34 +5 -5
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
Index: JavascriptValidatorTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- JavascriptValidatorTag.java 26 Jul 2003 01:17:55 -0000 1.33
+++ JavascriptValidatorTag.java 26 Jul 2003 01:22:30 -0000 1.34
@@ -361,7 +361,7 @@
protected String renderJavascript() {
StringBuffer results = new StringBuffer();
- ModuleConfig config = RequestUtils.getModuleConfig(pageContext);
+ ModuleConfig config = TagUtils.getInstance().getModuleConfig(pageContext);
ValidatorResources resources =
(ValidatorResources) pageContext.getAttribute(
ValidatorPlugIn.VALIDATOR_KEY + config.getPrefix(),
1.51 +6 -5
jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java
Index: FormTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- FormTag.java 8 Jul 2003 00:05:10 -0000 1.50
+++ FormTag.java 26 Jul 2003 01:22:30 -0000 1.51
@@ -77,6 +77,7 @@
import org.apache.struts.action.ActionServlet;
import org.apache.struts.config.FormBeanConfig;
import org.apache.struts.config.ModuleConfig;
+import org.apache.struts.taglib.TagUtils;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.RequestUtils;
import org.apache.struts.util.ResponseUtils;
@@ -799,7 +800,7 @@
protected void lookup() throws JspException {
// Look up the module configuration information we need
- moduleConfig = RequestUtils.getModuleConfig(pageContext);
+ moduleConfig = TagUtils.getInstance().getModuleConfig(pageContext);
if (moduleConfig == null) {
JspException e = new
JspException(messages.getMessage("formTag.collections"));
1.14 +7 -5
jakarta-struts/src/share/org/apache/struts/taglib/bean/StrutsTag.java
Index: StrutsTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/StrutsTag.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- StrutsTag.java 9 Nov 2002 16:30:02 -0000 1.13
+++ StrutsTag.java 26 Jul 2003 01:22:31 -0000 1.14
@@ -65,7 +65,9 @@
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
+
import org.apache.struts.config.ModuleConfig;
+import org.apache.struts.taglib.TagUtils;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.RequestUtils;
@@ -176,7 +178,7 @@
}
// Retrieve our application module configuration information
- ModuleConfig config = RequestUtils.getModuleConfig(pageContext);
+ ModuleConfig config = TagUtils.getInstance().getModuleConfig(pageContext);
// Retrieve the requested object to be exposed
Object object = null;
1.17 +6 -5
jakarta-struts/src/share/org/apache/struts/taglib/logic/ForwardTag.java
Index: ForwardTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/ForwardTag.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ForwardTag.java 13 Jul 2003 23:37:30 -0000 1.16
+++ ForwardTag.java 26 Jul 2003 01:22:31 -0000 1.17
@@ -68,6 +68,7 @@
import org.apache.struts.action.ActionForward;
import org.apache.struts.config.ModuleConfig;
+import org.apache.struts.taglib.TagUtils;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.RequestUtils;
@@ -126,7 +127,7 @@
// Look up the desired ActionForward entry
ActionForward forward = null;
- ModuleConfig config = RequestUtils.getModuleConfig(pageContext);
+ ModuleConfig config = TagUtils.getInstance().getModuleConfig(pageContext);
if (config != null){
forward = (ActionForward) config.findForwardConfig(name);
1.118 +6 -4
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.117
retrieving revision 1.118
diff -u -r1.117 -r1.118
--- RequestUtils.java 26 Jul 2003 01:17:55 -0000 1.117
+++ RequestUtils.java 26 Jul 2003 01:22:31 -0000 1.118
@@ -1821,6 +1821,8 @@
* @param pageContext The page context.
* @return the ModuleConfig object
* @since Struts 1.1
+ * @deprecated Use TagUtils.getModuleConfig() instead. This will be removed
+ * after Struts 1.2.
*/
public static ModuleConfig getModuleConfig(PageContext pageContext) {
return getModuleConfig(
1.5 +20 -8 jakarta-struts/src/share/org/apache/struts/taglib/TagUtils.java
Index: TagUtils.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/TagUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TagUtils.java 26 Jul 2003 01:17:55 -0000 1.4
+++ TagUtils.java 26 Jul 2003 01:22:31 -0000 1.5
@@ -73,6 +73,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
+import org.apache.struts.config.ModuleConfig;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.RequestUtils;
@@ -104,13 +105,13 @@
*/
private static final MessageResources messages =
MessageResources.getMessageResources("org.apache.struts.util.LocalStrings");
-
+
/**
* Maps lowercase JSP scope names to their PageContext integer constant
* values.
*/
private static final Map scopes = new HashMap();
-
+
/**
* Initialize the scope names map.
*/
@@ -184,7 +185,18 @@
return errors;
}
-
+
+ /**
+ * Return the ModuleConfig object if it exists, null if otherwise.
+ * @param pageContext The page context.
+ * @return the ModuleConfig object
+ */
+ public ModuleConfig getModuleConfig(PageContext pageContext) {
+ return RequestUtils.getModuleConfig(
+ (HttpServletRequest) pageContext.getRequest(),
+ pageContext.getServletContext());
+ }
+
/**
* Converts the scope name into its corresponding PageContext constant value.
* @param scopeName Can be "page", "request", "session", or "application" in any
@@ -201,7 +213,7 @@
return scope.intValue();
}
-
+
/**
* Look up and return current user locale, based on the specified parameters.
*
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]