You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andrew Martin <An...@ictu.nl> on 2007/02/08 09:04:05 UTC

bean:define

I am having problems defining a bean with a Session Object value.
I want to retrieve the Object within the JSP and display navigation depending on the values within the session

Any ideas?

I can only get it working when I check directly in JSP for the the session within the logic:present tag. I would prefer to place the value in a bean and use the properties of the bean.

Andrew

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: bean:define

Posted by Yee Kai Lai <ye...@hotmail.com>.
class FormBean() {

   private String xxx;

  public String getXXX() {
   return this.xxx;
}

public void setXXX(String xxx) {
  this.xxx = xxx;
}

}


session.setAttribute("formbean",new FormBean().setXXX("yyyy"));
FormBean oFormeBean = (FormBean)session.getAttribute("formbean");
String xxx = oFormeBean.getXXX();

>From: "Andrew Martin" <An...@ictu.nl>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Subject: bean:define
>Date: Thu, 8 Feb 2007 09:04:05 +0100
>
>I am having problems defining a bean with a Session Object value.
>I want to retrieve the Object within the JSP and display navigation 
>depending on the values within the session
>
>Any ideas?
>
>I can only get it working when I check directly in JSP for the the session 
>within the logic:present tag. I would prefer to place the value in a bean 
>and use the properties of the bean.
>
>Andrew
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Get an advanced look at the new version of Windows Live Messenger. 
http://get.live.com/messenger/overview


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org