• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Include directive

 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can file attribute of include have scriplets?
I understand that file name must be available @ compile time and hence the variable that will have the name of the file will be declared as final.
<%! String path="path.jsp"; %>
<%@ include file="<%=path%>"/>

I get an error
org.apache.jasper.JasperException: /menu.jsp(5,0) File "/<%=path%>" not found
Which implies the container is expecting /<%=path%> as file name.


Please reply.
 
tanveer chowdry
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not possible to dynamically choose the file to include using static
However you can do this with jsp:include
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic