自定义 taglib - 根据每个请求重新编译 .tag 文件。 这是正常的吗?

发布于 2024-07-30 07:06:37 字数 253 浏览 3 评论 0原文

我正在使用 .tag 文件创建自定义标签库。 一切都很好,除了当我同时加载 2 个页面时。 似乎 .tag 文件会根据每个请求重新编译,并且并发会导致编译失败。

这是 .tag 文件的正常行为吗? 我原以为它们只会被编译一次。 有什么办法可以防止重新编译吗?

.tag 文件位于 jar 文件中,该文件包含在我的 war 文件的 lib 目录中。 如果重要的话,我正在部署到 JBoss 4.2.1。

谢谢。

I'm creating a custom taglib with .tag files. Everything works great, except when I load 2 pages at the same time. It seems the .tag files are re-compiled on every request and the concurrency causes the compilation to fail.

Is this normal behavior for .tag files? I would have expected them to be compiled only once.
Is there some way to prevent re-compilation?

The .tag files are in a jar file, which is included as in the lib directory of my war file.
I'm deploying to JBoss 4.2.1, if that matters.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情徒 2024-08-06 07:06:37

您如何知道 JBoss 正在针对每个请求重新编译标记? 您有任何直接证据,还是只是并发问题? 这个并发问题是什么? 堆栈跟踪? 如果是这样,请发布。

当 JBoss 编译 JSP 或标记文件时,它将编译器版本保存在 tmp/ 或 work/ 目录中(不记得是哪个)。 环顾四周,看看是否可以找到它(它将是一个 .class 文件,其名称与标记文件类似)。 如果标签确实每次都被重新编译,则每次都会刷新该文件。 如果根本找不到类文件,可能是 JBoss 无法创建临时编译版本(可能是由于文件权限问题),因此每次都被迫重新编译。

How do you know JBoss is recompiling the tag on each request? Do you have any direct evidence, or just the concurrency problem? What is this concurrency problem? A stack trace? If so, please post it.

When JBoss compiles a JSP or tagfile, it keeps the compiler version in its tmp/ or work/ directory (can't remember which). Have a look around in there to see if you can find it (it'll be a .class file with a name that looks similar to the tagfile). If the tag is indeed being recompiled every time, that file will be refreshed each time. If yoy can't find the class file at all, it may that JBoss cann't create the temporary compiled version (maybe due to a file permission problem), and so is forced to recompile every time.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文