wood burning stoves 2.0*
The moose likes JSP and the fly likes jsp:include in error page does not work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "jsp:include in error page does not work" Watch "jsp:include in error page does not work" New topic
Author

jsp:include in error page does not work

sanker san
Ranch Hand

Joined: Dec 17, 2004
Posts: 56
I've a normal jsp page for which errorpage is set to error.jsp. The normal jsp page and error jsp page contains <jsp:include page="header.html" flush="true"/>. If an exception is thrown after the jsp:include statement in the normal jsp page, the error page is not displayed(only the header of normal page is displayed). Infact, it doesn't execute the statments after jsp:include in error page. However, if the exception occurs before <jsp:include, then the error page is displayed without any problems.
normal jsp page:-
<%@ page import="imported classes" errorPage="systemError.jsp" %>
..
<jsp:include page="header.html" flush="true"/>
..

===========
error page:-
<%@ page import="imported classes" isErrorPage="true" %>
..
<jsp:include page="header.html" flush="true"/>
..

What is the solution to this pbm?
Vince Hon
Ranch Hand

Joined: Feb 11, 2003
Posts: 117
try this

<jsp:include page="header.html" flush="false"/>


Vince Hon<br /> <br />SCJP 1.4 | SCWCD | SCBCD <br /><a href="http://vincehon.homeip.net:8000/VJW" target="_blank" rel="nofollow">http://vincehon.homeip.net:8000/VJW</a>
Cecil Antony
Greenhorn

Joined: May 13, 2005
Posts: 5
Hi Sanker,

<jsp:include>(action) is not the same as the <%@ include file="1.html">(directive)
<jsp:include> is a Run time Addition of page. Since the Error is executed @ the start of the page. There is no Execution or the flow to the rest of the page.

Try with <%@ include file="1.html">(directive).. This might suffice to your problem.

Thanks,
Cecil.C.
sanker san
Ranch Hand

Joined: Dec 17, 2004
Posts: 56
Hi Vince,
flush="false" doesn't work as it is giving compilation errors. looks like flush="true" is must atleast for older versions.

Hi Cecil,
It is true that the jsp:include in normal jsp shdn't work as there is an exception is thrown, but the jsp:include in error page shd work, right? As u said, <%@include file=""%> will work but it is not dynamic like jsp:include, right?
 
 
subject: jsp:include in error page does not work