Can u please help me in running my first example...here is the code Please HELP
If any thing wrong please guide its very urgent for my final year project
Hi
First you must tell me what is wrong with this code?
What type of error did you get?
As i can see you want to display some columns from your table using
displaytags ,am i right?
What IDE are you use (NetBeans,Eclipse) or something else?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ya u r right m trying to display records of database table in Pagination form
getting this error
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 42 in the jsp file: /pool.jsp
Generated servlet error:
D:\Documents and Settings\Gautam.netbeans\5.5beta\apache-tomcat-5.5.16_base\work\Catalina\localhost\ctags\org\apache\jsp\pool_jsp.java:116: rows1 is already defined in _jspService(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
java.lang.Object rows1 = null;
^
1 error
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 42 in the jsp file: /pool.jsp
Generated servlet error:
D:\Documents and Settings\Gautam.netbeans\5.5beta\apache-tomcat-5.5.16_base\work\Catalina\localhost\ctags\org\apache\jsp\pool_jsp.java:116: rows1 is already defined in _jspService(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
java.lang.Object rows1 = null;
^
1 error
Ah i see !
Question for you?
Did you include in your project all .jar files?If you not
You must include next jar files in your project:
commons-beanutils-1.7.0.jar
commons-collections-3.1.jar
commons-lang-2.1.jar
commons-logging-1.0.4.jar
displaytag-1.1.jar
dsiplaytag-export-poi-1.1.jar
itext-1.3.jar
jstl-1.1.2.jar
log4j-1.2.12.jar
poi-2.5.1.jar
standard-1.0.6.jar
when you import those files in project delete code
This code that you gave is little confuised.
As i can se you have problem with your ResultSet.
I use more simple JSTL tag for that.Are you familiar in that tags?
Problem with Result Set is that you have more then one column you must put it in some kind of list or vector and then to display it.
"When i add
<display:table name="rows1" />
it display nothing found to display. "
you got this message when you table is empty.
Check your table is it full or not?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi !
I have JSP 2.0 Tomcate 5.5.12 installed
will DisplayTag work with this?
Please Help
Bunty
Of course it will!
Just try it. I work on Tomcat 5.5.9 and it goes great
Greetings!
Thanks boske3 for ur reply
Can u please help me in running my first example...here is the code Please HELP
If any thing wrong please guide its very urgent for my final year project
<%@ page language="java" import="java.sql.,java.util.,org.apache.commons.beanutils.,org.displaytag." %>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
ArrayList rows1= null;
</html>
Hi
First you must tell me what is wrong with this code?
What type of error did you get?
As i can see you want to display some columns from your table using
displaytags ,am i right?
What IDE are you use (NetBeans,Eclipse) or something else?
ya u r right m trying to display records of database table in Pagination form
getting this error
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 42 in the jsp file: /pool.jsp
Generated servlet error:
D:\Documents and Settings\Gautam.netbeans\5.5beta\apache-tomcat-5.5.16_base\work\Catalina\localhost\ctags\org\apache\jsp\pool_jsp.java:116: rows1 is already defined in _jspService(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
java.lang.Object rows1 = null;
^
1 error
root cause
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 42 in the jsp file: /pool.jsp
Generated servlet error:
D:\Documents and Settings\Gautam.netbeans\5.5beta\apache-tomcat-5.5.16_base\work\Catalina\localhost\ctags\org\apache\jsp\pool_jsp.java:116: rows1 is already defined in _jspService(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
java.lang.Object rows1 = null;
^
1 error
Using Netbeans 5.5
Ah i see !
Question for you?
Did you include in your project all .jar files?If you not
You must include next jar files in your project:
commons-beanutils-1.7.0.jar
commons-collections-3.1.jar
commons-lang-2.1.jar
commons-logging-1.0.4.jar
displaytag-1.1.jar
dsiplaytag-export-poi-1.1.jar
itext-1.3.jar
jstl-1.1.2.jar
log4j-1.2.12.jar
poi-2.5.1.jar
standard-1.0.6.jar
when you import those files in project delete code
org.apache.commons.beanutils.*
and you need this code for using dislpay tags:
....
<%@taglib uri="http://displaytag.sf.net" prefix="display"%>
...
Think it will work now
i want to display the content of my database usin DisplayTag Pagination...m using NetBeans5.5 with tomcat 5.5.16.
Please Help....
Following is my code....
<jsp:scriptlet>
List rows1= null;
try {
ResultSet rs;
Statement stmt;
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test?user=root&password=passit");
String sql = "SELECT * FROM gc";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
RowSetDynaClass resultSet = new RowSetDynaClass(rs, false);
rows1=resultSet.getRows();
request.setAttribute("rows2",rows1);
String dd = resultSet.getName();
out.println(dd);//printing name
out.println(rows1);//printing content of rows
rs=null;
stmt=null;
} catch(Exception e) {
e.printStackTrace();
}
</jsp:scriptlet>
When i run the above code it displays the following
org.apache.commons.beanutils.RowSetDynaClass [org.apache.commons.beanutils.BasicDynaBean@1fa6d18, org.apache.commons.beanutils.BasicDynaBean@1049d3, org.apache.commons.beanutils.BasicDynaBean@15ed659, org.apache.commons.beanutils.BasicDynaBean@14a7a12, org.apache.commons.beanutils.BasicDynaBean@9444d1, org.apache.commons.beanutils.BasicDynaBean@32060c, org.apache.commons.beanutils.BasicDynaBean@2b323e, org.apache.commons.beanutils.BasicDynaBean@1efb4be, org.apache.commons.beanutils.BasicDynaBean@435a3a, org.apache.commons.beanutils.BasicDynaBean@1d8c528, org.apache.commons.beanutils.BasicDynaBean@77eaf8, org.apache.commons.beanutils.BasicDynaBean@e35bb7]
When i add
<display:table name="rows1" />
it display nothing found to display.
Please help what i do?
BuntyIndia
This code that you gave is little confuised.
As i can se you have problem with your ResultSet.
I use more simple JSTL tag for that.Are you familiar in that tags?
Problem with Result Set is that you have more then one column you must put it in some kind of list or vector and then to display it.
"When i add
<display:table name="rows1" />
it display nothing found to display. "
you got this message when you table is empty.
Check your table is it full or not?
Table is Full have 15 records....
Can u please give me running code if u have..
u can paste here or mail me at bunty.india[at]gmail.com
Please help me
Bunty