This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new 8dab9ba No functional change. Align 10.0.x, 9.0.x and 8.5.x 8dab9ba is described below commit 8dab9ba23e93651db0e5636c4160603a7356babe Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Mar 29 19:54:25 2021 +0100 No functional change. Align 10.0.x, 9.0.x and 8.5.x --- java/org/apache/jasper/JspC.java | 20 +++++++++----------- .../apache/jasper/resources/LocalStrings.properties | 7 +++++++ .../jasper/resources/LocalStrings_de.properties | 2 ++ .../jasper/resources/LocalStrings_fr.properties | 7 +++++++ .../jasper/resources/LocalStrings_ja.properties | 7 +++++++ .../jasper/resources/LocalStrings_ko.properties | 7 +++++++ .../jasper/resources/LocalStrings_zh_CN.properties | 7 +++++++ .../apache/jasper/servlet/JspCServletContext.java | 2 +- 8 files changed, 47 insertions(+), 12 deletions(-) diff --git a/java/org/apache/jasper/JspC.java b/java/org/apache/jasper/JspC.java index ae9fb24..03f234f 100644 --- a/java/org/apache/jasper/JspC.java +++ b/java/org/apache/jasper/JspC.java @@ -420,8 +420,7 @@ public class JspC extends Task implements Options { 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--; @@ -451,9 +450,6 @@ public class JspC extends Task implements Options { return true; } - /** - * {@inheritDoc} - */ @Override public boolean getTrimSpaces() { return trimSpaces; @@ -979,10 +975,11 @@ public class JspC extends Task implements Options { 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", Integer.valueOf(newThreadCount))); } this.threadCount = newThreadCount; } @@ -1523,7 +1520,7 @@ public class JspC extends Task implements Options { } } else { errorCount++; - log.error(e.getMessage()); + log.error(Localizer.getMessage("jspc.error.compilation"), e); } } catch (InterruptedException e) { // Ignore @@ -1540,6 +1537,8 @@ public class JspC extends Task implements Options { String msg = Localizer.getMessage("jspc.generation.result", Integer.toString(errorCount), Long.toString(time)); if (failOnError && errorCount > 0) { + System.out.println(Localizer.getMessage( + "jspc.errorCount", Integer.valueOf(errorCount))); throw new BuildException(msg); } else { log.info(msg); @@ -1695,7 +1694,7 @@ public class JspC extends Task implements Options { } // Turn the classPath into URLs - ArrayList<URL> urls = new ArrayList<>(); + List<URL> urls = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(classPath, File.pathSeparator); while (tokenizer.hasMoreTokens()) { @@ -1735,8 +1734,7 @@ public class JspC extends Task implements Options { String ext = lib.substring(lib.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; } diff --git a/java/org/apache/jasper/resources/LocalStrings.properties b/java/org/apache/jasper/resources/LocalStrings.properties index 96a8c8c..c5ed7fe 100644 --- a/java/org/apache/jasper/resources/LocalStrings.properties +++ b/java/org/apache/jasper/resources/LocalStrings.properties @@ -16,6 +16,7 @@ jasper.error.emptybodycontent.nonempty=According to TLD, tag [{0}] must be empty, but is not jsp.engine.info=Jasper JSP {0} Engine +jsp.error.URLMustStartWithSlash=Path [{0}] must start with a slash character jsp.error.action.isnottagfile=[{0}] action can be used in tag files only jsp.error.action.istagfile=[{0}] action cannot be used in a tag file jsp.error.attempt_to_clear_flushed_buffer=Error: Attempt to clear a buffer that's already been flushed @@ -324,10 +325,15 @@ jsp.warning.unsupported.targetVM=Unsupported target VM [{0}] requested, using [{ 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=Failing pre-compilation due to errors in web fragments jspc.error.invalidWebXml=Failing 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\ @@ -367,6 +373,7 @@ where options include:\n\ \ -target <version> Set the -target argument to the compiler (default 1.7)\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 diff --git a/java/org/apache/jasper/resources/LocalStrings_de.properties b/java/org/apache/jasper/resources/LocalStrings_de.properties index 9081b85..cd15d94 100644 --- a/java/org/apache/jasper/resources/LocalStrings_de.properties +++ b/java/org/apache/jasper/resources/LocalStrings_de.properties @@ -15,6 +15,7 @@ jasper.error.emptybodycontent.nonempty=Nach der TLD muss [{0}] leer sein, ist es aber nicht +jsp.error.URLMustStartWithSlash=Der Pfad [{0}] muss mit ''/'' beginnen jsp.error.action.isnottagfile=[{0}] Action kann nur in Tag-Dateien benutzt werden jsp.error.attribute.deferredmix=Kann nicht ${} und #{} gleichzeitig als EL Ausdrücke in demselben Attribut Wert verwenden jsp.error.attribute.duplicate=Qualifizierte Attributnamen müssen innerhalb eines Elements eindeutig sein @@ -68,6 +69,7 @@ jsp.message.jsp_removed_excess=Lösche überschüssige JSP für Pfad [{0}] aus d jsp.warning.enablePooling=Warnung: Ungültiger Wert für den initParam enablePooling. Benutze den Standard-Wert "true" jsp.warning.unknown.targetVM=Unbekannte Ziel-VM [{0}] ignoriert +jspc.errorCount=Anzahl der Fehler: [{0}] jspc.webfrg.footer=\n\ </web-fragment>\n\ \n diff --git a/java/org/apache/jasper/resources/LocalStrings_fr.properties b/java/org/apache/jasper/resources/LocalStrings_fr.properties index 059595d..4eaf55e 100644 --- a/java/org/apache/jasper/resources/LocalStrings_fr.properties +++ b/java/org/apache/jasper/resources/LocalStrings_fr.properties @@ -16,6 +16,7 @@ jasper.error.emptybodycontent.nonempty=D''après la TLD, le tag [{0}] doit être vide, mais ne l''est pas jsp.engine.info=Moteur Jasper JSP {0} +jsp.error.URLMustStartWithSlash=Le chemin [{0}] doit commencer par un caractère slash jsp.error.action.isnottagfile=L''action [{0}] ne peut être utilisée que dans un fichier tag jsp.error.action.istagfile=L''action [{0}] ne peut être utilisée dans un fichier tag jsp.error.attempt_to_clear_flushed_buffer=Erreur : Tentative d'effacement d'un tampon qui a déjà été vidangé (flush) @@ -290,10 +291,15 @@ jsp.warning.unsupported.targetVM=La VM cible [{0}] demandée n''est pas support jsp.warning.xpoweredBy=WARNING : Valeur invalide pour le paramètre d'initialisation xpoweredBy, la valeur par défaut "false" sera utilisée jspc.delete.fail=Impossible d''effacer le fichier [{0}] +jspc.error.compilation=Erreur de compilation jspc.error.fileDoesNotExist=Le fichier [{0}] donné en argument n''existe pas jspc.error.generalException=ERREUR-le fichier [{0}] a généré l''exception générale suivante : jspc.error.invalidFragment=Arrêt de la précompilation à cause des erreurs dans les fragments web jspc.error.invalidWebXml=Arrêt de la précompilation à cause d'erreurs dans web.xml +jspc.error.minThreadCount=Il doit y avoir au moins un thread [{0}] +jspc.error.parseThreadCount=Impossible d''analyser le nombre de threads [{0}] +jspc.error.unknownOption=Option [{0}] non reconnue, utiliser -help pour obtenir de l''aide +jspc.errorCount=Nombre d''erreurs : [{0}] jspc.generation.result=La génération s''est terminée avec [{0}] erreurs en [{1}] millisecondes jspc.implicit.uriRoot=uriRoot réglé implicitement à [{0}] jspc.usage=Utilisation : jspc <options> [--] <fichiers jsp>\n\ @@ -334,6 +340,7 @@ et où les options sont :\n\ \ -target <version> Fixe l'argument -target pour le compilateur (par défaut 1.7)\n\ \ -threadCount <count> Nombre de threads à utiliser pour la compilation\n\ \ ("2.0C" veut dire deux threads par cœur)\n +jspc.warning.tldInWebInfLib=Les fichiers TLDs ne devraient pas être placés dans /WEB-INF/lib jspc.webfrg.footer=\n\ </web-fragment>\n\ \n diff --git a/java/org/apache/jasper/resources/LocalStrings_ja.properties b/java/org/apache/jasper/resources/LocalStrings_ja.properties index 607241c..cfe97a2 100644 --- a/java/org/apache/jasper/resources/LocalStrings_ja.properties +++ b/java/org/apache/jasper/resources/LocalStrings_ja.properties @@ -16,6 +16,7 @@ jasper.error.emptybodycontent.nonempty=TLDによると、タグ [{0}] は空である必要がありますがそうなっていません jsp.engine.info=Jasper JSP {0}エンジン +jsp.error.URLMustStartWithSlash=パス[{0}]はスラッシュ文字で始まる必要があります。 jsp.error.action.isnottagfile=[{0}] アクションはタグファイル中でのみ使用できます jsp.error.action.istagfile=[{0}] アクションはタグファイル中で使用できません jsp.error.attempt_to_clear_flushed_buffer=エラー: 既にフラッシュされているバッファをクリアしようとしました @@ -324,10 +325,15 @@ jsp.warning.unsupported.targetVM=サポートされていない target VM [{0}] jsp.warning.xpoweredBy=警告: initParam の xpoweredBy の値は無効です。既定値 "false" が使用されます jspc.delete.fail=ファイル[{0}]を削除できませんでした +jspc.error.compilation=コンパイルエラー jspc.error.fileDoesNotExist=ファイル引数 [{0}] は存在しません。 jspc.error.generalException=エラー: ファイル [{0}] で以下の一般的な例外が発生しました: jspc.error.invalidFragment=Webフラグメントのエラーによりプリコンパイルが中止されました jspc.error.invalidWebXml=web.xmlのエラーによりプリコンパイルを中止しました +jspc.error.minThreadCount=少なくとも1つのスレッド[{0}]が必要です +jspc.error.parseThreadCount=スレッド数[{0}]を解析できません。 +jspc.error.unknownOption=認識できないオプション[{0}]。 ヘルプには-helpを使用してください。 +jspc.errorCount=エラー数:[{0}] jspc.generation.result=[{1}]ミリ秒の間に[{0}]個のエラーが発生して生成が完了しました。 jspc.implicit.uriRoot=uriRootはデフォルト[{0}]に設定されます jspc.usage=使用法: jspc <options> [--] <jsp files>\n\ @@ -364,6 +370,7 @@ JSPファイルの場所は次のオプションで指定するか、\n\ \ -javaEncoding <enc> Set the encoding charset for Java classes (default UTF-8)\n\ \ -source <version> Set the -source argument to the compiler (default 1.7)\n\ \ -target <version> Set the -target argument to the compiler (default 1.7)\n +jspc.warning.tldInWebInfLib=TLDファイルは/ WEB-INF/libに置かないでください。 jspc.webfrg.footer=\n\ </web-fragment>\n\ \n diff --git a/java/org/apache/jasper/resources/LocalStrings_ko.properties b/java/org/apache/jasper/resources/LocalStrings_ko.properties index 6cbd583..387e933 100644 --- a/java/org/apache/jasper/resources/LocalStrings_ko.properties +++ b/java/org/apache/jasper/resources/LocalStrings_ko.properties @@ -16,6 +16,7 @@ jasper.error.emptybodycontent.nonempty=TLD 파일에 따르면, [{0}] 태그는 반드시 비어 있어야 하는데, 그렇지 않습니다, jsp.engine.info=Jasper JSP {0} 엔진 +jsp.error.URLMustStartWithSlash=경로 [{0}]은(는) 반드시 슬래시 문자로 시작해야 합니다. jsp.error.action.isnottagfile=[{0}] 액션은 오직 태그 파일들 내에서만 사용될 수 있습니다. jsp.error.action.istagfile=[{0}] 액션은 태그 파일 내에서 사용될 수 없습니다. jsp.error.attempt_to_clear_flushed_buffer=오류: 이미 배출되어 버린 버퍼를 폐기하려는 시도 @@ -290,12 +291,18 @@ jsp.warning.unsupported.targetVM=요청된 대상 VM [{0}]은(는) 지원되지 jsp.warning.xpoweredBy=경고: initParam인 xpoweredBy에 유효하지 않은 값. 기본 값인 "false"를 사용할 것입니다. jspc.delete.fail=파일 [{0}]을(를) 삭제하지 못했습니다. +jspc.error.compilation=컴파일 오류 jspc.error.fileDoesNotExist=파일 아규먼트 [{0}]이(가) 존재하지 않습니다. jspc.error.generalException=오류: 파일 [{0}]이(가) 다음의 일반적인 예외를 발생시켰습니다: jspc.error.invalidFragment=웹 fragment들 내의 오류들로 인하여, 사전 컴파일을 중단합니다. jspc.error.invalidWebXml=web.xml 내의 오류들로 인해, 사전 컴파일을 중단합니다. +jspc.error.minThreadCount=적어도 하나 이상의 쓰레드가 있어야만 하는데, 쓰레드 개수가 [{0}]입니다. +jspc.error.parseThreadCount=쓰레드 개수 [{0}]을(를) 파싱할 수 없습니다. +jspc.error.unknownOption=인식되지 않는 옵션 [{0}]. 도움말을 보시려면 -help 옵션을 사용하십시오. +jspc.errorCount=오류 개수: [{0}] jspc.generation.result=[{0}]개의 오류를 발생시키며, 코드 생성이 [{1}] 밀리초에 완료되었습니다. jspc.implicit.uriRoot=uriRoot가 묵시적으로 [{0}](으)로 설정됨 +jspc.warning.tldInWebInfLib=TLD 파일들을 /WEB-INF/lib 내에 두어서는 안됩니다. jspc.webfrg.footer=\n\ </web-fragment>\n\ \n diff --git a/java/org/apache/jasper/resources/LocalStrings_zh_CN.properties b/java/org/apache/jasper/resources/LocalStrings_zh_CN.properties index 6891812..401faa9 100644 --- a/java/org/apache/jasper/resources/LocalStrings_zh_CN.properties +++ b/java/org/apache/jasper/resources/LocalStrings_zh_CN.properties @@ -16,6 +16,7 @@ jasper.error.emptybodycontent.nonempty=根据 TLD,[{0}] 标签必须为空,但不是 jsp.engine.info=Jasper JSP{0}引擎 +jsp.error.URLMustStartWithSlash=路径[{0}]必须以斜线字符开头 jsp.error.action.isnottagfile=[{0}]行为只能用于标签文件 jsp.error.action.istagfile=标签文件中不能使用[{0}]功能 jsp.error.attempt_to_clear_flushed_buffer=错误:尝试清空已刷新的缓冲区 @@ -289,12 +290,18 @@ jsp.warning.unsupported.targetVM=不支持请求的目标VM[{0}],使用[{1}] jsp.warning.xpoweredBy=警告:initParam xpoweredBy的值无效。将使用默认值“false” jspc.delete.fail=无法删除文件 [{0}] +jspc.error.compilation=编译错误 jspc.error.fileDoesNotExist=文件参数 [{0}] 不存在 jspc.error.generalException=错误文件[{0}]生成以下常规异常: jspc.error.invalidFragment=由于web片段中的错误而中止预编译 jspc.error.invalidWebXml=由于web.xml中的错误而中止预编译 +jspc.error.minThreadCount=必须至少有一个线程[{0}] +jspc.error.parseThreadCount=不能够转换的线程数[{0}] +jspc.error.unknownOption=无法识别的选项[{0}]。使用-帮助获取帮助。 +jspc.errorCount=错误计数:[{0}] jspc.generation.result=生成在[{1}]毫秒内完成,出现[{0}]个错误 jspc.implicit.uriRoot=uriRoot隐式设置为[{0}] +jspc.warning.tldInWebInfLib=TLD文件不应放在/WEB-INF/lib中” jspc.webfrg.footer=\n\ </web-fragment>\n\ \n diff --git a/java/org/apache/jasper/servlet/JspCServletContext.java b/java/org/apache/jasper/servlet/JspCServletContext.java index 2f2ad1f..8096a3c 100644 --- a/java/org/apache/jasper/servlet/JspCServletContext.java +++ b/java/org/apache/jasper/servlet/JspCServletContext.java @@ -380,7 +380,7 @@ public class JspCServletContext implements ServletContext { 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 '/' --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org