struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From albert kao <albertk...@gmail.com>
Subject How to pass parameters to s:component inside s:iterator?
Date Sat, 05 Oct 2019 15:56:03 GMT
How to pass parameters to s:component inside s:iterator?
e.g. These simpilied codes pass the parameter "John" to items.jsp.
However, the browser displays an empty string.

<s:iterator begin="0" end="%{client.size - 1}" value="client"
status="status">
  <s:component template="items.jsp" theme="custom"
name="%{'client['+#status.index+'].firstName'}" label="firstName.label">
    <s:if test="#status.index == 1">
      <s:param name="inputValue" value="'John'"/>
    </s:if>
  </s:component>
</s:iterator>


items.jsp:
<s:textfield
  name="%{#fieldname}"
  value="%{parameters.inputValue}"/>
/>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message