At 11:40 AM +0100 2/23/05, Karsten Krieg wrote:
Hi!

It's been suggested to not continue using the Struts own tag libraries and
instead move on to the JSTL. With them, I'd construct the following for
your scenario:

while this is a good general suggestion, neither tag library makes it easy to deal with the class of an exception. I suppose technically you could use bean properties to test against the string form of an exceptions' class name:
<c:if test="${ex.class.name == 'java.lang.IllegalStateException'}">..</c:if>


but you might simply find Struts' own declarative exception handling to be a more straightforward way to deal with this...

Joe


<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>

<c:choose>
      <c:when test="${exception1}">
            your content
      </c:when>
      <c:when test="${exception2}">
            your content
      </c:when>
</c:choose>

You can nest the c:when and c:choose, so AND and OR constructs are
possible.

With regards
Karsten Krieg
intarsys consulting GmbH
----------------------------------------
Fon +49 (0)721 3 84 79 - 28
Fax +49 (0)721 3 84 79 - 60
e-mail [EMAIL PROTECTED]
http://www.intarsys.de
----------------------------------------

"Ashutosh Satyam" <[EMAIL PROTECTED]> schrieb am 23.02.2005 11:19:48:

 Hi,
  Can you suggest how to use the logic tag library to achieve the
 following scenario.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  In my Action class I expect few Exceptions to be thrown. Incase if
 any exception
  is throw it's always redirected to a common 'error.jsp' page.

  In this page I wanted to use 'logic' taglibrary to present a
 different content in the
  page based on the Exception thrown.

  Something like -
   if( Exception1) {
     some html contents
 } else if(Exception2) {
     some html contents
 } else {
    some html contents
 }

 Also how do we achieve logical AND and logical OR condtion using
 logic tag library

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  I hope we can use the logic taglibrary in the scenario what I
 pointed out. An example
  for the same would suffice my requirement.

 Regards,
 Ashutosh






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to