You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Campbell, Sheri" <Sh...@SPR.DOE.GOV> on 2001/12/11 17:02:58 UTC

Newbie Question: dynamically setting value in a struts link tag / also dynamically placing value from a JavaBean Collection into a Struts Form attribute.

I've got a Struts Action class that calls a method on a JavaBean which
performs a SQL and puts resultSet into a Collection.  

In my .jsp page I am going through the Collection on my JavaBean and using
<strutsbean:write name="pvb" property="empid"/> to display the values into a
html table.

I am trying to also add a strutshtml:link  which contains a value=
(employeeid="empid") where I want its value to be built dynamically from the
Collections value:

<strutshtml:link href="assessment.do?employeeid=empid"> 

How do I do this?    Better yet, I have the employeeid in my javaBean's
Collection.  How do I get that value from the Collection into the .jsp's
associated StrutsActionForm's employeeid value? 


This is what I've got right now in my .jsp, the value is "empid" on my
action class not the actual value:

<strutshtml:form action="assessment.do" name="employeeForm"
type="com.proverb.EmployeeForm">
<strutslogic:iterate name="EmployeeCollection" id="pvb" >
<tr>
<td>
  <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    <strutshtml:link href="assessment.do?employeeid=empid"> 
    <strutsbean:write name="pvb" property="empid"/>
    </strutshtml:link>
  </font>
   &nbsp;
</td>
<td>
  <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    <strutsbean:write name="pvb" property="lname"/>
   </font>
   &nbsp;
</td>
<td>
  <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    <strutsbean:write name="pvb" property="fname" />
  </font>
   &nbsp;
</td>
 
</strutslogic:iterate>
</strutshtml:form>
 

Thanks!!!!!







--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>