• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • 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?
1 Solution
u need to use jsp:include for dynamic include


be aware that the two behave differently
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")%>" />
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

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