是否有可能将动态路径作为jsp include的一部分 [英] Is it possible to have a dynamic path as part of a jsp include

查看:92
本文介绍了是否有可能将动态路径作为jsp include的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的jsp中有一个包含文件

I have a include file in my jsp

    <%@ include file = "includes/testinclude1.jsp" %>

Test Include1包含struts标记,因此需要引入并进行编译.哪个行得通.是否可以通过某种方式使此文件的路径动态化,或者我是否正在重新考虑设计?

Test Include1 contains struts tags, and therefore needs to be pulled in and compiled. Which works ok. Is there a way to make the path for this file be dynamic in any way or am I looking at a rethink in terms of design?

推荐答案

您可以使用<jsp:include page="...">标记代替仅用于静态引用的静态<%@ include %>.

You can the <jsp:include page="..."> tag instead of the static <%@ include %> which only works for static references.

这篇关于是否有可能将动态路径作为jsp include的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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