• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Include directive

 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic