This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

create a checklistbox using tld in jsp  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"rutvija rutvijaG",
Please check your private messages regarding an important administrative matter.
-Ben
 
You are HERE! The other map is obviously wrong. Better confirm with this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!