- Fix spelling.
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 19 Sep 2006 10:43:54 +0000 (10:43 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 19 Sep 2006 10:43:54 +0000 (10:43 +0000)
- Fix getVersion method.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@447804 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/compiler/Compiler.java
java/org/apache/jasper/compiler/JspConfig.java

index ddd816e..a8c4c6e 100644 (file)
@@ -129,9 +129,9 @@ public abstract class Compiler {
         if (jspProperty.getIncludeCoda() != null) {
             pageInfo.setIncludeCoda(jspProperty.getIncludeCoda());
         }
-        if (jspProperty.isDefferedSyntaxAllowedAsLitteral() != null) {
+        if (jspProperty.isDeferedSyntaxAllowedAsLitteral() != null) {
             pageInfo.setDeferredSyntaxAllowedAsLiteral(JspUtil.booleanValue(jspProperty
-                    .isDefferedSyntaxAllowedAsLitteral()));
+                    .isDeferedSyntaxAllowedAsLitteral()));
         }
         if (jspProperty.isTrimDirectiveWhitespaces() != null) {
             pageInfo.setTrimDirectiveWhitespaces(JspUtil.booleanValue(jspProperty
index 0696d81..aa41438 100644 (file)
@@ -52,7 +52,7 @@ public class JspConfig {
     private String defaultIsXml = null;                // unspecified
     private String defaultIsELIgnored = null;  // unspecified
     private String defaultIsScriptingInvalid = null;
-    private String defaultDefferedSyntaxAllowedAsLitteral = null;
+    private String defaultDeferedSyntaxAllowedAsLitteral = null;
     private String defaultTrimDirectiveWhitespaces = null;
     private JspProperty defaultJspProperty;
 
@@ -61,15 +61,14 @@ public class JspConfig {
     }
 
     private double getVersion(TreeNode webApp) {
-        if (webApp == null) {
-            String v = webApp.findAttribute("version");
-            if (v != null) {
-                try {
-                    return Double.parseDouble(v);
-                } catch (Exception e) {}
+        String v = webApp.findAttribute("version");
+        if (v != null) {
+            try {
+                return Double.parseDouble(v);
+            } catch (NumberFormatException e) {
             }
         }
-        return 2.4;
+        return 2.3;
     }
 
     private void processWebDotXml(ServletContext ctxt) throws JasperException {
@@ -114,7 +113,7 @@ public class JspConfig {
                 String isXml = null;
                 Vector includePrelude = new Vector();
                 Vector includeCoda = new Vector();
-                String defferedSyntaxAllowedAsLitteral = null;
+                String deferedSyntaxAllowedAsLitteral = null;
                 String trimDirectiveWhitespaces = null;
 
                 while (list.hasNext()) {
@@ -137,7 +136,7 @@ public class JspConfig {
                     else if ("include-coda".equals(tname))
                         includeCoda.addElement(element.getBody());
                     else if ("deferred-syntax-allowed-as-literal".equals(tname))
-                        defferedSyntaxAllowedAsLitteral = element.getBody();
+                        deferedSyntaxAllowedAsLitteral = element.getBody();
                     else if ("trim-directive-whitespaces".equals(tname))
                         trimDirectiveWhitespaces = element.getBody();
                 }
@@ -195,7 +194,7 @@ public class JspConfig {
                             pageEncoding,
                             includePrelude,
                             includeCoda,
-                            defferedSyntaxAllowedAsLitteral,
+                            deferedSyntaxAllowedAsLitteral,
                             trimDirectiveWhitespaces);
                     JspPropertyGroup propertyGroup =
                         new JspPropertyGroup(path, extension, property);
@@ -221,7 +220,7 @@ public class JspConfig {
             defaultJspProperty = new JspProperty(defaultIsXml,
                     defaultIsELIgnored,
                     defaultIsScriptingInvalid,
-                    null, null, null, defaultDefferedSyntaxAllowedAsLitteral, 
+                    null, null, null, defaultDeferedSyntaxAllowedAsLitteral, 
                     defaultTrimDirectiveWhitespaces);
             initialized = true;
         }
@@ -296,7 +295,7 @@ public class JspConfig {
         JspPropertyGroup elIgnoredMatch = null;
         JspPropertyGroup scriptingInvalidMatch = null;
         JspPropertyGroup pageEncodingMatch = null;
-        JspPropertyGroup defferedSyntaxAllowedAsLitteralMatch = null;
+        JspPropertyGroup deferedSyntaxAllowedAsLitteralMatch = null;
         JspPropertyGroup trimDirectiveWhitespacesMatch = null;
 
         Iterator iter = jspProperties.iterator();
@@ -352,9 +351,9 @@ public class JspConfig {
             if (jp.getPageEncoding() != null) {
                 pageEncodingMatch = selectProperty(pageEncodingMatch, jpg);
             }
-            if (jp.isDefferedSyntaxAllowedAsLitteral() != null) {
-                defferedSyntaxAllowedAsLitteralMatch =
-                    selectProperty(defferedSyntaxAllowedAsLitteralMatch, jpg);
+            if (jp.isDeferedSyntaxAllowedAsLitteral() != null) {
+                deferedSyntaxAllowedAsLitteralMatch =
+                    selectProperty(deferedSyntaxAllowedAsLitteralMatch, jpg);
             }
             if (jp.isTrimDirectiveWhitespaces() != null) {
                 trimDirectiveWhitespacesMatch =
@@ -367,7 +366,7 @@ public class JspConfig {
         String isELIgnored = defaultIsELIgnored;
         String isScriptingInvalid = defaultIsScriptingInvalid;
         String pageEncoding = null;
-        String isDefferedSyntaxAllowedAsLitteral = defaultDefferedSyntaxAllowedAsLitteral;
+        String isDeferedSyntaxAllowedAsLitteral = defaultDeferedSyntaxAllowedAsLitteral;
         String isTrimDirectiveWhitespaces = defaultTrimDirectiveWhitespaces;
 
         if (isXmlMatch != null) {
@@ -383,9 +382,9 @@ public class JspConfig {
         if (pageEncodingMatch != null) {
             pageEncoding = pageEncodingMatch.getJspProperty().getPageEncoding();
         }
-        if (defferedSyntaxAllowedAsLitteralMatch != null) {
-            isDefferedSyntaxAllowedAsLitteral =
-                defferedSyntaxAllowedAsLitteralMatch.getJspProperty().isDefferedSyntaxAllowedAsLitteral();
+        if (deferedSyntaxAllowedAsLitteralMatch != null) {
+            isDeferedSyntaxAllowedAsLitteral =
+                deferedSyntaxAllowedAsLitteralMatch.getJspProperty().isDeferedSyntaxAllowedAsLitteral();
         }
         if (trimDirectiveWhitespacesMatch != null) {
             isTrimDirectiveWhitespaces =
@@ -394,7 +393,7 @@ public class JspConfig {
 
         return new JspProperty(isXml, isELIgnored, isScriptingInvalid,
                 pageEncoding, includePreludes, includeCodas, 
-                isDefferedSyntaxAllowedAsLitteral, isTrimDirectiveWhitespaces);
+                isDeferedSyntaxAllowedAsLitteral, isTrimDirectiveWhitespaces);
     }
 
     /**
@@ -477,13 +476,13 @@ public class JspConfig {
         private String pageEncoding;
         private Vector includePrelude;
         private Vector includeCoda;
-        private String defferedSyntaxAllowedAsLitteral;
+        private String deferedSyntaxAllowedAsLitteral;
         private String trimDirectiveWhitespaces;
 
         public JspProperty(String isXml, String elIgnored,
                 String scriptingInvalid, String pageEncoding,
                 Vector includePrelude, Vector includeCoda,
-                String defferedSyntaxAllowedAsLitteral, 
+                String deferedSyntaxAllowedAsLitteral, 
                 String trimDirectiveWhitespaces) {
 
             this.isXml = isXml;
@@ -492,7 +491,7 @@ public class JspConfig {
             this.pageEncoding = pageEncoding;
             this.includePrelude = includePrelude;
             this.includeCoda = includeCoda;
-            this.defferedSyntaxAllowedAsLitteral = defferedSyntaxAllowedAsLitteral;
+            this.deferedSyntaxAllowedAsLitteral = deferedSyntaxAllowedAsLitteral;
             this.trimDirectiveWhitespaces = trimDirectiveWhitespaces;
         }
 
@@ -520,8 +519,8 @@ public class JspConfig {
             return includeCoda;
         }
         
-        public String isDefferedSyntaxAllowedAsLitteral() {
-            return defferedSyntaxAllowedAsLitteral;
+        public String isDeferedSyntaxAllowedAsLitteral() {
+            return deferedSyntaxAllowedAsLitteral;
         }
         
         public String isTrimDirectiveWhitespaces() {