Link to home
Start Free TrialLog in
Avatar of jaggernat
jaggernat

asked on

playing with jstl

hi guys

I have something like this

<table>

<c:forEach var="docsummparty" items="${documentSummary.arrayList}" varStatus="DocPartycount">
               <tr valign="top" bgcolor="#ffffff">
            <td nowrap valign="top">


                 <c:out value='${DocPartycount.count}'/>
                    
               </td>
          </tr>
</c:forEach>
</table>



Now in the above code  the line " <c:out value='${DocPartycount.count}'/> "  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
Avatar of Manish
Manish
Flag of India image

I don't think , it is possible. You can compare with number and print a,b,c..
Avatar of jaggernat
jaggernat

ASKER

>>>You can compare with number and print a,b,c..

the same thing need to be done using  JSTL tags
ASKER CERTIFIED SOLUTION
Avatar of Manish
Manish
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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("alpha",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
>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
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.