Hi,

To answer to your questions:
1. Yes, it's the intended behaviour. As it's specified in most Stripes' tags 
like text 
(http://stripes.sourceforge.net/docs/current/taglib/stripes/text.html), Stripes 
tag uses the value attribute only if the ActionBean's properties is unavailable.
2. As you can see in the best practices page 
(http://www.stripesframework.org/display/stripes/Best+Practices), it's 
recommended to pre-populate domain objects using @Before. I suggest you do the 
same thing for all ActionBean's pre-population. It greatly simplifies the 
initialisation of fields in JSPs.

Christian

-----Message d'origine-----
De : Thomas Menke [mailto:stripe...@cipher-code.de] 
Envoyé : February-09-12 8:36 PM
À : Stripes Users List
Objet : [Stripes-users] Stripes:select: force to use the value attribute?

Hi @ll,

I have a JSP page that contains:

<stripes:select name="someName" value="someValue">
   <stripes:options-enumeration enum="someClass" />
</stripes:select>

After spending a good while trying to figure out why stripes would not 
set the selected="selected" flag even though simply adding ${someValue} 
next to the select revealed that the value passed to stripes was 
correct, I discovered that stripes would simply ignore the value I 
supplied if it can find another value querying the population strategy. 
The value I supplied is overwritten in class 
net.sourceforge.stripes.tag.InputSelectTag on line 125.

Unfortunately in my case stripes found such a value on my action bean.

This leaves me with two questions:
1. Is this really intended behaviour? After all, why would I use the 
value attribute if I did not mean it?
2. Is there anything I can do about the behaviour besides changing my 
variable names or changing/extending stripes tag-lib?

Thomas

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to