• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSTL conversion for struts 1.1 code

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I 'am getting problems with the line which is bold when i convert to JSTL

struts logic code

logic:iterate id="eachParameterValue" name="ReportSearchForm" property="paramList" indexId="ind">
<bean:define id="eachParameterValueObj" name="eachParameterValue" scope="page" type="x.ParamLink"/>
<tr>
<td ></td>
<td class="label" ><label
for="Type"> <bean:write name="eachParameterValueObj" property="paramDisplayName"/>
</label></td>
<td></td>
<td class="data" >
<logic:equal name="eachParameterValueObj" property="paramDisplayType" value="text">
<html:text property='<%= "eachParamValue[" + ind + "].paramValue" %>'/>
</logic:equal>
<logic:equal name="eachParameterValueObj" property="paramDisplayType" value="dropdown">
<html:select property='<%= "eachParamValue[" + ind + "].paramValue" %>'>
<logic:iterate id="eachParameterDisplayTypeListRow" name="eachParameterValueObj" property="paramConstants">
<bean:define id="eachParameterDisplayTypeValueObj" name="eachParameterDisplayTypeListRow" scope="page" type="org.apache.struts.util.LabelValueBean"/>
<html:option value="<%= eachParameterDisplayTypeValueObj.getValue() %>">
<bean:write name="eachParameterDisplayTypeValueObj" property="label"/>
</html:option>
</logic:iterate>
</html:select>
</logic:equal>
</td>
<td></td>
</tr>
</logic:iterate>

JSTL code

<c:forEach items="${ReportSearchForm.paramList}" var="eachParameterValue">
<tr>
<td ></td>
<td class="label" ><label
for="Type"> <c:out value="${eachParameterValue.paramDisplayName}"/>
</label></td>
<td></td>
<td class="data" >
<c:if test="${eachParameterValue.paramDisplayType == 'text'}">
<html:text property="${eachParameterValue.paramValue}"/>
</c:if>
<c:if test="${eachParameterValue.paramDisplayType == 'dropdown'}">
<html:select property="${eachParameterValue.paramValue}">
<c:forEach items="${eachParameterValue.paramConstants}" var="eachParameterConstObj">
<html:option value="${eachParameterConstObj}">
<c:out value="${eachParameterConstObj}"/>
</html:option>
</c:forEach>
</html:select>
</c:if>
</td>
<td></td>
</tr>
</c:forEach>

Class ParamLink

private String paramDisplayName = null;
private String paramName = null;
private String paramType = null;
private String paramValue = null;
private String paramDisplayType = null;
private List <String> paramConstants = null;

followed by setters and getters

Is this code conversion accurate


 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is very difficult to read. You can edit your post to include them by using the button.

Please read ItDoesntWorkIsUseless.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic