struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From FlyingElvi <>
Subject Input with name different than bean name property
Date Fri, 09 Jul 2004 16:06:36 GMT
Hi !

I wanted to know if there was any direct way to use a input field 
getting the value from a request bean that has a different property name 
than the form bean.

for example : Form Bean has 2 property id and parentId

in my JSP page request I have 2 objects of the same type and I want to 
populate the input field with the Id of both objects.

<html:hidden property="id" name="CHILD_OBJECT" /> // this works because 
my CHILD OBJECT has a method getId()
<html:hidden property="parentId" name="PARENT_OBJECT" /> // this doesn't 
work because I need to call getId()
                                                         // and not 

So is there any way to get it directly without having to do something 
like this ?
<bean:define id="parentId" name="PARENT_OBJECT" property="id"/>
<html:hidden property="parentId" value="<%=parentId + ""%>" />


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message