• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

create a checklistbox using tld in jsp

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i have create a Tag Library File that generate checklist box. and this file i m using in jsp page.
the data in checklist box is coming from one of my database table.
now the problem is i m getting just five row from table. and i want all the data present in table.

my coding of tld file is as below,
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

<taglib>
<tlibversion>1.2</tlibversion>
<jspversion>1.1</jspversion>
<shortname>customlist</shortname>
<uri>http://www.servletsuite.com/servlets/customlisttag</uri>;
<info>Custom list box taglib</info>

<tag>
<name>customlist</name>
<tagclass>com.cj.customlist.CustomListTag</tagclass>
<bodycontent>JSP</bodycontent>
<info>ouputs a custom listbox</info>

<attribute>
<name>width</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>height</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>background</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>borderWidth</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>borderColor</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>className</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>style</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

</tag>

<tag>
<name>element</name>
<tagclass>com.cj.customlist.ElementTag</tagclass>
<bodycontent>JSP</bodycontent>
<info>ouputs an element</info>

<attribute>
<name>className</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>style</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>

</taglib>


my coding of jsp page is,


<body>
<cl:customlist width="180px" height="1000px">
<% try {
String userName = "root";
String password = "root";
String url = "jdbc:mysql://192.168.4.29:3306/pts";
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection(url, userName, password);
System.out.println("Database connection established");
st = conn.createStatement();
ResultSet rs = st.executeQuery("select distinct(technology) from technology");
while (rs.next())
{
System.out.println(rs.getString(1));

%>
<cl:element><input type="checkbox" name=" <%=rs.getString(1)%>"><%=rs.getString(1)%></cl:element>
<%
}

} catch (Exception e1) {
System.err.println("Cannot connect to database server" + e1.getMessage());
} finally {
rs = null;
}
%>

</cl:customlist>

</body>
can anyone help???
thanks in advance.........
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"rutvija rutvijaG",
Please check your private messages regarding an important administrative matter.
-Ben
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic