Hi Musachy,

 

                  I appreciate the assistance, it worked.

-Farshad

 


> Date: Fri, 10 Jul 2009 13:08:00 -0700
> Subject: Re: assigning a JSP variable a value coming from <s: property>
> From: musa...@gmail.com
> To: user@struts.apache.org
> 
> do something like:
> 
> <s:set var="myId" value="..." scope="page"/>
> 
> then in your scriplet, get a reference to the page context (cant
> remember the API) and do a getAttribute("myId") on it.
> 
> musachy
> 
> On Fri, Jul 10, 2009 at 12:20 PM, Farshad
> Rabbani<farshadrabb...@hotmail.com> wrote:
> >
> > Hi Everyone,
> >
> >
> >
> >
> > I am trying to create a java variable in the jsp scriplet and assign it a 
> > value coming from <s: property> tag
> >
> > so for example
> >
> > <%
> >
> >          int id = <s: property value="userId"/> ;
> >
> > %>
> >
> >
> >
> > I know the above is completely incorrect, but essentially, that is what I 
> > want to accomplish.  Can anyone give me any idea how this can be done?  
> > Thanks.
> >
> >
> >
> >
> >
> > My action class looks like:
> > public class UserAction extends ActionSupport implements SessionAware, 
> > DataSourceAware, UserAware, Preparable, ModelDriven
> > {
> >
> >
> >  private User loggedInUser;
> >
> >  private Map session;
> >  private DataSource dataSource;
> >  private int userId;
> >
> >
> >
> >
> >  public int getUserId()
> >  {
> >  return userId;
> >  }
> >
> >  public void setUserId(int userId)
> >  {
> >  this.userId = userId;
> >  }
> >
> >
> >
> > _________________________________________________________________
> > Hotmail® has ever-growing storage! Don’t worry about storage limits.
> > http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_________________________________________________________________
Insert movie times and more without leaving Hotmail®. 
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009

Reply via email to