|
About SlChart SlChart is a Jsp Open source Tag Library for creating data tables in different format. SlChart table can use any jsp project. It is very easy to use.This tag library contains main two attribute. 1. id :- Bean id name 2. viewMode :- Data grid view mode (ex:- html,htmlGrid,xml) <jsp:useBean id="pageViews" class="test.test"/> <art:QuaryExcute viewMode="htmlPlain" id="pageViews" /> Download documentation and tag library www.prabu-lk.blogspot.com
Tutorial
- Download SLChart project folder and extract it.
- Add SlChart .jar file to your Jsp web project class path.
- Get css,js,images folders in to Utilities folder and add to your web folder
 - Make tlds folder in WEB-INF
- Add SlChart.tld (check Tag_Lib folder) descriptor file to/WEB-INF/tlds folder.
- Implement Datasource interface (in to com.virtusa.gto.Datasource).
package test; public class test implements Datasource { public ResultSet DataProducer() { Connection conn=null; ResultSet rs=null; try{ String userName = "root"; String password = "root"; String url = "jdbc:mysql://localhost:3306/details"; Class.forName ("com.mysql.jdbc.Driver").newInstance (); conn = DriverManager.getConnection (url, userName, password); Statement s = conn.createStatement (); int count; rs= s.executeQuery("SELECT * FROM salary s"); ResultSetMetaData md = rs.getMetaData(); int count1 = md.getColumnCount(); }catch(Exception e) { e.printStackTrace(); } return rs; } } - Import tag descriptor file and implement chart in to Jsp file
<%@ taglib uri="/WEB-INF/tlds/ArtHtml.tld" prefix="art" %> - Make a bean for the data sources classes in jsp page
<jsp:useBean id="pageViews" class="test.test"/>
SlChart tag Library support 4 types of chart
Special note: -- Create Xml type chart. We can’t put any HTML code or any other code in this page only following codes. <%@ taglib uri="/WEB-INF/tlds/ArtHtml.tld" prefix="art" %> <jsp:useBean id="pageViews" class="test.test"/> <art:QuaryExcute viewMode="xml" id="pageViews" />  Special note: --In this chart, user can doing lot of changes using this chart GUI. <%@ taglib uri="/WEB-INF/tlds/ArtHtml.tld" prefix="art" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <jsp:useBean id="pageViews" class="test.test"/> <art:QuaryExcute viewMode="htmlGrid" id="pageViews" /> </body> </html> 
<%@ taglib uri="/WEB-INF/tlds/ArtHtml.tld" prefix="art" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <jsp:useBean id="pageViews" class="test.test"/> <art:QuaryExcute viewMode="html" id="pageViews" /> </body> </html>  <%@ taglib uri="/WEB-INF/tlds/ArtHtml.tld" prefix="art" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <jsp:useBean id="pageViews" class="test.test"/> <art:QuaryExcute viewMode="htmlPlain" id="pageViews" /> </body> </html>  |