>From: Dominik Böhm <[EMAIL PROTECTED]> 
>
> Hello, 
> 
> I am doing my first steps with Shale and ran into some problems with 
> Shale Tiger. I think the @Property-annotation has the same semantics as 
> the managed-property thing in the faces-config.xml. Main difference 
> seems to be that @Property only supports non-null values whereas 
> managed-property also has a subproperty "null-value". I had a look at 
> the ManagedPropertyConfig.class in the Tiger source code and found out 
> that there actually is also a nullValue-property for Tiger-Managed 
> properties. But how can I tell with a @Property annotation that I want 
> that property to start with a null value? I tried the following: 
> 
> 1. @Property(name="newUser", value=null) 
> private User newUser; 
> 
> That doesn't work as java tells me that "value must be a constant 
> expression". 
> 
> 2. @Property(name="newUser", value="") 
> private User newUser; 
> 
> That doesn't work as shale searches for a converter from String to User 
> but cannot find one. That results in a null pointer exception. 
> 
> Maybe I am missing something but it seems that shale tiger is not able 
> to work wih nullValue-properties if I'd like to define them using 
> annotations. 
> 
> I hope someone can help me find out how to use tiger here. 
> 

The Property value annotation only supports a literal string and a value 
expression.
You might consider something like the following:

@Property(name="newUser", value="#{param['javax.faces.null-value']}") 

The 'javax.faces.null-value' will not be resolved as a request parameter and 
return null.

> Thanks a lot in advance and best regards 
> Dominik 
> 

Gary

> 
> PS: I am sorry, if i sent this message twice to the user list. 

Reply via email to