Author: remm
Date: Wed Dec 12 22:29:52 2018
New Revision: 1848806

URL: http://svn.apache.org/viewvc?rev=1848806&view=rev
Log:
Add i18n for jasper and el packages

Modified:
    tomcat/trunk/java/javax/el/ExpressionFactory.java
    tomcat/trunk/java/javax/el/LocalStrings.properties
    tomcat/trunk/java/javax/servlet/LocalStrings.properties
    tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java
    tomcat/trunk/java/javax/servlet/ServletResponseWrapper.java
    tomcat/trunk/java/javax/servlet/http/HttpServlet.java
    tomcat/trunk/java/javax/servlet/http/LocalStrings.properties
    tomcat/trunk/java/org/apache/jasper/JspC.java
    tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
    tomcat/trunk/java/org/apache/jasper/compiler/JDTCompiler.java
    tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java
    tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java
    tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java
    tomcat/trunk/java/org/apache/jasper/compiler/SmapStratum.java
    tomcat/trunk/java/org/apache/jasper/compiler/SmapUtil.java
    tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties
    tomcat/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java
    tomcat/trunk/java/org/apache/jasper/runtime/InstanceManagerFactory.java
    tomcat/trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java
    tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
    tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java
    tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
    tomcat/trunk/java/org/apache/jasper/security/SecurityClassLoad.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java
    tomcat/trunk/java/org/apache/jasper/servlet/TldPreScanned.java
    tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java

Modified: tomcat/trunk/java/javax/el/ExpressionFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ExpressionFactory.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ExpressionFactory.java (original)
+++ tomcat/trunk/java/javax/el/ExpressionFactory.java Wed Dec 12 22:29:52 2018
@@ -149,9 +149,7 @@ public abstract class ExpressionFactory
                     writeLock.unlock();
                 }
             } catch (ClassNotFoundException e) {
-                throw new ELException(
-                    "Unable to find ExpressionFactory of type: " + className,
-                    e);
+                throw new ELException(Util.message(null, 
"expressionFactory.cannotFind", className), e);
             }
         }
 
@@ -178,13 +176,9 @@ public abstract class ExpressionFactory
         } catch (InvocationTargetException e) {
             Throwable cause = e.getCause();
             Util.handleThrowable(cause);
-            throw new ELException(
-                    "Unable to create ExpressionFactory of type: " + 
clazz.getName(),
-                    e);
+            throw new ELException(Util.message(null, 
"expressionFactory.cannotCreate", clazz.getName()), e);
         } catch (ReflectiveOperationException | IllegalArgumentException e) {
-            throw new ELException(
-                    "Unable to create ExpressionFactory of type: " + 
clazz.getName(),
-                    e);
+            throw new ELException(Util.message(null, 
"expressionFactory.cannotCreate", clazz.getName()), e);
         }
 
         return result;
@@ -397,8 +391,7 @@ public abstract class ExpressionFactory
                 // Should never happen with UTF-8
                 // If it does - ignore & return null
             } catch (IOException e) {
-                throw new ELException("Failed to read " + 
SERVICE_RESOURCE_NAME,
-                        e);
+                throw new ELException(Util.message(null, 
"expressionFactory.readFailed", SERVICE_RESOURCE_NAME), e);
             } finally {
                 try {
                     is.close();
@@ -422,7 +415,7 @@ public abstract class ExpressionFactory
             } catch (FileNotFoundException e) {
                 // Should not happen - ignore it if it does
             } catch (IOException e) {
-                throw new ELException("Failed to read " + PROPERTY_FILE, e);
+                throw new ELException(Util.message(null, 
"expressionFactory.readFailed", PROPERTY_FILE), e);
             }
         }
         return null;

Modified: tomcat/trunk/java/javax/el/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/LocalStrings.properties?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/LocalStrings.properties [UTF-8] (original)
+++ tomcat/trunk/java/javax/el/LocalStrings.properties [UTF-8] Wed Dec 12 
22:29:52 2018
@@ -22,6 +22,10 @@ elProcessor.defineFunctionInvalidParamet
 elProcessor.defineFunctionNoMethod=A public static method [{0}] on class [{1}] 
could not be found
 elProcessor.defineFunctionNullParams=One or more of the input parameters was 
null
 
+expressionFactory.cannotCreate=Unable to create ExpressionFactory of type [{0}]
+expressionFactory.cannotFind=Unable to find ExpressionFactory of type [{0}]
+expressionFactory.readFailed=Failed to read [{0}]
+
 importHandler.ambiguousImport=The class [{0}] could not be imported as it 
conflicts with [{1}] which has already been imported
 importHandler.ambiguousStaticImport=The static import [{0}] could not be 
processed as it conflicts with [{1}] which has already been imported
 importHandler.classNotFound=The class [{0}] could not be imported as it could 
not be found

Modified: tomcat/trunk/java/javax/servlet/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/LocalStrings.properties?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/LocalStrings.properties [UTF-8] (original)
+++ tomcat/trunk/java/javax/servlet/LocalStrings.properties [UTF-8] Wed Dec 12 
22:29:52 2018
@@ -19,5 +19,8 @@ httpConstraintElement.invalidRolesDeny=R
 
 httpMethodConstraintElement.invalidMethod=Invalid HTTP method
 
+wrapper.nullRequest=Request cannot be null
+wrapper.nullResponse=Response cannot be null
+
 value.false=false
 value.true=true

