Yes!!! I agree to it. I hope it depends upon the kind of Application Server
we
are using, and its implementation of JSP specs. For me, WebSpehere
Application
Server never posed this kind of problem. I don't have any statistics about
others.

-ShriKant

A mailing list about Java Server Pages specification and reference wrote:

> I totally agree that we should avoid using try/catch-blocks in our JSPs.
> They belong in servlets, beans and tags.
> BUT when the JSP is compiled into a servlet all of the code is included
> into
> one big try/catch - at least all our pages in Resin, I don't know if
there
> are any conditions.
>
> For example it can look like this:
>     try {
>       ... JSP ...
>     } catch (java.lang.Throwable _jsp_e) {
>       pageContext.handlePageException(_jsp_e);
>     } finally {
>       ...
>     }
>
> What this comes to is: long page -> long try catch.
> Though Resin puts all the static HTML in String variables, which then is
> written inside the big try/catch. That way the code inside the try/catch
> will not be too long even if we have lots of (static) text on the page.
>
> In my opinion the root of the discussion is: Why is there a limit to the
> amount of code allowed inside the try/catch? What sets this limit, the
JVM
> or the JSP container?
>
> > Mattias......
> > I agree to your point of view. You have expended the explanation which
> was
> > subject of question. But don't you think we are hiding the real issue.
> These
> > are round-abouts of the problem when we have that much of code existing
> in
> > the JSP. But my intention is to avoid that much of code (using
try-catch
> block)
> > entirely from the JSP, doing all kind of exception handling in the bean
> > itself. Further using dynamic include always, is not necessary when
that
> much of
> > code is used in 1-2 JSPs only. For performance reasons compile time
> include is
> > the better option if possible.
>
> Mattias Jiderhamn
> Expert Systems
> [EMAIL PROTECTED]
>
>
===========================================================================
> 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://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

===========================================================================
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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to