Andres,
That is exactly what we do... i.e. a skeleton class subclass of
BeanFirstPopulationStrategy
However, I wasn't previously aware of the web.xml init parameter:
<init-param>
<param-name>PopulationStrategy.Class</param-name>
<param-value>net.sourceforge.stripes.tag.BeanFirstPopulationStrategy</param-value>
</init-param>
... that appears to accomplishes the same thing and for me at least is
MUCH more explicit.
i.e. I really like the way Stripes picks up everything in an extensions
folder but the above option for me at least makes it clear to new
programmers that this option is explicitly different from its default.
Thanks Ben.
--Nikolaos
andres wrote:
I know how to do it. For those who find the same problem the solution is.
You have to create (on stripes package extensions) class
your package ...
public class MyPopulationStrategy extends BeanFirstPopulationStrategy{
}
As it stands, empty...
And it work perfect, Stripes is a very good framework!
Thanks to Ben Gunter suggested to me.
Greetings to everyone.
--- El *sáb, 22/1/11, andres /<ispanand...@yahoo.es>/* escribió:
De: andres <ispanand...@yahoo.es>
Asunto: Re: [Stripes-users] Question about Stripes form
Para: "Stripes Users List" <stripes-users@lists.sourceforge.net>
Fecha: sábado, 22 de enero, 2011 21:27
Thank you very much my friend for the answer, I'll see it.
--- El *sáb, 22/1/11, Ben Gunter /<gunter...@gmail.com>/* escribió:
De: Ben Gunter <gunter...@gmail.com>
Asunto: Re: [Stripes-users] Question about Stripes form
Para: "Stripes Users List" <stripes-users@lists.sourceforge.net>
Fecha: sábado, 22 de enero, 2011 17:34
Form inputs are populated by the PopulationStrategy.
DefaultPopulationStrategy, which you are probably using right
now, populates an input's value first from a request parameter
having the same name as the input, if any, then from the
(nested) property of the form's ActionBean, and finally from
the "value" attribute.
You can change to BeanFirstPopulationStrategy to reverse the
first two. That is, the value will be pulled first from the
ActionBean property then from the request parameter then from
the "value" attribute. To switch the whole application to
bean-first, add the following to your StripesFilter configuration:
<init-param>
<param-name>PopulationStrategy.Class</param-name>
<param-value>net.sourceforge.stripes.tag.BeanFirstPopulationStrategy</param-value>
</init-param>
In my opinion, the default strategy is the better one.
Bean-first can be useful sometimes, as in this case. Ideally,
one would be able to switch between the two as needed. Such a
strategy is described here
http://www.stripesframework.org/display/stripes/Overriding+PopulationStrategy+per+ActionBean
-Ben
On Sat, Jan 22, 2011 at 2:54 AM, andres <ispanand...@yahoo.es>
wrote:
Hello everyone.
I have a question about Stripes form.
I want to change hidden value in the form from action, but
Stripes do not want to do it.
My form
action="/Test/newSearch" <s:form method="post">
name="item" <s:hidden value="${item}"/>
name="item.filterText" <s:text
value="${actionBean.item.filterText}"> </ s: text>
<! - not does change the value (my problem here) ->
name="item.filterPageIndex" <s:hidden
value="${actionBean.item.filterPageIndex}"
id="filterPageIndex"> </ s: hidden>
<! - value was changed and Can Be viewed with c: out ->
<c:out value="${actionBean.item.filterPageIndex}"> </ c: out>
class="buttons" <s:submit title="Search" name=""
value="Search"/>
</ s: form>
ActionBean
.....
ItemVO private item;
ItemVO public getItem () {
return item;
}
public void setItem (ItemVO item) {
this.item = item;
}
Resolution newSearch public () {
/ / print form input values
log.debug ("filterText text" + getItem (). getFilterText ());
log.debug ("filterPageIndex value" + getItem ().
getFilterPageIndex ());
/ / change form hidden value (I want to change hidden value)
getItem().setFilterPageIndex (1);
return new ForwardResolution ("/ jsp / test.jsp");
}
....
Value received from action was changed, my question is why
Stripes did not change hidden field? I've done something
wrong?
Thank you very much.
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49
USD value)!
Finally, a world-class log management solution at an even
better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users
-----Adjunto en línea a continuación-----
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD
value)!
Finally, a world-class log management solution at an even
better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
-----Adjunto en línea a continuación-----
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users
-----Adjunto en línea a continuación-----
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better
price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
-----Adjunto en línea a continuación-----
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
</mc/compose?to=Stripes-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/stripes-users
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users