Modified: tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java Wed Dec 12 
22:29:52 2018
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
+import java.util.ResourceBundle;
 
 /**
  * Provides a convenient implementation of the ServletRequest interface that 
can
@@ -32,6 +33,10 @@ import java.util.Map;
  * @see javax.servlet.ServletRequest
  */
 public class ServletRequestWrapper implements ServletRequest {
+    private static final String LSTRING_FILE = "javax.servlet.LocalStrings";
+    private static final ResourceBundle lStrings =
+        ResourceBundle.getBundle(LSTRING_FILE);
+
     private ServletRequest request;
 
     /**
@@ -43,7 +48,7 @@ public class ServletRequestWrapper imple
      */
     public ServletRequestWrapper(ServletRequest request) {
         if (request == null) {
-            throw new IllegalArgumentException("Request cannot be null");
+            throw new 
IllegalArgumentException(lStrings.getString("wrapper.nullRequest"));
         }
         this.request = request;
     }
@@ -64,7 +69,7 @@ public class ServletRequestWrapper imple
      */
     public void setRequest(ServletRequest request) {
         if (request == null) {
-            throw new IllegalArgumentException("Request cannot be null");
+            throw new 
IllegalArgumentException(lStrings.getString("wrapper.nullRequest"));
         }
         this.request = request;
     }

Modified: tomcat/trunk/java/javax/servlet/ServletResponseWrapper.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletResponseWrapper.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletResponseWrapper.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletResponseWrapper.java Wed Dec 12 
22:29:52 2018
@@ -19,6 +19,7 @@ package javax.servlet;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.Locale;
+import java.util.ResourceBundle;
 
 /**
  * Provides a convenient implementation of the ServletResponse interface that
@@ -30,6 +31,10 @@ import java.util.Locale;
  * @see javax.servlet.ServletResponse
  */
 public class ServletResponseWrapper implements ServletResponse {
+    private static final String LSTRING_FILE = "javax.servlet.LocalStrings";
+    private static final ResourceBundle lStrings =
+        ResourceBundle.getBundle(LSTRING_FILE);
+
     private ServletResponse response;
 
     /**
@@ -42,7 +47,7 @@ public class ServletResponseWrapper impl
      */
     public ServletResponseWrapper(ServletResponse response) {
         if (response == null) {
-            throw new IllegalArgumentException("Response cannot be null");
+            throw new 
IllegalArgumentException(lStrings.getString("wrapper.nullResponse"));
         }
         this.response = response;
     }
@@ -66,7 +71,7 @@ public class ServletResponseWrapper impl
      */
     public void setResponse(ServletResponse response) {
         if (response == null) {
-            throw new IllegalArgumentException("Response cannot be null");
+            throw new 
IllegalArgumentException(lStrings.getString("wrapper.nullResponse"));
         }
         this.response = response;
     }

Modified: tomcat/trunk/java/javax/servlet/http/HttpServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServlet.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServlet.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServlet.java Wed Dec 12 22:29:52 
2018
@@ -736,7 +736,7 @@ public abstract class HttpServlet extend
             request = (HttpServletRequest) req;
             response = (HttpServletResponse) res;
         } catch (ClassCastException e) {
-            throw new ServletException("non-HTTP request or response");
+            throw new ServletException(lStrings.getString("http.non_http"));
         }
         service(request, response);
     }

Modified: tomcat/trunk/java/javax/servlet/http/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/LocalStrings.properties?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/LocalStrings.properties [UTF-8] 
(original)
+++ tomcat/trunk/java/javax/servlet/http/LocalStrings.properties [UTF-8] Wed 
Dec 12 22:29:52 2018
@@ -19,8 +19,9 @@ err.io.indexOutOfBounds=Invalid offset [
 err.io.nullArray=Null passed for byte array in write method
 err.io.short_read=Short Read
 
-http.method_delete_not_supported=Http method DELETE is not supported by this 
URL
+http.method_delete_not_supported=HTTP method DELETE is not supported by this 
URL
 http.method_get_not_supported=HTTP method GET is not supported by this URL
-http.method_not_implemented=Method [{0}] is not implemented by this servlet 
for this URI
+http.method_not_implemented=Method [{0}] is not implemented by this Servlet 
for this URI
 http.method_post_not_supported=HTTP method POST is not supported by this URL
 http.method_put_not_supported=HTTP method PUT is not supported by this URL
+http.non_http=Non HTTP request or response

Modified: tomcat/trunk/java/org/apache/jasper/JspC.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/JspC.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/JspC.java (original)
+++ tomcat/trunk/java/org/apache/jasper/JspC.java Wed Dec 12 22:29:52 2018
@@ -426,8 +426,7 @@ public class JspC extends Task implement
                 setThreadCount(nextArg());
             } else {
                 if (tok.startsWith("-")) {
-                    throw new JasperException("Unrecognized option: " + tok +
-                        ".  Use -help for help.");
+                    throw new 
JasperException(Localizer.getMessage("jspc.error.unknownOption", tok));
                 }
                 if (!fullstop) {
                     argPos--;
@@ -997,10 +996,10 @@ public class JspC extends Task implement
                 newThreadCount = Integer.parseInt(threadCount);
             }
         } catch (NumberFormatException e) {
-            throw new BuildException("Couldn't parse thread count: " + 
threadCount);
+            throw new 
BuildException(Localizer.getMessage("jspc.error.parseThreadCount", 
threadCount));
         }
         if (newThreadCount < 1) {
-            throw new BuildException("There must be at least one thread: " + 
newThreadCount);
+            throw new 
BuildException(Localizer.getMessage("jspc.error.minThreadCount", 
newThreadCount));
         }
         this.threadCount = newThreadCount;
     }
