jaggernat
asked on
playing with jstl
hi guys
I have something like this
<table>
<c:forEach var="docsummparty" items="${documentSummary.a rrayList}" varStatus="DocPartycount">
<tr valign="top" bgcolor="#ffffff">
<td nowrap valign="top">
<c:out value='${DocPartycount.cou nt}'/>
</td>
</tr>
</c:forEach>
</table>
Now in the above code the line " <c:out value='${DocPartycount.cou nt}'/> " displays the count number like 1 or 2 or 3.
Now, Instead of displaying the numbers like 1 or 2 or 3 , i want to display a, b, c, d, ..and so on.
I want to know if thats possible
Any help will be greatly appreciated
thanks in advance
Jay
I have something like this
<table>
<c:forEach var="docsummparty" items="${documentSummary.a
<tr valign="top" bgcolor="#ffffff">
<td nowrap valign="top">
<c:out value='${DocPartycount.cou
</td>
</tr>
</c:forEach>
</table>
Now in the above code the line " <c:out value='${DocPartycount.cou
Now, Instead of displaying the numbers like 1 or 2 or 3 , i want to display a, b, c, d, ..and so on.
I want to know if thats possible
Any help will be greatly appreciated
thanks in advance
Jay
I don't think , it is possible. You can compare with number and print a,b,c..
ASKER
>>>You can compare with number and print a,b,c..
the same thing need to be done using JSTL tags
the same thing need to be done using JSTL tags
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks both of you, i dint know you can print stuff out of an array in jstl, thats cool.
however
<%
String[] alpha = {"a","b","c","d","e"};
request.setAttribute("alph a",alpha);
%>
is there anyway i can represent the above code in jstl tags
something like <c:set var="Array" value="['a', 'b', 'c....']" scope="request" /> //not sure if this is correct..
any comments appreciated,
thanks guys
J
however
<%
String[] alpha = {"a","b","c","d","e"};
request.setAttribute("alph
%>
is there anyway i can represent the above code in jstl tags
something like <c:set var="Array" value="['a', 'b', 'c....']" scope="request" /> //not sure if this is correct..
any comments appreciated,
thanks guys
J
>is there anyway i can represent the above code in jstl tags
I don't know how to do that. Maybe karanw knows a way. If you trying to avoid scriptlets then the easiest way would to use "tag files" . I assume you are using JSP 2.0 .
http://today.java.net/pub/a/today/2003/11/14/tagfiles.html
http://www.google.com/search?hl=en&q=%22tag+files%22+jsp
I don't know how to do that. Maybe karanw knows a way. If you trying to avoid scriptlets then the easiest way would to use "tag files" . I assume you are using JSP 2.0 .
http://today.java.net/pub/a/today/2003/11/14/tagfiles.html
http://www.google.com/search?hl=en&q=%22tag+files%22+jsp
No, I dont think it is possible.You have to create list and it should be in scope.
If you are using any bean, then you can transfer this code to bean
and get that list
like ${bean.abclist} in jsp.
If you are using any bean, then you can transfer this code to bean
and get that list
like ${bean.abclist} in jsp.