2

I want to make include jspf into index jsp page , these statements

<%-- any content can be specified here e.g.: --%>
<%@ page pageEncoding="UTF-8" %>

aappears in the index page !!

here's the include line in index page

 <jsp:include page="WEB-INF/jspf/Header.jspf" />

Note : I make head and body in the index page only, can some body tell me why the first lines appears in the index page?

palAlaa
  • 9,500
  • 33
  • 107
  • 166

1 Answers1

9

JSPF files are intented to be statically included by @include. Its source code becomes then literally part of the parent JSP file. This happens only once, during compiletime.

<%@include file="/WEB-INF/jspf/Header.jspf" %>

If you want a compiletime include with <jsp:include> then just rename .jspf to .jsp. The source code will then be compiled once separately and its output will be generated and included during runtime. This happens then on every request.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • It works and fix the Arabic encoding problem too, I don't think making the include for header and footer at compile time r not good practice, what do u think Mr @BalusC ? – palAlaa May 03 '11 at 19:11