• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

dymanic include in jsp -- is it possible?

I have:

<%@ include file="faq.txt" %>

That works fine. What I would like is for the filename to be variable such as:

<%@ include file=getParameter("faqFile") %>

that doesn't work. Is there a way to do this?
0
jmarkfoley
Asked:
jmarkfoley
1 Solution
 
objectsCommented:
u need to use jsp:include for dynamic include

http://java.sun.com/products/jsp/tags/11/syntaxref1112.html

be aware that the two behave differently
0
 
jmarkfoleyAuthor Commented:
OK, that gave *almost* enough detail for my solution. I had to play around a bit but this works:

<jsp:include page="<%=request.getParameter("faqFile")%>" />
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now