A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Mongo DB Applied Patterns
this week in the
MongoDB
forum
or a resume review from
Five Year Itch
in the
Jobs Discussion
forum!
JavaRanch
»
Java Forums
»
Frameworks
»
Struts
Author
JSTL conversion for struts 1.1 code
Akash Sinha
Greenhorn
Joined: Dec 11, 2006
Posts: 1
posted
Feb 25, 2010 07:40:54
0
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
ption value="<%= eachParameterDisplayTypeValueObj.getValue() %>">
<bean:write name="eachParameterDisplayTypeValueObj" property="label"/>
</html
ption>
</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
ut 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
ption value="${eachParameterConstObj}">
<c
ut value="${eachParameterConstObj}"/>
</html
ption>
</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
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
I like...
posted
Feb 25, 2010 10:19:08
0
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
.
I agree. Here's the link:
http://aspose.com/file-tools
subject: JSTL conversion for struts 1.1 code
Similar Threads
BeanUtils.populate IndexOutofBound
Retrieving values of a select from inside nested logic:iterate
bean value persists on clicking back
Trying to show a pulldown using Struts html:select
c:when test = .....problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter