Thanks for reply
1. ok i am using for each.
I need how to assign the list value into JSTL varriable.
for example.
the arraylist values alist=[90,administrator,admin,a@yahoo.com,99,administrator1,admin1,a1@yahoo.com]
I need this output in HTML
Dept Code : 90 Deptname : administrator
Dept Manager: admin Deptmail :
a@yahoo.com Dept Code : 99 Deptname : administrator1
Dept Manager: admin1 Deptmail :
a1@yahoo.com I am written the code in JSTL
<c:forEach var="alist" items="${alist}" begin="0" end="${asize}" step="4">
<TR>
<TD>Det code : </TD>
<TD>${alist[0]} </TD>
<TD>Dept Name: </TD>
<TD>${alist[1]} </TD>
</TR>
<TR>
<TD>Dept Manager: </TD>
<TD>${alist[2]} </TD>
<TD>Dpt Mail: </TD>
<TD>${alist[3]} </TD>
</TR>
</c:forEach>
here asize is the array list size.
My Output
Dept Code : 90 Deptname : administrator
Dept Manager: admin Deptmail :
a@yahoo.com Dept Code : 90 Deptname : administrator
Dept Manager: admin Deptmail :
a@yahoo.com I know when i given alist[0],alist[1],alist[2],alist[3], it will print the same.
I dont know how to reteive the next iterate value. So only i just give the direct index value.
How to reterive the next value in for each. like in java scriplet code.
like this
<%for(int i=0;i<alist.size();i++) {
String str = String.valueOf(alist.get(i));
String str1 = String.valueOf(alist.get(i+1));// how to do this in JSTL
%>
<TD>STR - <%=str%> </TD>
<TD>STR1 - <%=str1%> </TD>
<% } %>
Please Suggest how to do this.
2.how to use JSTL varriable into Xml Tag.
for example
In my TLD File(eztaglib.tld)
<tag>
<name>companytag</name>
<tag-class>bas.CompanyTag</tag-class>
<attribute>
<name>dbase</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<name>dbpass</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<name>dburl</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<name>pgm_sname</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<name>session</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
</tag>
old code :
java value I am passing to XML in jsp scriplet code.
<%@ taglib uri="/ezerptags.tld" prefix="eztag" %>
.......
....
<eztag:companytag pgm_sname="<%= strpgm_name%>" dbase="<%= strd%>"
dbpass="<%= strp%>" dburl="<%= stru%>" session="<%= session%>" />
....
...
After modified in JSTL
<%@ taglib uri="/ezerptags.tld" prefix="eztag" %>
.......
....
<eztag:companytag pgm_sname="${pgm_name}" dbase="${strd}"
dbpass="${strp}" dburl="${stru}" session="${session}" />
.....
...
but its Not working. How to use this
the "eztag" and "companytag" are the customtag. these tages available in eztaglib.tld file. I am passing the value through XML Tag.
but its Not working. How to use this
Thanks in advance