@@ -1541,7 +1540,7 @@ public class JspC extends Task implement
                             }
                         } else {
                             errorCount++;
-                            log.error(e.getMessage());
+                            
log.error(Localizer.getMessage("jspc.error.compilation"), e);
                         }
                     } catch (InterruptedException e) {
                         // Ignore
@@ -1558,7 +1557,7 @@ public class JspC extends Task implement
             String msg = Localizer.getMessage("jspc.generation.result",
                     Integer.toString(errorCount), Long.toString(time));
             if (failOnError && errorCount > 0) {
-                System.out.println("Error Count: " + errorCount);
+                System.out.println(Localizer.getMessage("jspc.errorCount", 
errorCount));
                 throw new BuildException(msg);
             } else {
                 log.info(msg);
@@ -1754,8 +1753,7 @@ public class JspC extends Task implement
                         String ext=libs[i].substring( libs[i].length() - 4 );
                         if (! ".jar".equalsIgnoreCase(ext)) {
                             if (".tld".equalsIgnoreCase(ext)) {
-                                log.warn("TLD files should not be placed in "
-                                         + "/WEB-INF/lib");
+                                
log.warn(Localizer.getMessage("jspc.warning.tldInWebInfLib"));
                             }
                             continue;
                         }

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Wed Dec 12 
22:29:52 2018
@@ -1366,7 +1366,8 @@ class Generator {
                     if (!Modifier.isPublic(modifiers)
                             || Modifier.isInterface(modifiers)
                             || Modifier.isAbstract(modifiers)) {
-                        throw new Exception("Invalid bean class modifier");
+                        throw new 
Exception(Localizer.getMessage("jsp.error.invalid.bean",
+                                Integer.valueOf(modifiers)));
                     }
                     // Check that there is a 0 arg constructor
                     bean.getConstructor(new Class[] {});
@@ -3485,11 +3486,7 @@ class Generator {
         } else if (n instanceof Node.NamedAttribute) {
             ci = ((Node.NamedAttribute) n).getChildInfo();
         } else {
-            // Cannot access err since this method is static, but at
-            // least flag an error.
-            throw new JasperException("Unexpected Node Type");
-            // err.getString(
-            // "jsp.error.internal.unexpected_node_type" ) );
+            throw new 
JasperException(Localizer.getMessage("jsp.error.internal.unexpectedNodeType"));
         }
 
         if (ci.hasUseBean()) {

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JDTCompiler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JDTCompiler.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JDTCompiler.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JDTCompiler.java Wed Dec 12 
22:29:52 2018
@@ -120,7 +120,7 @@ public class JDTCompiler extends org.apa
                     result = new char[buf.length()];
                     buf.getChars(0, result.length, result, 0);
                 } catch (IOException e) {
-                    log.error("Compilation error", e);
+                    
log.error(Localizer.getMessage("jsp.error.compilation.source", sourceFile), e);
                 }
                 return result;
             }
@@ -215,9 +215,9 @@ public class JDTCompiler extends org.apa
                                 new NameEnvironmentAnswer(classFileReader, 
null);
                         }
                     } catch (IOException exc) {
-                        log.error("Compilation error", exc);
+                        
log.error(Localizer.getMessage("jsp.error.compilation.dependent", className), 
exc);
                     } catch 
(org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException exc) {
-                        log.error("Compilation error", exc);
+                        
log.error(Localizer.getMessage("jsp.error.compilation.dependent", className), 
exc);
                     }
                     return null;
                 }
@@ -322,7 +322,7 @@ public class JDTCompiler extends org.apa
                 settings.put(CompilerOptions.OPTION_Source,
                              CompilerOptions.VERSION_10);
             } else {
-                log.warn("Unknown source VM " + opt + " ignored.");
+                log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", 
opt));
                 settings.put(CompilerOptions.OPTION_Source,
                         CompilerOptions.VERSION_1_8);
             }
@@ -380,7 +380,7 @@ public class JDTCompiler extends org.apa
                 settings.put(CompilerOptions.OPTION_Compliance,
                         CompilerOptions.VERSION_10);
             } else {
-                log.warn("Unknown target VM " + opt + " ignored.");
+                log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", 
opt));
                 settings.put(CompilerOptions.OPTION_TargetPlatform,
                         CompilerOptions.VERSION_1_8);
             }
@@ -411,7 +411,7 @@ public class JDTCompiler extends org.apa
                                                 (name, pageNodes, new 
StringBuilder(problem.getMessage()),
                                                         
problem.getSourceLineNumber(), ctxt));
                                     } catch (JasperException e) {
-                                        log.error("Error visiting node", e);
+                                        
log.error(Localizer.getMessage("jsp.error.compilation.jdtProblemError"), e);
                                     }
                                 }
                             }
@@ -439,7 +439,7 @@ public class JDTCompiler extends org.apa
                             }
                         }
                     } catch (IOException exc) {
-                        log.error("Compilation error", exc);
+                        
log.error(Localizer.getMessage("jsp.error.compilation.jdt"), exc);
                     }
                 }
             };

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java Wed Dec 12 
22:29:52 2018
@@ -118,7 +118,7 @@ class JspReader {
             current = new Mark(this, caw.toCharArray(), fname);
         } catch (Throwable ex) {
             ExceptionUtils.handleThrowable(ex);
-            log.error("Exception parsing file ", ex);
+            log.error(Localizer.getMessage("jsp.error.file.cannot.read", 
fname), ex);
             err.jspError("jsp.error.file.cannot.read", fname);
         } finally {
             if (reader != null) {

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java Wed Dec 
12 22:29:52 2018
@@ -389,8 +389,7 @@ public final class JspRuntimeContext {
                     ctxt.incrementRemoved();
                 } catch (Throwable t) {
                     ExceptionUtils.handleThrowable(t);
-                    jsw.getServletContext().log("Background compile failed",
-                                                t);
+                    
jsw.getServletContext().log(Localizer.getMessage("jsp.error.backgroundCompilationFailed"),
 t);
                 }
             }
         }
@@ -413,7 +412,7 @@ public final class JspRuntimeContext {
                     jsw.getServlet();
                 }
             } catch (ServletException e) {
-                jsw.getServletContext().log("Servlet reload failed", e);
+                
jsw.getServletContext().log(Localizer.getMessage("jsp.error.reload"), e);
             }
         }
     }
@@ -557,8 +556,8 @@ public final class JspRuntimeContext {
                 // Allow the JSP to access 
org.apache.jasper.runtime.HttpJspBase
                 permissions.add( new RuntimePermission(
                     "accessClassInPackage.org.apache.jasper.runtime") );
-            } catch(RuntimeException | IOException e) {
-                context.log("Security Init for context failed",e);
+            } catch (RuntimeException | IOException e) {
+                context.log(Localizer.getMessage("jsp.error.security"), e);
             }
         }
         return new SecurityHolder(source, permissions);

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java Wed Dec 12 
22:29:52 2018
@@ -954,8 +954,7 @@ public class JspUtil {
 
         if (t == null) {
             // Should never happen
-            throw new IllegalArgumentException("Unable to extract type from [" 
+
-                    type + "]");
+            throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.unable.getType", 
type));
         }
 
         StringBuilder resultType = new StringBuilder(t);

Modified: tomcat/trunk/java/org/apache/jasper/compiler/SmapStratum.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/SmapStratum.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/SmapStratum.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/SmapStratum.java Wed Dec 12 
22:29:52 2018
@@ -46,13 +46,13 @@ public class SmapStratum {
 
         public void setInputStartLine(int inputStartLine) {
             if (inputStartLine < 0)
-                throw new IllegalArgumentException("" + inputStartLine);
+                throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.negativeParameter", 
inputStartLine));
             this.inputStartLine = inputStartLine;
         }
 
         public void setOutputStartLine(int outputStartLine) {
             if (outputStartLine < 0)
-                throw new IllegalArgumentException("" + outputStartLine);
+                throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.negativeParameter", 
outputStartLine));
             this.outputStartLine = outputStartLine;
         }
 
