Is it possible to have a dynamic path as part of a jsp include

匆匆过客 提交于 2019-12-06 08:29:48

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

For anyone that is curious, I used a struts include tag, based on artbristols answer and managed to make it dynamic with OGNL. Thanks for all your input.

<s:include value="includes/templates/%{post.template.name}.jsp" />

yes

<%
    String usuarioTipo = uDTO.getNombreGrupo().toLowerCase();
    String menu = "../WEB-INF/../jspf/".concat(usuarioTipo).concat("/menu.jspf");
%>
<jsp:include page ="<%=menu%>"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!