[ 
https://issues.apache.org/struts/browse/WW-3306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46993#action_46993
 ] 

Andreas Krüger edited comment on WW-3306 at 10/30/09 1:23 AM:
--------------------------------------------------------------

Excuse me, but what is happening for the ACTION is what we need.
What happens for the MODEL is the BUG, as far as we are concerned.

The property is found allright. It's just that its value happens to be null.
So there is no reason to complain about the property's not being found.
There's nothing wrong with null.

This is no longer the 80s. This is Java, this in no longer C.

In C, returning something weird meant "error".

In 2009, in Java, if our property's get-er wants to communicate an error,
it throws an exception.

We have found exceptions to provide a much superior error handling interface
compared with that old "weird return value to communicate errors" stance
that we used back in the old C days.

How do we explain to Struts that, at least in our project's opinion how to 
program in Java,
null is just fine and should be treated same as ""?

The only way we have found to explain this to struts is,
saying "struts.el.throwExceptionOnFailure=false" .

We are very unhappy about having to say that.

      was (Author: andreas.krueger):
    Excuse me, but what is happening for the ACTION is what we need.
What happens for the MODEL is the BUG, as far as we are concerned.

The property is found allright. It's just that its value happens to be null.
So there is no reason to complain about the property's not being found.
There's nothing wrong with null.

This is no longer the 80s. This is Java, this in no longer C.

In C, returning something weird meant "error".

In 2009, in Java, if our property's get-er wants to communicate an error,
it throws an exception.

We have found exceptions to provide a much superior error handling interface
compared with that old "weird return value to communicate errors" stance
that we used back in the old C day.

How do we explain to Struts that, at least in our project's opinion how to 
program in Java,
null is just fine and should be treated same as ""?

The only way we have found to explain this to struts is,
saying "struts.el.throwExceptionOnFailure=false" .

We are very unhappy about having to say that.
  
> Null value accepted from action property, but not model property when 
> throwExceptionOnFailure=true
> --------------------------------------------------------------------------------------------------
>
>                 Key: WW-3306
>                 URL: https://issues.apache.org/struts/browse/WW-3306
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Value Stack
>    Affects Versions: 2.2.0
>            Reporter: Andreas Krüger
>
> In this project, we experiment with setting 
> struts.el.throwExceptionOnFailure=true to catch errors.
> We use <s:property value="myprop" /> in our JSP.
> Occasionally, the property thus referenced is null. We want struts to insert 
> an empty string in that case.
> This it duely does, when either struts.el.throwExceptionOnFailure=false or 
> when the property is from an action object.
> However, if the property is from a model object and 
> struts.el.throwExceptionOnFailure=true, this bombs out.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to