[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    RE: Redirect-Action type result warns of caught exception when passing param
From:       "Brad A Cupit" <brad () lsu ! edu>
Date:       2008-04-30 20:03:22
Message-ID: 1D5C148F9259BC47BC3CBD2F76ABA205F49AAF () email002 ! lsu ! edu
[Download RAW message or body]

> I'm of the opinion that an exception in my
> console means something is amiss though...

you've stumbled upon a little wart in the code. First things first, the
exception is harmless and can be safely ignored.

A more detailed explanation can be found in a comment within
ObjectFactory.buildResult(..), posted below (slightly reformatted):

// ognl exceptions could be thrown and be ok if, for example, the result
// uses parameters in ways other than as properties for the result
object.
// For example, the redirect result from Struts 2 allows any parameters
// to be set on the result, which it appends to the redirecting url.
// These parameters wouldn't have a corresponding setter on the result
// object, so an OGNL exception could be thrown.  Still, this is a
misuse
// of exceptions, so we should look at improving it.

Basically, parameters for the result are first set via setters on the
Result object itself. If they don't exist, an exception is thrown and
ignored. ServletRedirectResult and ServletActionRedirectResult both use
params to mean "query string/url parameters" as opposed to properties on
the Result object, so when using params on ServletRedirectResult or
ServletActionRedirectResult, the exception is expected and acceptable.

Brad Cupit
Louisiana State University - UIS

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic