Juan,
If you are trying to include an error page everytime that there is an
error there are much better ways to do it. The way I handle error is to
create a jsp something like this...
"/ehandling/index.jsp"
<%@ page import="com.netstat.util.*" isErrorPage="true" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Stallion Leather - World class quality exceeding customer
expectations.</title>
<%@ include file="../includes/pagetop.jsp" %>
<%
/* Print the data to the users screen. */
%>
<div align="center">
There was an error:<br><br>
<%= exception %>
</div>
<% /* Print the bottom of the page. */ %>
<%@ include file="../includes/pagebot.jsp" %>
</html>
That is just a very simple error page. Then I have all other jsps in the
project declare there page attribute like this... <%@ page
import="com.netstat.util.*" errorPage="/ehandling/index.jsp" %>
This setup uses jsps built in error handling. This way if a page throws an
error you did not expect or code for the user still gets a nice looking
error page with a message they can report. Also, now instead of including an
error file everytime I look for error I can just do something like this.
try {
do some code
} catch (Exception e) {
throw new Exception("There was an error of some kind.<br>"
+ "<b>Additional Information:</b> " + e.getMessage());
}
This has worked very well for me and it allows me to changed the look of my
error messages in one place and also reduces the amount of code in each
individual jsp by a significant amount.
Craig Anderson
Director of Internet Services
Netstat Resources, LLC.
http://www.netstatresources.com
-----Original Message-----
From: Juan Esteban [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 01, 2000 10:01 AM
To: [EMAIL PROTECTED]
Subject: including files from JSPs
There all,
I'm train to include same kind of error message in some place from JSP
pages.
This message is placed into another file named errormessage.jsp.
I do not have any problem when I include this file once, using:
<%@ include file="errormessage.jsp" %>
but since this message is a generic error message, some times I have to
include
it more than one time in the same JSP page, and here is when I get an
compiling error
from tomcat that say:
org.apache.jasper.compiler.ParseException: Seen file \errormessage.jsp
already, maybe this is a recursive include?!
It is possible to include the same file more than one time in the same page?
Thank!
Juan