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

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

You have written this stuff? Wonderful! Please kindly advice, if you would:

In our project, we want both of these two simultaniously:

* If a property is null, nothing happens and nothing get written to the output. 

* Make Struts throw an exception when either an EL expression uses an invalid 
property (that is, there is no getter matching the property, or the getter is 
not accessible) or else when an exception is throw (out of whatever gets called 
by the EL expression).

Is there a way to have Struts EL to do BOTH of these things, and, of course, 
consistently for both action and model?

      was (Author: andreas.krueger):
    You have written this stuff? Wonderful! Please kindly advice, if you would:

In our project, we want both of these two simultaniously:

* If a property is null, nothing happens and nothing get written to the output. 

* Make Struts throw an exception when either an EL expression uses an invalid 
property (that is, there is no getter matching the property, or the getter is 
not accessible) or else when an exception is throw out of the getter.

Is there a way to have Struts EL to do BOTH of these things, and, of course, 
consistently for both action and model?
  
> 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