JSTL EL: How to do "instanceof"?

K

Kai Grossjohann

I have code in some JSPs that throws exceptions. I would like to
specify what happens depending on the exception class.

In Java, I can say:

try {
... some code ...
} catch (FooException e) {
... handle one kind of exception ...
} catch (BarException e) {
... handle another kind of exception ...
}

In JSP, I say:

<c:catch var="exc">
... some code ...
</c:catch>
<c:if test="${exc != null}">
... handle exception ...
</c:if>

The question is, in the "handle exception" part, how to do different
things depending on the class of the exception?

It seems that the EL includes a reserved word "instanceof" but it
isn't used yet.

Using Tomcat 4.1 with JSTL 1.0.

Kai
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top