Enrico,

The jstl taglib ("c:") has sessionScope as implicit object, but i'm not too 
sure stripes' taglib has that as well. Stripes might be expecting a 
getSessionScope() method from your action bean?

You could either try a c:set var to store the lidNummer: <c:set var="lidNr" 
value="${sessionScope.lid.lidNummer}" />, and then feed that variable in the 
s:hidden field.

Or, provide a getLidNummer in your action bean and access it through the 
ActionBeanContext. (getRequest().getSession().getAttribute(...))

A 3rd option:
Many stripes apps subclass the actionbeancontext to expose session scoped 
stuff. If you create a get/setLid method in the actionbeancontext, you could 
access it from your form as "${context.lid.lidNummer}" (see also 
http://stripesframework.org/display/stripes/State+Management)

Hope this helps, Greets Rolf

Van: Enrico Iorio [mailto:writetoenr...@gmail.com]
Verzonden: dinsdag 4 oktober 2011 11:33
Aan: Stripes Users List
Onderwerp: [Stripes-users] s:hidden value transfer issue

Dears

I have some very strange problem with sending an integer value to an ActionBean 
from a jsp via a <s:hidden> tag.
Basically i have a bean called Lid which represents an user and that after 
log-in is stored in the session (successfully), this bean has an attribute 
"lidNummer" and its respective getter-setter.

In the action bean that uses the Lid object, i have the setter to assign a 
value coming from a form, i dont use a direct-feeding (e.g lid.lidNummer), so i 
have (in action bean):
--------------////

private int lidNummer=0;

public void setLidNummer(int lidNummer){

this.lidNummer=lidNummer;

}

-----------////

this is the hidden tag that i have in the jsp and that "should" feed the 
attribute with its setter:

--------------////

<s:form beanclass="path.to.ActionBean">

<s:hidden name="lidNummer" value="${sessionScope.lid.lidNummer}"/>

 //rest of form "form works fine"

--------------////

The problem is that the value sent from the <s:hidden> tag is 0 when it should 
be different "should be the number of the user which is logged in"

The "funny thing" is that if i add to the jsp this piece of JSTL:

--------------////

<s:form beanclass="path.to.ActionBean">

<c:out value="${sessionScope.lid.lidNummer}"/>

<s:hidden name="lidNummer" value="${sessionScope.lid.lidNummer}"/>
 --------------////

The out method prints the correct value of the lidNummer value.
It's like Stripes cannot access the lid object into the session, very strange.
Do you have some idea?


--
Enrico Iorio
________________________________

Geen virus gevonden in dit bericht.
Gecontroleerd door AVG - www.avg.com<http://www.avg.com>
Versie: 10.0.1410 / Virusdatabase: 1520/3936 - datum van uitgifte: 10/03/11
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to