@@ -66,20 +66,20 @@ public class SmapStratum {
          */
         public void setLineFileID(int lineFileID) {
             if (lineFileID < 0)
-                throw new IllegalArgumentException("" + lineFileID);
+                throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.negativeParameter", 
lineFileID));
             this.lineFileID = lineFileID;
             this.lineFileIDSet = true;
         }
 
         public void setInputLineCount(int inputLineCount) {
             if (inputLineCount < 0)
-                throw new IllegalArgumentException("" + inputLineCount);
+                throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.negativeParameter", 
inputLineCount));
             this.inputLineCount = inputLineCount;
         }
 
         public void setOutputLineIncrement(int outputLineIncrement) {
             if (outputLineIncrement < 0)
-                throw new IllegalArgumentException("" + outputLineIncrement);
+                throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.negativeParameter", 
outputLineIncrement));
             this.outputLineIncrement = outputLineIncrement;
         }
 

Modified: tomcat/trunk/java/org/apache/jasper/compiler/SmapUtil.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/SmapUtil.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/SmapUtil.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/SmapUtil.java Wed Dec 12 
22:29:52 2018
@@ -177,17 +177,17 @@ public class SmapUtil {
             SDEInstaller installer = new SDEInstaller(classFile, smap);
             installer.install(tmpFile);
             if (!classFile.delete()) {
-                throw new IOException("classFile.delete() failed");
+                throw new 
IOException(Localizer.getMessage("jsp.error.unable.deleteClassFile"));
             }
             if (!tmpFile.renameTo(classFile)) {
-                throw new IOException("tmpFile.renameTo(classFile) failed");
+                throw new 
IOException(Localizer.getMessage("jsp.error.unable.renameClassFile"));
             }
         }
 
         SDEInstaller(File inClassFile, byte[] sdeAttr)
             throws IOException {
             if (!inClassFile.exists()) {
-                throw new FileNotFoundException("no such file: " + 
inClassFile);
+                throw new 
FileNotFoundException(Localizer.getMessage("jsp.error.noFile", inClassFile));
             }
 
             this.sdeAttr = sdeAttr;
@@ -211,7 +211,7 @@ public class SmapUtil {
             byte[] bytes = new byte[len];
             try (FileInputStream inStream = new FileInputStream(input)) {
                 if (inStream.read(bytes, 0, len) != len) {
-                    throw new IOException("expected size: " + len);
+                    throw new 
IOException(Localizer.getMessage("jsp.error.readContent", len));
                 }
             }
             return bytes;
@@ -416,7 +416,7 @@ public class SmapUtil {
                         writeBytes(utf8);
                         break;
                     default :
-                        throw new IOException("unexpected tag: " + tag);
+                        throw new 
IOException(Localizer.getMessage("jsp.error.unexpectedTag", tag));
                 }
             }
             return sdeIndex;

Modified: tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties 
[UTF-8] (original)
+++ tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties 
[UTF-8] Wed Dec 12 22:29:52 2018
@@ -32,6 +32,7 @@ jsp.error.attribute.null_name=Null attri
 jsp.error.attribute.standard.non_rt_with_expr=The [{0}] attribute of the [{1}] 
standard action does not accept any expressions
 jsp.error.attribute.unterminated=attribute value for [{0}] is not properly 
terminated
 jsp.error.attributes.not.allowed=[{0}] must not have any attributes
+jsp.error.backgroundCompilationFailed=Background compilation failed
 jsp.error.bad.scratch.dir=The scratchDir you specified: [{0}] is unusable.
 jsp.error.badStandardAction=Invalid standard action
 jsp.error.bad_attribute=Attribute [{0}] invalid for tag [{1}] according to TLD
@@ -44,9 +45,14 @@ jsp.error.beans.property.conversion=Unab
 jsp.error.beans.propertyeditor.notregistered=Property Editor not registered 
with the PropertyEditorManager
 jsp.error.beans.setproperty.noindexset=Cannot set indexed property
 jsp.error.bug48498=Unable to display JSP extract. Probably due to an XML 
parser bug (see Tomcat bug 48498 for details).
+jsp.error.cannotAddResolver=Cannot call addELResolver after the first request 
has been made
 jsp.error.classname=Cannot determine classname from .class file
 jsp.error.coerce_to_type=Cannot coerce value [{2}] to type [{1}] for attribute 
[{0}].
 jsp.error.compilation=Error compiling file: [{0}] [{1}]
+jsp.error.compilation.dependency=Error loading dependency class [{0}]
+jsp.error.compilation.jdt=Compilation error
+jsp.error.compilation.jdtProblemError=Error processing JDT problems list
+jsp.error.compilation.source=Error loading source file [{0}]
 jsp.error.compiler=No Java compiler available
 jsp.error.compiler.config=No Java compiler available for configuration options 
compilerClassName: [{0}] and compiler: [{1}]
 jsp.error.config_pagedir_encoding_mismatch=Page-encoding specified in 
jsp-property-group [{0}] is different from that specified in page directive 
[{1}]
@@ -78,6 +84,7 @@ jsp.error.include.exception=Unable to in
 jsp.error.include.tag=Invalid jsp:include tag
 jsp.error.internal.filenotfound=Internal Error: File [{0}] not found
 jsp.error.internal.tldinit=Unable to initialize TldLocationsCache: [{0}]
+jsp.error.internal.unexpectedNodeType=Unexpected node type
 jsp.error.invalid.attribute=[{0}] has invalid attribute: [{1}]
 jsp.error.invalid.bean=The value for the useBean class attribute [{0}] is 
invalid.
 jsp.error.invalid.directive=Invalid directive
@@ -116,18 +123,24 @@ jsp.error.missing_attribute=According to
 jsp.error.missing_var_or_varReader=Missing 'var' or 'varReader' attribute
 jsp.error.namedAttribute.invalidUse=jsp:attribute must be the subelement of a 
standard or custom action
 jsp.error.needAlternateJavaEncoding=Default java encoding [{0}] is invalid on 
your java platform. An alternate can be specified via the ''javaEncoding'' 
parameter of JspServlet.
+jsp.error.negativeBufferSize=The buffer size is negative
+jsp.error.negativeParameter=The parameter [{0}] must not be negative
 jsp.error.nested.jspattribute=A jsp:attribute standard action cannot be nested 
within another jsp:attribute standard action
 jsp.error.nested.jspbody=A jsp:body standard action cannot be nested within 
another jsp:body or jsp:attribute standard action
 jsp.error.nested_jsproot=Nested &lt;jsp:root&gt;
+jsp.error.no.jsp=Cannot locate JSP file [{0}]
 jsp.error.no.more.content=End of content reached while more parsing required: 
tag nesting error?
 jsp.error.no.scratch.dir=The JSP engine is not configured with a scratch 
dir.\n\
 \ Please add "jsp.initparams=scratchdir=<dir-name>" \n\
 \ in the servlets.properties file for this context.
 jsp.error.no.scriptlets=Scripting elements ( &lt;%!, &lt;jsp:declaration, 
&lt;%=, &lt;jsp:expression, &lt;%, &lt;jsp:scriptlet ) are disallowed here.
+jsp.error.noFile=Unable to find file [{0}]
 jsp.error.noFunction=The function [{0}] cannot be located with the specified 
prefix
 jsp.error.noFunctionMethod=Method [{0}] for function [{1}] not found in class 
[{2}]
+jsp.error.noInstanceManager=No org.apache.tomcat.InstanceManager set in 
ServletContext
 jsp.error.non_null_tei_and_var_subelems=Tag [{0}] has one or more variable 
subelements and a TagExtraInfo class that returns one or more VariableInfo
 jsp.error.not.in.template=[{0}] not allowed in a template text body.
+jsp.error.nullArgument=Null argument
 jsp.error.outputfolder=No output folder
 jsp.error.overflow=Error: JSP Buffer overflow
 jsp.error.page.conflict.autoflush=Page directive: illegal to have multiple 
occurrences of ''autoFlush'' with different values (old: [{0}], new: [{1}])
@@ -150,11 +163,14 @@ jsp.error.page.invalid.info=Page directi
 jsp.error.page.invalid.iselignored=Page directive: invalid value for 
isELIgnored
 jsp.error.page.invalid.iserrorpage=Page directive: invalid value for 
isErrorPage
 jsp.error.page.invalid.isthreadsafe=Page directive: invalid value for 
isThreadSafe
+jsp.error.page.invalid.scope=Invalid scope
 jsp.error.page.invalid.session=Page directive: invalid value for session
 jsp.error.page.invalid.trimdirectivewhitespaces=Page directive: invalid value 
for trimDirectiveWhitespaces
 jsp.error.page.language.nonjava=Page directive: invalid language attribute
 jsp.error.page.multi.pageencoding=Page directive must not have multiple 
occurrences of pageencoding
 jsp.error.page.noSession=Cannot access session scope in page that does not 
participate in any session
+jsp.error.page.nullThrowable=Null exception
+jsp.error.page.sessionRequired=Page needs a session and none is available
 jsp.error.param.invalidUse=The jsp:param action must not be used outside the 
jsp:include, jsp:forward, or jsp:params elements
 jsp.error.paramexpected=Expecting "jsp:param" standard action with "name" and 
"value" attributes
 jsp.error.params.emptyBody=jsp:params must contain at least one nested 
jsp:param
@@ -168,12 +184,18 @@ jsp.error.plugin.badtype=Illegal value f
 jsp.error.plugin.nocode=code not declared in jsp:plugin
 jsp.error.plugin.notype=type not declared in jsp:plugin
 jsp.error.plugin.wrongRootElement=Name of root element in [{0}] different from 
[{1}]
+jsp.error.precompilation=Could not precompile JSP [{0}]
+jsp.error.precompilation.parameter=Cannot have precompilation request 
parameter [{0}] set to [{1}]
 jsp.error.prefix.refined=Attempt to redefine the prefix [{0}] to [{1}], when 
it was already defined as [{2}] in the current scope.
 jsp.error.prefix.use_before_dcl=The prefix [{0}] specified in this tag 
directive has been previously used by an action in file [{1}] line [{2}].
 jsp.error.prolog_config_encoding_mismatch=Page-encoding specified in XML 
prolog [{0}] is different from that specified in jsp-property-group [{1}]
 jsp.error.prolog_pagedir_encoding_mismatch=Page-encoding specified in XML 
prolog [{0}] is different from that specified in page directive [{1}]
 jsp.error.quotes.unterminated=Unterminated quotes
+jsp.error.readContent=Unable to read expected length [{0}]
+jsp.error.reload=Servlet reload failed
 jsp.error.scripting.variable.missing_name=Unable to determine scripting 
variable name from attribute [{0}]
+jsp.error.security=Security initialization failed for context
+jsp.error.securityPreload=Error preloading classes
 jsp.error.servlet.destroy.failed=Exception during Servlet.destroy() for JSP 
page
 jsp.error.servlet.invalid.method=JSPs only permit GET, POST or HEAD. Jasper 
also permits OPTIONS
 jsp.error.setLastModified=Unable to set last modified date for file [{0}]
@@ -213,17 +235,23 @@ jsp.error.tld.mandatory.element.missing=
 jsp.error.tld.missing=Unable to find taglib [{0}] for URI: [{1}]
 jsp.error.tld.missing_jar=Missing JAR resource [{0}] containing TLD
 jsp.error.tld.unable_to_get_jar=Unable to get JAR resource [{0}] containing 
TLD: [{1}]
+jsp.error.tld.url=Bad TLD URL [{0}]
 jsp.error.tlv.invalid.page=Validation error messages from TagLibraryValidator 
for [{0}] in [{1}]
 jsp.error.tlvclass.instantiation=Failed to load or instantiate 
TagLibraryValidator class: [{0}]
 jsp.error.unable.compile=Unable to compile class for JSP
+jsp.error.unable.deleteClassFile=Unable to delete class file
+jsp.error.unable.getType=Unable to extract type from [{0}]
 jsp.error.unable.load=Unable to load class for JSP
+jsp.error.unable.renameClassFile=Unable to rename class file
 jsp.error.unable.to_find_method=Unable to find setter method for attribute: 
[{0}]
 jsp.error.unavailable=JSP has been marked unavailable
 jsp.error.unbalanced.endtag=The end tag "&lt;/{0}" is unbalanced
 jsp.error.undeclared_namespace=A custom tag was encountered with an undeclared 
namespace [{0}]
+jsp.error.unexpectedTag=Unexpected tag [{0}]
 jsp.error.unknown_attribute_type=Unknown attribute type [{1}] for attribute 
[{0}].
 jsp.error.unsupported.encoding=Unsupported encoding: [{0}]
 jsp.error.unterminated=Unterminated [{0}] tag
+jsp.error.URLMustStartWithSlash=Path [{0}] must start with a slash character
 jsp.error.usebean.duplicate=useBean: Duplicate bean name: [{0}]
 jsp.error.usebean.noSession=Illegal for useBean to use session scope when JSP 
page declares (via page directive) that it does not participate in sessions
 jsp.error.var_and_varReader=Only one of 'var' or 'varReader' may be specified
@@ -261,6 +289,7 @@ jsp.warning.development=Warning: Invalid
 jsp.warning.displaySourceFragment=Warning: Invalid value for the initParam 
displaySourceFragment. Will use the default value of "true"
 jsp.warning.dumpSmap=Warning: Invalid value for the initParam dumpSmap. Will 
use the default value of "false"
 jsp.warning.enablePooling=Warning: Invalid value for the initParam 
enablePooling. Will use the default value of "true"
+jsp.warning.engineOptionsClass=Failed to load engine options class [{0}]
 jsp.warning.fork=Warning: Invalid value for the initParam fork. Will use the 
default value of "true"
 jsp.warning.genchararray=Warning: Invalid value for the initParam 
genStringAsCharArray. Will use the default value of "false"
 jsp.warning.jspIdleTimeout=Warning: Invalid value for the initParam 
jspIdleTimeout. Will use the default value of "-1"
@@ -274,6 +303,8 @@ jsp.warning.quoteAttributeEL=Warning: In
 jsp.warning.recompileOnFail=Warning: Invalid value for the initParam 
recompileOnFail. Will use the default value of "false"
 jsp.warning.strictQuoteEscaping=Warning: Invalid value for the initParam 
strictQuoteEscaping. Will use the default value of "true"
 jsp.warning.suppressSmap=Warning: Invalid value for the initParam 
suppressSmap. Will use the default value of "false"
+jsp.warning.tagPreDestroy=Error processing preDestroy on tag instance of [{0}]
+jsp.warning.tagRelease=Error processing release on tag instance of [{0}]
 jsp.warning.unknown.element.in.attribute=Unknown element [{0}] in attribute
 jsp.warning.unknown.element.in.function=Unknown element [{0}] in function
 jsp.warning.unknown.element.in.initParam=Unknown element [{0}] in validator''s 
init-param
@@ -282,13 +313,20 @@ jsp.warning.unknown.element.in.tagfile=U
 jsp.warning.unknown.element.in.taglib=Unknown element [{0}] in taglib
 jsp.warning.unknown.element.in.validator=Unknown element [{0}] in validator
 jsp.warning.unknown.element.in.variable=Unknown element [{0}] in variable
+jsp.warning.unknown.sourceVM=Unknown source VM [{0}] ignored
+jsp.warning.unknown.targetVM=Unknown target VM [{0}] ignored
 jsp.warning.xpoweredBy=Warning: Invalid value for the initParam xpoweredBy. 
Will use the default value of "false"
 
 jspc.delete.fail=Failed to delete file [{0}]
+jspc.error.compilation=Compilation error
 jspc.error.fileDoesNotExist=The file argument [{0}] does not exist
 jspc.error.generalException=ERROR-the file [{0}] generated the following 
general exception:
 jspc.error.invalidFragment=Aborting pre-compilation due to errors in web 
fragments
 jspc.error.invalidWebXml=Aborting pre-compilation due to errors in web.xml
+jspc.error.minThreadCount=There must be at least one thread [{0}]
+jspc.error.parseThreadCount=Cannot parse thread count [{0}]
+jspc.error.unknownOption=Unrecognized option [{0}]. Use -help for help.
+jspc.errorCount=Error count: [{0}]
 jspc.generation.result=Generation completed with [{0}] errors in [{1}] 
milliseconds
 jspc.implicit.uriRoot=uriRoot implicitly set to [{0}]
 jspc.usage=Usage: jspc <options> [--] <jsp files>\n\
@@ -329,6 +367,7 @@ where options include:\n\
 \    -target <version>     Set the -target argument to the compiler (default 
1.8)\n\
 \    -threadCount <count>  Number of threads to use for compilation.\n\
 \                          ("2.0C" means two threads per core)\n
+jspc.warning.tldInWebInfLib=TLD files should not be placed in /WEB-INF/lib"
 jspc.webfrg.footer=\n\
 </web-fragment>\n\
 \n
@@ -370,6 +409,10 @@ Automatically created by Apache Tomcat J
 -->\n\
 \n
 
+jstl.OSAfterWriter=Cannot use an output stream if a writer has been used
+jstl.urlMustStartWithSlash=In a URL tag where the ''context'' attribute is 
specified, both ''url'' and ''context'' must start with a slash character
+jstl.writerAfterOS=Cannot use a writer if an output stream has been used
+
 org.apache.jasper.compiler.ELParser.invalidQuotesForStringLiteral=The String 
literal [{0}] is not valid. It must be contained within single or double quotes.
 org.apache.jasper.compiler.ELParser.invalidQuoting=The expression [{0}] is not 
valid. Within a quoted String only [], [''] and ["] may be escaped with [].
 org.apache.jasper.compiler.TldCache.servletContextNull=The provided 
ServletContext was null

Modified: tomcat/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java Wed Dec 12 
22:29:52 2018
@@ -28,6 +28,7 @@ import javax.servlet.jsp.JspWriter;
 import javax.servlet.jsp.tagext.BodyContent;
 
 import org.apache.jasper.Constants;
+import org.apache.jasper.compiler.Localizer;
 
 /**
  * Write text to a character-output stream, buffering characters so as
@@ -680,7 +681,9 @@ public class BodyContentImpl extends Bod
     }
 
     private void ensureOpen() throws IOException {
-        if (closed) throw new IOException("Stream closed");
+        if (closed) {
+            throw new 
IOException(Localizer.getMessage("jsp.error.stream.closed"));
+        }
     }
 
     /**

Modified: 
tomcat/trunk/java/org/apache/jasper/runtime/InstanceManagerFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/InstanceManagerFactory.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/InstanceManagerFactory.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/InstanceManagerFactory.java Wed 
Dec 12 22:29:52 2018
@@ -18,6 +18,7 @@ package org.apache.jasper.runtime;
 
 import javax.servlet.ServletConfig;
 
+import org.apache.jasper.compiler.Localizer;
 import org.apache.tomcat.InstanceManager;
 
 public class InstanceManagerFactory {
@@ -29,7 +30,7 @@ public class InstanceManagerFactory {
         InstanceManager instanceManager =
                 (InstanceManager) 
config.getServletContext().getAttribute(InstanceManager.class.getName());
         if (instanceManager == null) {
-            throw new IllegalStateException("No 
org.apache.tomcat.InstanceManager set in ServletContext");
+            throw new 
IllegalStateException(Localizer.getMessage("jsp.error.noInstanceManager"));
         }
         return instanceManager;
     }

Modified: 
tomcat/trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java 
Wed Dec 12 22:29:52 2018
@@ -32,6 +32,7 @@ import javax.servlet.jsp.JspApplicationC
 import javax.servlet.jsp.JspContext;
 
 import org.apache.jasper.Constants;
+import org.apache.jasper.compiler.Localizer;
 import org.apache.jasper.el.ELContextImpl;
 import org.apache.jasper.el.JasperELResolver;
 
@@ -62,14 +63,14 @@ public class JspApplicationContextImpl i
     @Override
     public void addELContextListener(ELContextListener listener) {
         if (listener == null) {
-            throw new IllegalArgumentException("ELContextListener was null");
+            throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.nullArgument"));
         }
         this.contextListeners.add(listener);
     }
 
     public static JspApplicationContextImpl getInstance(ServletContext 
context) {
         if (context == null) {
-            throw new IllegalArgumentException("ServletContext was null");
+            throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.nullArgument"));
         }
         JspApplicationContextImpl impl = (JspApplicationContextImpl) context
                 .getAttribute(KEY);
@@ -82,7 +83,7 @@ public class JspApplicationContextImpl i
 
     public ELContextImpl createELContext(JspContext context) {
         if (context == null) {
-            throw new IllegalArgumentException("JspContext was null");
+            throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.nullArgument"));
         }
 
         // create ELContext for JspContext
@@ -127,11 +128,10 @@ public class JspApplicationContextImpl i
     @Override
     public void addELResolver(ELResolver resolver) throws 
IllegalStateException {
         if (resolver == null) {
-            throw new IllegalArgumentException("ELResolver was null");
+            throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.nullArgument"));
         }
         if (this.instantiated) {
-            throw new IllegalStateException(
-                    "cannot call addELResolver after the first request has 
been made");
+            throw new 
IllegalStateException(Localizer.getMessage("jsp.error.cannotAddResolver"));
         }
         this.resolvers.add(resolver);
     }

Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java Wed Dec 
12 22:29:52 2018
@@ -968,8 +968,7 @@ public class JspRuntimeLibrary {
         } catch (Throwable t) {
             ExceptionUtils.handleThrowable(t);
             Log log = LogFactory.getLog(JspRuntimeLibrary.class);
-            log.warn("Error processing release on tag instance of "
-                    + tag.getClass().getName(), t);
+            log.warn(Localizer.getMessage("jsp.warning.tagRelease", 
tag.getClass().getName()), t);
         }
         try {
             instanceManager.destroyInstance(tag);
@@ -977,8 +976,7 @@ public class JspRuntimeLibrary {
             Throwable t = ExceptionUtils.unwrapInvocationTargetException(e);
             ExceptionUtils.handleThrowable(t);
             Log log = LogFactory.getLog(JspRuntimeLibrary.class);
-            log.warn("Error processing preDestroy on tag instance of "
-                    + tag.getClass().getName(), t);
+            log.warn(Localizer.getMessage("jsp.warning.tagPreDestroy", 
tag.getClass().getName()), t);
         }
 
     }

Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java Wed Dec 12 
22:29:52 2018
@@ -66,7 +66,7 @@ public class JspWriterImpl extends JspWr
             boolean autoFlush) {
         super(sz, autoFlush);
         if (sz < 0)
-            throw new IllegalArgumentException("Buffer size <= 0");
+            throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.negativeBufferSize"));
         this.response = response;
         cb = sz == 0 ? null : new char[sz];
         nextChar = 0;
@@ -184,7 +184,7 @@ public class JspWriterImpl extends JspWr
     /** check to make sure that the stream has not been closed */
     private void ensureOpen() throws IOException {
         if (response == null || closed)
-            throw new IOException("Stream closed");
+            throw new 
IOException(Localizer.getMessage("jsp.error.stream.closed"));
     }
 
 

Modified: tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java Wed Dec 12 
22:29:52 2018
@@ -132,8 +132,7 @@ public class PageContextImpl extends Pag
         if (request instanceof HttpServletRequest && needsSession)
             this.session = ((HttpServletRequest) request).getSession();
         if (needsSession && session == null)
-            throw new IllegalStateException(
-                    "Page needs a session and none is available");
+            throw new 
IllegalStateException(Localizer.getMessage("jsp.error.page.sessionRequired"));
 
         // initialize the initial out ...
         depth = -1;
@@ -230,7 +229,7 @@ public class PageContextImpl extends Pag
             return context.getAttribute(name);
 
         default:
-            throw new IllegalArgumentException("Invalid scope");
+            throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.page.invalid.scope"));
         }
     }
 
