Thanks, Ted!  You are the almighty Struts super-hero.  But, one more
question...

To use <bean:write....

Do I need to still declare the bean first with <jsp:bean....   ????

- Cody






Ted Husted <[EMAIL PROTECTED]> on 02/10/2002 09:18:18 AM

Please respond to Struts Users Mailing List
      <[EMAIL PROTECTED]>
To:   Struts Users Mailing List <[EMAIL PROTECTED]>
cc:
Subject:  Re: Setting a Bean in an Action and Getting it on a Page


You might find the Struts bean tags easier to use that the standard JSP
actions, since there is not as much red tape involved.

For example, to simply write your test string

<bean:write name="theUserList" property="testString"/>

is all that is needed. The tag will figure out the rest =:o)

http://jakarta.apache.org/struts/struts-bean.html

http://jakarta.apache.org/struts/api-1.0/org/apache/struts/taglib/bean/package-summary.html#package_description


If you need to expose testString as scripting variable, see the
bean:define tag.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/



[EMAIL PROTECTED] wrote:
>
> Can someone help me with this?
>
> 1.  In an Action, I populate the value of a Bean.
> 2. Then, in the Action, I put the Bean in the session like this:
>
>       session.setAttribute("theUserList",userList);
>
> 3.  On a JSP page, when I use tags to try to get at the Bean, however, I
> think
>      I am only creating new Beans. I am having some success because
>      my log4j statements show that I get into the Bean on the JSP page,
>      but I never get the value set by the Action, so I must be only
> creating
>      a new Bean everytime.
>
> So I guess the question is,
>
> what is the synax for accessing a bean which should already be in the
> session.  I have been using something akin to the following without
> success:
>
> <jsp:useBean id="theUserList" scope="request" class
> ="com.magneta.model.UserList"/>
> <jsp:getProperty name="theUserList" property="testString"/>
>
> Thanks,
>
> Cody
>
> ----------------------------------------------------------------
> The information transmitted is intended only for the person or entity to
> which it is addressed and may contain confidential and/or privileged
> material.  Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipient is prohibited.   If you
received
> this in error, please contact the sender and delete the material from any
> computer.
>
> --
> To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>




----------------------------------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error, please contact the sender and delete the material from any
computer.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to