Win a copy of Learn Spring Security (video course) this week in the Spring forum!
    Bookmark Topic Watch Topic
  • New Topic

Doubts in JSTL

 
Vasanthan Ramakrishnan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi

Doubts in JSTL

1.I need how to assign the JSTL varriable to xml tag attribute.

for example

In my TLD File
----------------
<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>
-------------------------

Html code

old 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.

Please suggest me . how to use.


2.How to use ArrayLIst in JSTL

For example

IN Java scriplet code in JSP

<%for(int i=0;i<alist.size();i++) {
String str = String.valueOf(alist.get(i));
String str1 = String.valueOf(alist.get(i+1));
%>

<TD>STR - <%=str%> </TD>
<TD>STR1 - <%=str1%> </TD>

<% } %>

This code How to Use in JSTL.

thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64608
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question(s) more than once.
 
    Bookmark Topic Watch Topic
  • New Topic