tags:

views:

355

answers:

1

To include another file in JSP, we use the @include tag

<%@ include file="NameOfFile"%>

In my case i want to include a html file whose name will known during the run-time - i,e from Database.

How can I do this in JSP?

+3  A: 

simply using jsp:include :

<jsp:include page="<%= htmlFileName %>" />

It works in my project where the file is stored in session to reload correctly the part updated with ajax

Vinze
Thank you! I was struggling with the syntax and surfing for answers and yours was right to the point and it works for me.
mobibob