hi folks.

thanx for your tips regarding ides. i just wanted to tell you that i
finally found out what the problem was by having a look at the generated
source-code (just in case someone else encounters this problem in
future...):
the value for the autoFlush-attribute in the @page-directive defaults to
"true" so when the exception in my tag occured output had already been sent
and the call of the JspWriter�s clear()-method raised a
java.io.IOException. the servlet 'decided' to include the page instead of
forwarding to it... that�s all!

see generated servlet�s code:

// error-page catch-block:
...
try {
  out.clear();
} catch (Exception __ignore) { // output already sent, too late, include
page instead
  pageContext.include("fehler.jsp");
  return;
}
...

i changed the attribute to autoFlush="false" and now everything works as
intended.

bye



                    Justin Owens
                    <justin@EOVISION.        An:     [EMAIL PROTECTED]
                    COM>                     Kopie:
                    Gesendet von: A          Thema:  Re: problem with catching 
exceptions from
                    mailing list             tags on the errorPage still remains
                    about Java Server
                    Pages
                    specification and
                    reference
                    <JSP-INTEREST@jav
                    a.sun.com>


                    27.04.2001 11:50
                    Bitte antworten
                    an A mailing list
                    about Java Server
                    Pages
                    specification and
                    reference






Guys,

With JRUN, Allaire actually lets developers have it for free.  Yesterday, I
downloaded it and installed it on my server for development.  It is only in
production environments that it requires purchase. Note also, the JRUN
developers edition will only allow three concurrent connections.


Justin

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Celeste Haseltine
Sent: Friday, April 27, 2001 4:35 PM
To: [EMAIL PROTECTED]
Subject: Re: problem with catching exceptions from tags on the errorPage
still remains


This is a little off topic, but if you are looking for a good JSP IDE, I
have to recommend JRUN Studio 3.1.  It has an integrated debugger for both
JSP's and Servelets, and it supports several version's of HTML (2.0, 3.0
and
4.0).  It also supports Javascript1.2, ASP, CFML tags, CF Data and Flow
control, DTD Entities and Elements and IFML, RTML, SML1.0, Standard VML,
and
VTML tags.  It's produced by Allaire, and I've used it for about a year,
and
really love it as a JSP/Servelet IDE.
You can download a 30 day trial version off of Allaire's web site.


Celeste
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Steffen Morawietz
Sent: Friday, April 27, 2001 8:37 AM
To: [EMAIL PROTECTED]
Subject: problem with catching exceptions from tags on the errorPage
still remains


yeah i�d love to. unfortunately i'm doing this jsp-stuff as a first
approach to jsp in my company so we don�t have the appropriate ide... we
got jbuilder3 - not capable of jsp so i recently rely on notepad(!).
so: if anyone has some experiences with this topic or can show me a better
way of error-handling in this context i�d be very grateful.

have a nice weekend, folks!

steffen



                    "M. Simms"
                    <prosys@bellatl        An:
<[EMAIL PROTECTED]>
                    antic.net>             Kopie:
                                           Thema:  FW: problem with
catching
exceptions from
                    26.04.2001             tags on the errorPage
                    16:59
                    Bitte antworten
                    an prosys






Best to apply a JSP source code debugger like Jbuilder4 for this one.....it
sounds hairy.

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]] On Behalf Of Steffen Morawietz
Sent: Thursday, April 26, 2001 8:18 AM
To: [EMAIL PROTECTED]
Subject: problem with catching exceptions from tags on the errorPage


hi folks.

i�m using my own taglib for generating dynamic tables. i�m also using the
errorPage-directive on all my pages (works fine).
the tags do all call a method getContent() in their doStartTag-method which
is used to build the html-content-string so when an error (e.g.
database-access) occurs in getContent() it throws a simple exception (incl.
message) which is caught in the doStartTag()-method. in this case i raise a
javax.servlet.jsp.JspTagException with the same message hoping it to be
registered on the page the tags are included in and then of course handled
by my error-page.

  public int doStartTag()
  throws javax.servlet.jsp.JspTagException {
    ...
    try {
      getContent();
    } catch (Exception e) {
      throw new javax.servlet.jsp.JspTagException(e.getMessage());
    }
    return SKIP_BODY;
  }

the error-page looks like this:

  <%@ page import="java.io.*,java.util.*" isErrorPage="true" %>
  <html>
  <head>
  <title>Error</title>
  </head>

  <body>

  Exception: <%= exception %><br>
  <br>
  Exception-Message:<br>
  <jsp:scriptlet>
    ByteArrayOutputStream ostr = new ByteArrayOutputStream();
    exception.printStackTrace(new PrintStream(ostr));
    out.print(ostr);
  </jsp:scriptlet>

  </body>
  </html>

astonishingly the the 3rd page (which contains the tags) outputs all
content until the exception occurred and then just appends the output of
the error page like this:

  <html>
  // normal output until exception occurs goes here...
  ...
  // the tag is called HERE
  <html>
  <head>
  <title>Error</title>
  </head>

  <body>

  Exception: <br>
  <br>
  Exception-Message:<br>

why isn�t the exception forwarded to the error-page but the error-page
included in the other page instead?

thanx 4 your help in advance!

greetings

steffen

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to