Question

This line:

/${initParam['webinf']}${initParam['test']}header.jsp

Prints out:

/WEB-INF/test/header.jsp and if I copy this into:

<%@ include file="/WEB-INF/test/header.jsp" %> it works perfectly.

However, if I use the first line of code directly in the statement like this:

<%@ include file="/${initParam['webinf']}${initParam['test']}header.jsp" %>

I get the error:

Sun Feb 16 15:03:56 GMT 2014: org.apache.jasper.JasperException: /WEB-INF/test/index.jsp (line: 10, column: 9) File "/${initParam['webinf']}${initParam['test']}header.jsp" not found

Was it helpful?

Solution

You should use

  <jsp:include page="..." /> 

This will evaluate JSP EL in "...".

Some more info here Include another JSP file

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top