Hi.

Have added exception handling, as below, and sent new copy of tags to Oleg to
commit.

Cheers,

Dave




Ted Husted <[EMAIL PROTECTED]> on 07/23/2001 04:41:48 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:    (bcc: David Hay/Lex/Lexmark)
Subject:  Re: Hot to get the iterated objects ?



The Struts tags often throw exceptions, but I don't believe any write to
a log. They do record the Exception in the request context though, so it
can be reported elsewhere (e.g. an JSP error page). Here's an example
from interate:

     else {
         JspException e = new JspException
             (messages.getMessage("iterate.iterator"));
            RequestUtils.saveException(pageContext, e);
            throw e;
        }

The messages for the exceptions are in <
taglib\logic\LocalStrings.properties >.

Sorry I could help with committing the indexed tag, but I haven't had a
chance to use it myself.


[EMAIL PROTECTED] wrote:
>
> Hi Hal,
>
> Oleg has siad he will incorporate the tag changes - just mailed him to inquire
> when he thinks this will take place (I'm on vacation for 2 weeks from this
> Friday).
>
> Am very happy to insert an exception - wasn't sure how the rest of Struts tags
> handle this type of situation.
>
> Does anyone else have a problem with throwing exception, rather than just
> writing to log?
>
> Cheers,
>
> Dave
>
> "Deadman, Hal" <[EMAIL PROTECTED]> on 07/23/2001
> 01:14:00 PM
>
> Please respond to [EMAIL PROTECTED]
>
> To:   "'Struts Dev List'"
<[EMAIL PROTECTED]>
> cc:    (bcc: David Hay/Lex/Lexmark)
> Subject:  RE: Hot to get the iterated objects ?
>
> I am looking forward to the seeing indexed tags in the nightly build. Has a
> commiter signed up to incorporate the indexed tag changes?
>
> As for feedback on the code, I don't think it's appropriate to blow off the
> whole tag without comment if the tag with indexed="true" is not nested in an
> iterate tag. I think an exception should be thrown instead. If an exception
> isn't thrown then something needs to be written to the log file.
>
> change:
>       IterateTag iterateTag = (IterateTag) findAncestorWithClass(this,
> IterateTag.class);
>       if (iterateTag == null)
>       {
>          // this tag should only be nested in iteratetag, if it's not, don't
> do anything
>          return EVAL_PAGE;
>       }
>
> to:
>       IterateTag iterateTag = (IterateTag) findAncestorWithClass(this,
> IterateTag.class);
>       if (iterateTag == null)
>       {
>          // this tag must only be nested in an IterateTag when indexed
> attribute is "true"
>         throw new JspException(messages.getMessage("some.messagekey");
>       }






Reply via email to