Hi Tony,
        you could get the value of the bean referenced in your bean:write tag in
scriptlet code by looking up the object that is keyed to the bean's name in
the pageContext, and then assign it to your second variable. I think yoiu
might do it like this:

<%!

        Object message;
%>
<%
        message = pageContext.getAttribute( "messageTag", pageContext.SESSION );

%>

The pageContext object is what holds the objects in different apparent
scopes. It is an implicit object that can be accessed from jsp or scriptlet
code. Api doc can be found under javax.servlet.jsp.PageContext.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 11, 2001 9:43 PM
To: Struts Users Mailing List
Subject: How can I assign a value from a <bean:write> tag to a variable?



Hello

I have a <bean:write> tag

<bean:write name="messagestag" property="messageId" filter="true"/>

And want to assign this value to a variable I can use it in a scriptlet,ie
I want to do somehthing like

<% String messageId= <bean:write name="messagestag" property="messageId"
filter="true"/> ;
    String newMessageId = "http:/localhost?messageId=" + messageId;
%>

How can I do this?

Cheers

Tony






--
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]>

Reply via email to