You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Musachy Barroso <mu...@gmail.com> on 2009/12/01 17:14:19 UTC
Re: S2.1.8.1: Need something similar to struts.el.throwExceptionOnFailure
for and
On Tue, Dec 1, 2009 at 3:41 AM, Robert Graf-Waczenski <rg...@lsoft.com> wrote:
> <s:textfield name="missingProperty"/>
so setting <s:textfield value="%{missingProperty}"/>
doesnt fail?
musachy
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2.1.8.1: Need something similar to struts.el.throwExceptionOnFailure
for and
Posted by Dale Newfield <da...@newfield.org>.
Robert Graf-Waczenski wrote:
> This is not a bug, it's a feature in Struts2 2.1.8.1 that you explicitly
> have to enable via a configuration option (which is what we did).
Oh! My bad. You're right, that could be a useful feature given certain
policies, I'm glad it's now there for those that want it. Yes, it does
sound like a bug that it doesn't work for all the tags. (And yes, I
think I'll enable this in my current project iff I'm in devMode.)
Without looking at the source, just judging from the infix "el" vs.
"ognl" it sounds like this must be at a different point in the stack
than "struts.ognl.logMissingProperties", which is what I was incorrectly
assuming this conversation was about. (Dang small screen that only lets
me see the first part of long subject lines! :-)
I guess the right answer is "please file a JIRA issue", but as always
"please file a JIRA issue with a patch" is better :-) (Assuming the
"upload patch/file" bit in JIRA has been fixed.)
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2.1.8.1: Need something similar to struts.el.throwExceptionOnFailure
for and
Posted by Robert Graf-Waczenski <rg...@lsoft.com>.
Dale Newfield schrieb:
> Robert Graf-Waczenski wrote:
>> <s:property value="%{missingProperty}"/> which correctly yields a
>> runtime error
>
> Unless you're in devMode, I don't want anything yielding a runtime
> error, I want it to proceed as best it can, and let me know so I can
> address any potential issue (the logging is a step forward from
> earlier versions where the failure was silent). If the s:property
> behavior you describe is encountered in a production environment ( ==
> outside of devMode) I would call that a bug.
This is not a bug, it's a feature in Struts2 2.1.8.1 that you explicitly
have to enable via a configuration option (which is what we did). Even
though the philosophy you describe is valid in its own regard, ours is
drastically different. Give me a runtime error, i know how to catch it
and extract all necessary information for my logging framework. Struts2
does offer a nice handling framework with exception interceptors and
everything, so i really like the problem to be thrown as early as
possible and leave it to the exception handler somewhere out there to
handle and log it.
Robert
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2.1.8.1: Need something similar to struts.el.throwExceptionOnFailure
for and
Posted by Dale Newfield <da...@newfield.org>.
Robert Graf-Waczenski wrote:
> <s:property value="%{missingProperty}"/> which correctly yields a
> runtime error
Unless you're in devMode, I don't want anything yielding a runtime
error, I want it to proceed as best it can, and let me know so I can
address any potential issue (the logging is a step forward from earlier
versions where the failure was silent). If the s:property behavior you
describe is encountered in a production environment ( == outside of
devMode) I would call that a bug.
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2.1.8.1: Need something similar to struts.el.throwExceptionOnFailure
for and
Posted by Robert Graf-Waczenski <rg...@lsoft.com>.
Dale Newfield schrieb:
>>
>>> so setting <s:textfield value="%{missingProperty}"/>
>>> doesnt fail?
>>
>> No, it doesn't fail, the text input field is rendered with empty
>> contents.
>
> That is the appropriate way for it to render if the property is indeed
> missing. Is a warning generated in your logs?
I would not call this appropriate. It should behave analogously to
<s:property value="%{missingProperty}"/> which correctly yields a
runtime error. A warning in the logs (which i guess would appear if i
would configure log4j properly) would not help because we use our own
custom-built logging framework, so we really need the system to throw a
runtime error for us to catch, handle and log.
Robert
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2.1.8.1: Need something similar to struts.el.throwExceptionOnFailure
for and
Posted by Dale Newfield <da...@newfield.org>.
Robert Graf-Waczenski wrote:
> Musachy Barroso wrote:
>> so setting <s:textfield value="%{missingProperty}"/>
>> doesnt fail?
>
> No, it doesn't fail, the text input field is rendered with empty
> contents.
That is the appropriate way for it to render if the property is indeed
missing. Is a warning generated in your logs?
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2.1.8.1: Need something similar to struts.el.throwExceptionOnFailure
for and
Posted by Robert Graf-Waczenski <rg...@lsoft.com>.
Musachy Barroso schrieb:
> On Tue, Dec 1, 2009 at 3:41 AM, Robert Graf-Waczenski <rg...@lsoft.com> wrote:
>
>> <s:textfield name="missingProperty"/>
>>
>
> so setting <s:textfield value="%{missingProperty}"/>
>
> doesnt fail?
>
> musachy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
No, it doesn't fail, the text input field is rendered with empty
contents. I would not like to be forced to use
value="%{missingProperty}" just for validation purposes alone. But you
are of course right in asking because i'm sure this helps narrowing down
the issue.
Robert
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org