外部目录中的JSP文件 [英] JSP files in external directory
问题描述
在我的项目中,我们允许客户在JSP页面中编写客户特定的逻辑并附加到我们的产品。现在,在部署.ear文件之后,客户将自定义文件复制到/ WebContent / custom目录下,以便我们可以引用这些JSP。这是一个繁琐的安装过程,我想简化这个。
In my project, we allow customer to write customer specific logic in JSP pages and attach to our product. Right now after deploying .ear file customer copy the custom files under /WebContent/custom directory so that we can refer those JSPs. This is a tedious process for installation, I would like to simplify this.
我尝试了以下解决方案
1)extendedDocumentRoot - IBM WebSphere
当我将JSP保留在EAR部署目录之外时它工作正常
1) extendedDocumentRoot - IBM WebSphere It works fine when I kept the JSP outside the EAR deployment directory
2)OC4J - 此解决方案在OracleAS中也可以正常工作。
2) OC4J - This solution also works fine in OracleAS.
<virtual-directory virtual-path="/img" real-path="/e:/pictures/" />
我正在寻找所有J2EE容器的通用解决方案。
I am looking for a generic solution for all J2EE containers.
推荐答案
不。没有标准的方法来实现这一目标。这是服务器部署/配置的一部分,它超出了Servlet规范的范围。
No. There is no standard way to accomplish this. This is part of server deployment/configuration and it's out of scope for Servlet spec.
如果使用Tomcat,则必须使用另一种机制,
If you use Tomcat, you have to use yet another mechanism,
<Context aliases="/img=/e:/pictures/" ...>
这篇关于外部目录中的JSP文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!