>From http://jakarta.apache.org/struts/userGuide/struts-bean.html#define
The <bean:define> tag differs from <jsp:useBean> in several ways,
including:
* Unconditionally creates (or replaces) a bean under the specified
identifier.
* Can create a bean with the value returned by a property getter of
a different bean (including properties referenced with a nested
and/or indexed property name).
* Can create a bean whose contents is a literal string (or the
result of a runtime expression) specified by the value attribute.
On Sun, 2003-03-30 at 00:47, Jeff Smith wrote:
> I have some data in an XML file.
>
> I read it in from JSP using <x:set> (the JSTL X tags)
>
> I then transfered it to a variable like so:
> <c:set var="somevarname">
> <x:out ... />
> </c:set>
>
> I can now dump it out happily using <c:out>
>
> It turns out that this particular value (an integer) is useful in a
> subsequent JSP page (if my user elects to go there by clicking the
> appropriate link). So I want to pass it as a parameter when I link to that
> next page.
>
> Aha! the <html:link> allows me to add parameter information. But it appears
> that such info must be in a bean.
>
> So I created a bean:
> <jsp:useBean id="foo" class="java.lang.String"/>
>
> But for all my efforts, I can't figure out how to get the "somevarname"
> value into "foo"
>
> I tried:
> <jsp:useBean id="foo" class="java.lang.String"><c:out
> value="${somevarname}"/></jsp:useBean>
> but that isn't working. (Subsequent attempts to <bean:write name="foo"/>
> come up blank.)
>
> I just know when I wake up tomorrow, the answer is going to be obvious and
> I'm going to feel stupid for asking. But one of the advantages of working
> late without much sleep is that we don't care how we're going to feel about
> it in the morning.
>
> Any suggestions?
>
> Jefficus
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]