java - 如果 tagdir 属性没有尾部斜杠,是否有任何 jsp 2.0 实现会强制出现错误?

标签 java jsp jakarta-ee standards-compliance taglib

在 JSP 2.0 规范中,它提到了 taglib 指令的“tagdir”属性 (JSP.1.10.2):

Indicates this prefix is to be used to identify tag extensions installed in the /WEB-INF/tags/ directory or a subdirectory. An implicit tag library descriptor is used. A translation error must occur if the value does not start with /WEB-INF/tags/.

如您所见,它必须有一个尾部斜杠,“/WEB-INF/tags”是不够的。它一定会产生编译错误!

我们在尾部斜杠和 Eclipse 方面遇到了很多问题。 Eclipse 编辑此类 jsp 文件的速度变慢。所以我们确实删除了尾部斜杠,并且 Eclipse 再次正常运行。

大多数 jsp 教程和书籍不使用尾部斜杠。

在 jsp 2.1 规范中,不再需要尾部斜杠。

我想知道他们是否有任何 jsp 实现抛出编译错误? 或者不使用尾部斜杠是否安全?

最佳答案

不知道其他 servlet 容器,但对于 Tomcat,除了 /WEB-INF/tags 之外,我从未使用过任何其他容器。

关于java - 如果 tagdir 属性没有尾部斜杠,是否有任何 jsp 2.0 实现会强制出现错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4667864/

相关文章:

java - JSP重定向到不同的URL

java - 如何修复Spring Web应用程序的 ‘404--Not Found'问题

java - 状态更新不起作用

Java 变量参数和 rhino

java - SWT 未启用 shell

javascript - 如何从 Java Controller 下载文件到 javascript

jquery - ajax请求发送时如何执行一些操作?

hibernate HQL : where clause with list

java - eclipse : Constructor call must be the first statement

java - Gson().fromJson() 错误取决于操作系统版本