@@ -304,7 +303,7 @@ public class PageContextImpl extends Pag
             break;
 
         default:
-            throw new IllegalArgumentException("Invalid scope");
+            throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.page.invalid.scope"));
         }
     }
 
@@ -390,7 +389,7 @@ public class PageContextImpl extends Pag
             return context.getAttributeNames();
 
         default:
-            throw new IllegalArgumentException("Invalid scope");
+            throw new 
IllegalArgumentException(Localizer.getMessage("jsp.error.page.invalid.scope"));
         }
     }
 
@@ -600,7 +599,7 @@ public class PageContextImpl extends Pag
     @SuppressWarnings("deprecation") // Still jave to support old JSP EL
     public void handlePageException(final Throwable t) throws IOException, 
ServletException {
         if (t == null) {
-            throw new NullPointerException("null Throwable");
+            throw new 
NullPointerException(Localizer.getMessage("jsp.error.page.nullThrowable"));
         }
 
         if (errorPageURL != null && !errorPageURL.equals("")) {

Modified: tomcat/trunk/java/org/apache/jasper/security/SecurityClassLoad.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/security/SecurityClassLoad.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/security/SecurityClassLoad.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/security/SecurityClassLoad.java Wed Dec 
12 22:29:52 2018
@@ -16,6 +16,7 @@
  */
 package org.apache.jasper.security;
 
+import org.apache.jasper.compiler.Localizer;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
@@ -53,7 +54,7 @@ public final class SecurityClassLoad {
             loader.loadClass( basePackage + "servlet.JspServletWrapper");
         } catch (ClassNotFoundException ex) {
             Log log = LogFactory.getLog(SecurityClassLoad.class);
-            log.error("SecurityClassLoad", ex);
+            log.error(Localizer.getMessage("jsp.error.securityPreload"), ex);
         }
     }
 }

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java Wed Dec 
12 22:29:52 2018
@@ -381,7 +381,7 @@ public class JspCServletContext implemen
     public URL getResource(String path) throws MalformedURLException {
 
         if (!path.startsWith("/")) {
-            throw new MalformedURLException("Path '" + path + "' does not 
start with '/'");
+            throw new 
MalformedURLException(Localizer.getMessage("jsp.error.URLMustStartWithSlash", 
path));
         }
 
         // Strip leading '/'

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java Wed Dec 12 
22:29:52 2018
@@ -108,7 +108,7 @@ public class JspServlet extends HttpServ
                 e = ExceptionUtils.unwrapInvocationTargetException(e);
                 ExceptionUtils.handleThrowable(e);
                 // Need to localize this.
-                log.warn("Failed to load engineOptionsClass", e);
+                
log.warn(Localizer.getMessage("jsp.warning.engineOptionsClass", 
engineOptionsName), e);
                 // Use the default Options implementation
                 options = new EmbeddedServletOptions(config, context);
             }
@@ -124,7 +124,7 @@ public class JspServlet extends HttpServ
                     return;
                 }
             } catch (MalformedURLException e) {
-                throw new ServletException("cannot locate jsp file", e);
+                throw new 
ServletException(Localizer.getMessage("jsp.error.no.jsp", jspFile), e);
             }
             try {
                 if (SecurityUtil.isPackageProtectionEnabled()){
@@ -139,11 +139,11 @@ public class JspServlet extends HttpServ
                     serviceJspFile(null, null, jspFile, true);
                 }
             } catch (IOException e) {
-                throw new ServletException("Could not precompile jsp: " + 
jspFile, e);
+                throw new 
ServletException(Localizer.getMessage("jsp.error.precompilation", jspFile), e);
             } catch (PrivilegedActionException e) {
                 Throwable t = e.getCause();
                 if (t instanceof ServletException) throw (ServletException)t;
-                throw new ServletException("Could not precompile jsp: " + 
jspFile, e);
+                throw new 
ServletException(Localizer.getMessage("jsp.error.precompilation", jspFile), e);
             }
         }
 
