Commits

Anonymous committed 10d2a1b

Changes to fix final problems with XW-122

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@157e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (2)

src/etc/xwork-1.0.dtd

 <!ELEMENT external-ref (#PCDATA)>
 <!ATTLIST external-ref
     name NMTOKEN #REQUIRED
-    required (true|false) "false"
+    required (true|false) "true"
 >
 
 <!ELEMENT global-results (result+)>

src/java/com/opensymphony/xwork/config/providers/XmlConfigurationProvider.java

         }
 
         List interceptorList = buildInterceptorList(actionElement, packageContext);
-        
+
 		List externalrefs = buildExternalRefs(actionElement, packageContext);
-		
+
         ActionConfig actionConfig = new ActionConfig(methodName, clazz, actionParams, results, interceptorList, externalrefs, packageContext.getName());
         packageContext.addActionConfig(name, actionConfig);
 
 
         return interceptorList;
     }
-    
+
 	protected List buildExternalRefs(Element element, PackageConfig context) throws ConfigurationException {
 		List refs = new ArrayList();
 		NodeList externalRefList = element.getElementsByTagName("external-ref");
-		
+
 		String refName = null;
 		String refValue = null;
 		String requiredTemp = null;
 
 			if (refElement.getParentNode().equals(element)) {
 				refName = refElement.getAttribute("name");
-				
+
 				//If the external ref is not declared explicitly, we can introspect the
 				//reference type using it's name and try resolving the reference using it's class type
 				if(refElement.getChildNodes().getLength() > 0)
-				{    
+				{
 				    refValue = refElement.getChildNodes().item(0).getNodeValue();
 				}
 				requiredTemp = refElement.getAttribute("required");
-				if("".equals(requiredTemp)) {
+				if(requiredTemp == null || "".equals(requiredTemp)) {
 					required = true;
 				} else {
 					required = Boolean.valueOf(requiredTemp).booleanValue();
         boolean isAbstract = Boolean.valueOf(abstractVal).booleanValue();
         String name = TextUtils.noNull(packageElement.getAttribute("name"));
         String namespace = TextUtils.noNull(packageElement.getAttribute("namespace"));
-		
+
         //RM* Load the ExternalReferenceResolver if one has been set
 		ExternalReferenceResolver erResolver = null;
-		
+
         String externalReferenceResolver = TextUtils.noNull(packageElement.getAttribute("externalReferenceResolver"));
-		
+
 		if(!("".equals(externalReferenceResolver)))
-		{	
+		{
 	        try {
 				Class erResolverClazz = ClassLoaderUtil.loadClass(externalReferenceResolver, ExternalReferenceResolver.class);
-				
+
 			    erResolver = (ExternalReferenceResolver) erResolverClazz.newInstance();
-				
+
 	        } catch (ClassNotFoundException e) {
 	        	//TODO this should be localized
 	        	String msg = "Could not find External Reference Resolver: " + externalReferenceResolver + ". " + e.getMessage();
 				throw new ConfigurationException(msg, e);
 			}
 		}
-		
+
 		if (!TextUtils.stringSet(TextUtils.noNull(parent))) { // no parents
 
             return new PackageConfig(name, namespace, isAbstract, erResolver);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.