You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2011/04/21 14:50:40 UTC

svn commit: r1095686 - in /tomcat/trunk/java/org/apache/jasper: compiler/DefaultErrorHandler.java resources/LocalStrings.properties

Author: markt
Date: Thu Apr 21 12:50:40 2011
New Revision: 1095686

URL: http://svn.apache.org/viewvc?rev=1095686&view=rev
Log:
i18n for r1090763

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java
    tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties

Modified: tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java?rev=1095686&r1=1095685&r2=1095686&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java Thu Apr 21 12:50:40 2011
@@ -38,8 +38,10 @@ class DefaultErrorHandler implements Err
     @Override
     public void jspError(String fname, int line, int column, String errMsg,
             Exception ex) throws JasperException {
-        throw new JasperException(fname + "(line: " + line + ", column: " +
-                column + ")" + " " + errMsg, ex);
+        throw new JasperException(fname + " (" +
+                Localizer.getMessage("jsp.error.location",
+                        Integer.toString(line), Integer.toString(column)) +
+                ") " + errMsg, ex);
     }
     
     /*

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=1095686&r1=1095685&r2=1095686&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties Thu Apr 21 12:50:40 2011
@@ -336,6 +336,7 @@ jsp.error.needAlternateJavaEncoding=Defa
 jsp.error.single.line.number=An error occurred at line: {0} in the jsp file: {1}
 jsp.error.multiple.line.number=\n\nAn error occurred between lines: {0} and {1} in the jsp file: {2}\n\n
 jsp.error.java.line.number=An error occurred at line: {0} in the generated java file
+jsp.error.location=line: {0}, column {1}
 jsp.error.corresponding.servlet=Generated servlet error:\n
 jsp.error.empty.body.not.allowed=Empty body not allowed for {0}
 jsp.error.jspbody.required=Must use jsp:body to specify tag body for {0} if jsp:attribute is used.



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


Re: svn commit: r1095686 - in /tomcat/trunk/java/org/apache/jasper: compiler/DefaultErrorHandler.java resources/LocalStrings.properties

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/4/22 Konstantin Kolinko <kn...@gmail.com>:
> 2011/4/21  <ma...@apache.org>:
>> Author: markt
>> Date: Thu Apr 21 12:50:40 2011
>> New Revision: 1095686
>>
>> URL: http://svn.apache.org/viewvc?rev=1095686&view=rev
>> Log:
>> i18n for r1090763
>>
>> Modified:
>>    tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java
>>    tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties
>>
>
>> --- tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties (original)
>> +++ tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties Thu Apr

>> +jsp.error.location=line: {0}, column {1}
>
> Maybe
> jsp.error.location=line: {0,number,0}, column: {1,number,0}
>
> 1) missing second ':'
> 2) numbers by default are formatted with thousands separator, e.g. "1

Fixed 1).
The 2) is not an issue. I didn't notice that the arguments there are
already strings, by Integer.toString(line). Sorry for the noise.

Best regards,
Konstantin Kolinko

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


Re: svn commit: r1095686 - in /tomcat/trunk/java/org/apache/jasper: compiler/DefaultErrorHandler.java resources/LocalStrings.properties

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/4/21  <ma...@apache.org>:
> Author: markt
> Date: Thu Apr 21 12:50:40 2011
> New Revision: 1095686
>
> URL: http://svn.apache.org/viewvc?rev=1095686&view=rev
> Log:
> i18n for r1090763
>
> Modified:
>    tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java
>    tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties
>

> --- tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties (original)
> +++ tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties Thu Apr 21 12:50:40 2011
> @@ -336,6 +336,7 @@ jsp.error.needAlternateJavaEncoding=Defa
>  jsp.error.single.line.number=An error occurred at line: {0} in the jsp file: {1}
>  jsp.error.multiple.line.number=\n\nAn error occurred between lines: {0} and {1} in the jsp file: {2}\n\n
>  jsp.error.java.line.number=An error occurred at line: {0} in the generated java file
> +jsp.error.location=line: {0}, column {1}

Maybe
jsp.error.location=line: {0,number,0}, column: {1,number,0}

1) missing second ':'
2) numbers by default are formatted with thousands separator, e.g. "1
234". I'd like to avoid the separator.
I do not remember whether ",0" is sufficient to suppress the thousands
separator, or ",###0" will be needed. - needs some testing.


>  jsp.error.corresponding.servlet=Generated servlet error:\n
>  jsp.error.empty.body.not.allowed=Empty body not allowed for {0}
>  jsp.error.jspbody.required=Must use jsp:body to specify tag body for {0} if jsp:attribute is used.

Best regards,
Konstantin Kolinko

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