@@ -269,9 +269,8 @@ public class JspServlet extends HttpServ
             // precompilation request can be ignored.
             return true;             // ?jsp_precompile=false
         } else {
-            throw new ServletException("Cannot have request parameter " +
-                                       Constants.PRECOMPILE + " set to " +
-                                       value);
+            throw new 
ServletException(Localizer.getMessage("jsp.error.precompilation.parameter",
+                    Constants.PRECOMPILE, value));
         }
 
     }

Modified: tomcat/trunk/java/org/apache/jasper/servlet/TldPreScanned.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/TldPreScanned.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/TldPreScanned.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/TldPreScanned.java Wed Dec 12 
22:29:52 2018
@@ -21,6 +21,7 @@ import java.util.Collection;
 
 import javax.servlet.ServletContext;
 
+import org.apache.jasper.compiler.Localizer;
 import org.apache.tomcat.util.descriptor.tld.TldResourcePath;
 
 public class TldPreScanned extends TldScanner {
@@ -48,7 +49,7 @@ public class TldPreScanned extends TldSc
                     throw new IllegalStateException(e);
                 }
             } else {
-                throw new IllegalStateException("Bad tld url: "+str);
+                throw new 
IllegalStateException(Localizer.getMessage("jsp.error.tld.url", str));
             }
         }
     }

Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java?rev=1848806&r1=1848805&r2=1848806&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java (original)
+++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java Wed Dec 12 
22:29:52 2018
@@ -35,6 +35,7 @@ import javax.servlet.jsp.JspTagException
 import javax.servlet.jsp.PageContext;
 
 import org.apache.jasper.Constants;
