开发者

Error in includign jspf

开发者 https://www.devze.com 2023-03-02 19:29 出处:网络
I want to make include jspf into index jsp page , these statements <%-- any content can be specified here e.g.: --%>

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 pag开发者_开发问答e="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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消