tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
Subject Re: missing if/else syntax (What about catch?)
Date Fri, 09 May 2003 04:06:25 GMT

I disagree about the need for a try, it would be redundant unless a
finally block was offered. However I agree with the need for catch to have
an argument taking an Exception type. I'm not sure if this is planned for
JSTL's next version, but I know I mean to add it to unstandard whenever I
get around to it.

Hen

On Thu, 8 May 2003, Mark R. Diggory wrote:

> Oh boy, got to get in on this one!
>
> So! What about "catch" folks??? Here we have a tag I've seldom found a
> use for. How am I supposed to use this tag? Seems counter-intuitive to
> not have a try block, doesn't it. On top of this, there is no fine
> grained control of exception catching in the catch tag, how do I catch
> one exception, but not another?
>
> I wrote my own taglib for exception handling thats container based:
>
> <ex:exception>
>     <ex:try>
> 	<!-- do something risky -->
>     </ex:try>
>     <ex:catch var="foo" class="your.own.Exception">
>          <c:out value="${foo.message}"/>
>     </ex:catch>
>     <ex:catch var="bar" class="java.lang.Exception">
> 	<%=bar.getMessage()%>
>     </ex:catch>
> </ex:exception>
>
>
> This works great for providing content for different exception cases, or
> possibly redirecting/forwarding to other jsp's/servlets/error pages for
> the different cases. It adheres to the try/catch paradigm, and to the
> container like structure of choose.
>
> -Mark
>
>  > Pierre IS JSTL. Shawn is his obedient servant.
>  >
>  > Think Count Dracula and Igor.
>  >
>  > The rest of the expert group are their zombie army.
>
> p.s. I think a better analogy might be Dr. Frankenstein and his
> assistant, Fritz! ITS ALIVE!!!!!!! JSTL, ITS ALIVE!!!!!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message