You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Mauricio T. Ferraz" <ma...@cilix.com.br> on 2003/11/24 21:27:32 UTC

I think ???

I want to create a scriptlet variable with tag struts, how can I do it???

for example:

I have:   
 String testStr = session.getAttribute("test");

but I don´t want use it, it´s ugly!!!

I saw the tag <bean:define id="testStr" property="test"/>

but whe I try show it with a expression ( <%=testStr%>)
I have canot resolve the symbol!!!! error!!!
But when I use the <bean:write name="testStr"/> I show the value, but I have to use <%=testStr%>


Anybody can help me?

RE: I think ???

Posted by Greg Dunn <gr...@mo.nisc.cc>.
If you need to use <%= testStr%> because nesting tags doesn't work then use
Struts-el instead.  You can do it in one line:

<html:text property="foo" value="${sessionScope.test}" />

<bean:define id="testStr" property="test"/> doesn't work because you haven't
specified the name attribute:
http://jakarta.apache.org/struts/userGuide/struts-bean.html#define  I think
you want to use

<bean:define id="testStr" name="test"/>


Greg


-----Original Message-----
From: Mauricio T. Ferraz [mailto:mauricio.tavares@cilix.com.br]
Sent: Monday, November 24, 2003 2:28 PM
To: Struts Users Mailing List
Subject: <bean:define> I think ???


I want to create a scriptlet variable with tag struts, how can I do it???

for example:

I have:
 String testStr = session.getAttribute("test");

but I don´t want use it, it´s ugly!!!

I saw the tag <bean:define id="testStr" property="test"/>

but whe I try show it with a expression ( <%=testStr%>)
I have canot resolve the symbol!!!! error!!!
But when I use the <bean:write name="testStr"/> I show the value, but I have
to use <%=testStr%>


Anybody can help me?


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