如何使用jsp include将文件包含在应用程序之外(war) [英] How to Include a file outside the application (war) using jsp include

查看:56
本文介绍了如何使用jsp include将文件包含在应用程序之外(war)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用"jsp:include"在我的一个jsp文件中包含一个静态文件.当静态html文件位于应用程序文件夹中时,它可以正常工作.但是,如果将其保留在应用程序文件夹之外,则它不会包含在JSP文件中.

I am using "jsp:include" to include a static file in one of my jsp files. It works fine when the static html file is located inside the application folder. However if its kept outside the application folder it is not included in the JSP file.

注意:我已经为保存静态文件的文件夹创建了一个上下文,并且能够使用直接url查看html文件.

Note: I have created a context for the folder where the static file is saved and I m able to view the html file with direct url.

请帮助.

推荐答案

我已经使用 c:import 标记解决了这个问题.

I have solved this problem using the c:import tag.

要定义动态URL,我使用了bean:define标记.谢谢朋友的建议和帮助.

To define the dynamic URL I have used the bean:define tag. Thank you friends for the suggestions and help.

这篇关于如何使用jsp include将文件包含在应用程序之外(war)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