You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Victor Batista <vb...@present-technologies.com> on 2002/10/31 16:19:23 UTC

Set Attribute values from beans....

Hi Victor,
   I believe that your problem arises from the fact that you are not
allowed to put one tag inside another like you are doing.  I believe
that if you were to use an expression instead of your bean:write tag you
should be okay.
ie  
<html:form action="<%= request.getAttribute('userurl') %>"
focus="username" />
instead of
<html:form action="<bean:write name="userurl" scope="request"/>"
focus="username" >
 
or you could use a bean:define to get a pageContext variable with the
value of your userurl and then use an expression 
action="<%=userurlVar%>" focus="username" />

Brian

>>> "Victor Batista" 10/31/02 09:19am >>> 

Hello!
 How can I set attribute values with values stored in beans?
 
 For instance, I want to build a JSP which renderes an HTML form with
the
action value dependant on the value of a bean. I have tried the
following
ways, but I always get an error:
 
<html:form action="<bean:write name="userurl" scope="request"/>"
focus="username" >
and
<html:form action='<bean:write name="userurl" scope="request"/>'
focus="username" >
and
<html:form action=<bean:write name="userurl" scope="request"/>
focus="username" >
 

Can any one please tell me how can I do this?
 

When I hardcode the action, it works ok:
 
<html:form action="saveNewUser.action" focus="username" >
.....
<bean:write name="userurl" scope="request"/>
....
 

Any help would be appreciated.
 
Thanks in advance,
 Victor Batista
 
<html:form action=''