Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sending 404 error (with jsp includes)

843840Jun 19 2008 — edited Jun 25 2008
Hi all,
I am having some problems with a 404 error and JSP include tags, maybe anyone know the problem or the solution to it.
I have reduced the problem as much as I can to the next scenery:

index1.jsp
---------------
<jsp:include page="/index2.jsp"/>
index2.jsp
---------------
<%
response.sendError(HttpServletResponse.SC_NOT_FOUND);
%>
 
<jsp:include page="/index3.jsp"/>
index3.jsp
---------------
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
HELLO
</body>
</html>
If i call to index3.jps
HELLO is displayed and 20OK is coming back form my server

If i call to index2.jsp
404 error is coming, like expected.

But (there is the problem), if i call to inde1.jsp
HELLO is displayed and 20OK is coming back form my server

But should display a 404 error, right? This problem is drive me crazy. Any ideas?
Move the snippet :
<%
response.sendError(HttpServletResponse.SC_NOT_FOUND);
%>
to index1.jsp works, but i need to have that code in index2.jsp (like i said at the beginning i have reduced at maximum the problem).
Many thanks in advance, and my apologies if the question is not in the right forum or i miss any rules of the forum.
Regards,
David.

Edited by: highwayman on Jun 19, 2008 4:05 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 23 2008
Added on Jun 19 2008
8 comments
2,251 views