Solved

dymanic include in jsp -- is it possible?

Posted on 2007-12-04
2
210 Views
Last Modified: 2011-10-03
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
Comment
Question by:jmarkfoley
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 20406490
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
 
LVL 1

Author Comment

by:jmarkfoley
ID: 20406756
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now