+import org.apache.jasper.compiler.Localizer;
 
 /**
  * Util contains some often used consts, static methods and embedded class
@@ -259,8 +260,7 @@ public class Util {
                 return url;
         } else {
             if (!context.startsWith("/") || !url.startsWith("/")) {
-                throw new JspTagException(
-                "In URL tags, when the \"context\" attribute is specified, 
values of both \"context\" and \"url\" must start with \"/\".");
+                throw new 
JspTagException(Localizer.getMessage("jstl.urlMustStartWithSlash"));
             }
             if (context.equals("/")) {
                 // Don't produce string starting with '//', many
@@ -313,8 +313,7 @@ public class Util {
         @Override
         public PrintWriter getWriter() {
             if (isStreamUsed)
-                throw new IllegalStateException("Unexpected internal error 
during &lt;import&gt: " +
-                "Target servlet called getWriter(), then getOutputStream()");
+                throw new 
IllegalStateException(Localizer.getMessage("jstl.writerAfterOS"));
             isWriterUsed = true;
             return new PrintWriter(sw);
         }
@@ -322,8 +321,7 @@ public class Util {
         @Override
         public ServletOutputStream getOutputStream() {
             if (isWriterUsed)
-                throw new IllegalStateException("Unexpected internal error 
during &lt;import&gt: " +
-                "Target servlet called getOutputStream(), then getWriter()");
+                throw new 
IllegalStateException(Localizer.getMessage("jstl.OSAfterWriter"));
             isStreamUsed = true;
             return sos;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to