Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 75685 invoked from network); 26 Oct 2005 15:36:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Oct 2005 15:36:32 -0000 Received: (qmail 87112 invoked by uid 500); 26 Oct 2005 15:35:24 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 87052 invoked by uid 500); 26 Oct 2005 15:35:24 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 86973 invoked by uid 99); 26 Oct 2005 15:35:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Oct 2005 08:35:23 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [194.217.242.88] (HELO anchor-post-30.mail.demon.net) (194.217.242.88) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Oct 2005 08:35:20 -0700 Received: from steve-kirk.demon.co.uk ([80.177.0.37] helo=sjkdesktop) by anchor-post-30.mail.demon.net with esmtp (Exim 4.42) id 1EUnIq-0004pR-2g for users@tomcat.apache.org; Wed, 26 Oct 2005 15:35:01 +0000 From: "Steve Kirk" To: "Tomcat users list" Subject: RE: Should a missing jsp:include target cause TC to throw an exception or HTTP error code? Date: Wed, 26 Oct 2005 16:34:45 +0100 Message-ID: <00fb01c5da42$d1beb440$0201a8c0@sjkdesktop> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 Importance: Normal In-Reply-To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I got no reply to my first post (below), maybe I was too wordy, so here's a short version of the Q: If I include a JSP fragment within another JSP page like this: but the file "test.jsp" does not exist, should TC throw an Exception? Or maybe an HTTP 404? I have a case like this where TC ignores the include altogether, wondering why no error reported by TC. > -----Original Message----- > From: Steve Kirk [mailto:tomcat-user@web-startup.co.uk] > Sent: Friday 21 October 2005 18:57 > To: 'users@tomcat.apache.org' > Subject: Should a missing jsp:include target cause TC to > throw an exception or HTTP error code? > > > > TC 5.5.9 > WinXP SP2 > JDK 1.5.0_02-b09 > > My webapp framework is based around my own Invoker servlet, > which response to every request via a generic JSP build page. > This build page itself includes other files, as shown in > this snippet: > > "_begin.jsp" %>" /> > > "_end.jsp" %>" /> > > Each request to the webapp is received by a servlet, which > forwards to the JSP snippetted above to render the response, > and the JSP decides which JSPFs to assemble to customise the > response layout according to the request. > > This all worked fine. Then I accidentally omitted 2 JSP > fragment files from the war file when reorganising my code - > the files referred to in lines 1 and 3 above. I would expect > that to cause a runtime exception of some sort if the target > files don't exist. (Right?) However, no exception is thrown. > The build page (that calls the jsp:includes) just carries on > and assembles the rest of the page, omitting the files that > it can't find. Hmmmmm. Sort of nice that it doesn't > complain, but also sort of worrying. > > Having had a brief look at the TC source, I focused on the > source code of org.apache.jasper.servlet.JspServlet:279, > which appears to show that if the jsp:include file cannot be > found at the specified URI, then TC will return an HTTP 404 > status code in this situation, if I am understanding it correctly: > > // snippet from JspServlet#serviceJspFile > > if (null == context.getResource(jspUri)) > { > > response.sendError(HttpServletResponse.SC_NOT_FOUND, jspUri); > // this is the line in the stacktrace > return; // to calling JspServlet#service() method > } > > But, the weird thing is, my current TC server does not appear > to do that. Each page is returned with a SC of 200. No > exceptions logged at all. The only defect is that the > response pages don't include the two JSPF files. > > I'm concerned that I have done something to the config of my > webapp that is suppressing the error somehow. But I also > realise that I might have misinterpreted what I have read of > the TC source files. > > So I have two questions please: > > Q1: have I understood correctly, that TC should throw an > exception or HTTP SC if it can't find a jsp:include file when > processing a JSP? > > Q2: what might I have done that could suppress this sort of error? > > There is more to this problem, but I won't post the next > chapter because the answers to Q1 and Q2 might change what is > relevant for me to post. > > Thanks. > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org