craigmcc 2002/07/23 22:28:05
Modified: conf/share struts-config_1_1.dtd
src/share/org/apache/struts/action ActionServlet.java
src/share/org/apache/struts/config DataSourceConfig.java
MessageResourcesConfig.java
Log:
Remove the dependence in our configuration beans on default values that are
established in the DTD, which were requiring us to do a validating parse.
Re-enable the "validating" init parameter, which defaults to performing a
validating parse but allows disabling it.
Revision Changes Path
1.27 +9 -9 jakarta-struts/conf/share/struts-config_1_1.dtd
Index: struts-config_1_1.dtd
===================================================================
RCS file: /home/cvs/jakarta-struts/conf/share/struts-config_1_1.dtd,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- struts-config_1_1.dtd 10 Jul 2002 20:36:23 -0000 1.26
+++ struts-config_1_1.dtd 24 Jul 2002 05:28:04 -0000 1.27
@@ -111,10 +111,10 @@
key Servlet context attribute key under which this data source
will be stored. Default is the value specified by string
- constant defined by Action.DATA_SOURCE_KEY. The application
+ constant defined by Globals.DATA_SOURCE_KEY. The application
module prefix (if any) is appended to the key
(${key}$prefix}).
- [org.apache.struts.Action.DATA_SOURCE_KEY]
+ [org.apache.struts.Globals.DATA_SOURCE_KEY]
NOTE: The application module prefix includes the leading
slash, so the default datasource for a module named "foo" is
@@ -128,7 +128,7 @@
<!ELEMENT data-source (set-property*)>
<!ATTLIST data-source id ID #IMPLIED>
<!ATTLIST data-source className %ClassName; #IMPLIED>
-<!ATTLIST data-source key %AttributeName;
"org.apache.struts.action.DATA_SOURCE">
+<!ATTLIST data-source key %AttributeName; #IMPLIED>
<!ATTLIST data-source type %ClassName; #IMPLIED>
@@ -148,8 +148,8 @@
bundle Servlet context attribute for the message resources bundle
associated with this handler. The default attribute is the
value specified by the string constant declared at
- Action.MESSAGES_KEY.
- [org.apache.struts.Action.MESSAGES_KEY]
+ Globals.MESSAGES_KEY.
+ [org.apache.struts.Globals.MESSAGES_KEY]
className The configuration bean for this ExceptionHandler object.
If specified, className must be a subclass of the default
@@ -575,9 +575,9 @@
key Servlet context attribute under which this message
resources bundle will be stored. The default attribute is
the value specified by the string constant at
- [Action.MESSAGES_KEY]. The application module prefix (if
+ [Globals.MESSAGES_KEY]. The application module prefix (if
any) is appended to the key (${key}${prefix}).
- [org.apache.struts.Action.MESSAGES_KEY]
+ [org.apache.struts.Globals.MESSAGES_KEY]
NOTE: The application module prefix includes the leading
slash, so the default message resource bundle for a module
@@ -595,7 +595,7 @@
<!ATTLIST message-resources id ID #IMPLIED>
<!ATTLIST message-resources className %ClassName; #IMPLIED>
<!ATTLIST message-resources factory %ClassName; #IMPLIED>
-<!ATTLIST message-resources key %AttributeName;
"org.apache.struts.action.MESSAGE">
+<!ATTLIST message-resources key %AttributeName; #IMPLIED>
<!ATTLIST message-resources null %Boolean; #IMPLIED>
<!ATTLIST message-resources parameter CDATA #REQUIRED>
1.118 +17 -5
jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java
Index: ActionServlet.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -r1.117 -r1.118
--- ActionServlet.java 24 Jul 2002 00:47:23 -0000 1.117
+++ ActionServlet.java 24 Jul 2002 05:28:04 -0000 1.118
@@ -1067,11 +1067,23 @@
return (configDigester);
}
+ // Check the status of the "validating" initialization parameter
+ boolean validating = true;
+ String value = getServletConfig().getInitParameter("validating");
+ if (value != null) {
+ if ("false".equalsIgnoreCase(value) ||
+ "no".equalsIgnoreCase(value) ||
+ "n".equalsIgnoreCase(value) ||
+ "0".equalsIgnoreCase(value)) {
+ validating = false;
+ }
+ }
+
// Create a new Digester instance with standard capabilities
configDigester = new Digester();
configDigester.setDebug(detail);
configDigester.setNamespaceAware(true);
- configDigester.setValidating(true);
+ configDigester.setValidating(validating);
configDigester.setUseContextClassLoader(true);
configDigester.addRuleSet(new ConfigRuleSet());
for (int i = 0; i < registrations.length; i += 2) {
1.7 +6 -5
jakarta-struts/src/share/org/apache/struts/config/DataSourceConfig.java
Index: DataSourceConfig.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/config/DataSourceConfig.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DataSourceConfig.java 9 Jul 2002 23:57:37 -0000 1.6
+++ DataSourceConfig.java 24 Jul 2002 05:28:05 -0000 1.7
@@ -67,6 +67,7 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import org.apache.struts.Globals;
/**
@@ -103,7 +104,7 @@
* The servlet context attribute key under which this data source
* is stored and made available.
*/
- protected String key = null;
+ protected String key = Globals.DATA_SOURCE_KEY;
public String getKey() {
return (this.key);
1.7 +6 -5
jakarta-struts/src/share/org/apache/struts/config/MessageResourcesConfig.java
Index: MessageResourcesConfig.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/config/MessageResourcesConfig.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- MessageResourcesConfig.java 9 Jul 2002 23:57:37 -0000 1.6
+++ MessageResourcesConfig.java 24 Jul 2002 05:28:05 -0000 1.7
@@ -64,6 +64,7 @@
import java.io.Serializable;
+import org.apache.struts.Globals;
/**
@@ -114,7 +115,7 @@
* The servlet context attributes key under which this MessageResources
* instance is stored.
*/
- protected String key = null;
+ protected String key = Globals.MESSAGES_KEY;
public String getKey() {
return (this.key);
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>