aspose file tools*
The moose likes JSP and the fly likes headache can someone help me in this Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "headache can someone help me in this" Watch "headache can someone help me in this" New topic
Author

headache can someone help me in this

albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108

actually i want to read the data inside the vector then put it inside the textbox value to make it can be post to the next page. how i need to do this
[ March 12, 2007: Message edited by: Bear Bibeault ]

JAVA the only can called technology
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Your html tags are not correct. Some quotations are missing.
You'd better write a simple JSP page and forward the request to it after getting the necessary data.


[My Blog]
All roads lead to JavaRanch
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108


i already change my page but i still getting error:
An error occurred at line: 65 in the jsp file: /report.jsp
Generated servlet error:
add cannot be resolved


org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


What is this proble actually or have other method to let me do this?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

You're declaring the "String add" in the for loop, so it will not be visible outside that loop. You should declare it outside.
Sorry, I can't help more, I have a very bad connection this week
sreekanth nair
Greenhorn

Joined: Mar 12, 2007
Posts: 20
Try this



<%@ page import="java.net.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<html>
<head>
<title>Untitled</title>
</head>

<body>
<%
Vector mail = new Vector();
try{
Class.forName("com.mysql.jdbc.Driver");
}
catch (Exception E) {
out.println("Unable to load driver.");
E.printStackTrace();
}
try{

Connection C = DriverManager.getConnection("jdbc:mysql://localhost/attendance","root","");
%>
<div align="center"><font size="+6">Student BarList</font><br>
In this page will display out the student that attendance NOT MORE THAN 70%. The Student Below is NOT ALLOW to take exam for the relevant subject.
The student whoever not satisfy with the bar can negotiate with the lecturer of the relevant subject.<p/>
The student below will be bar from the relevent subject:<br/>

<%
Statement S = C.createStatement();
ResultSet rs = S.executeQuery("SELECT * FROM bar");
ResultSetMetaData rsStruc = rs.getMetaData();
out.println("<table bgcolor=red cellpadding=10 cellspacing=1 size=70>");
out.println("<tr bgcolor=red>");
int colCount = rsStruc.getColumnCount();
String colName = "";
for(int i=1;i <= colCount; i++){
colName = rsStruc.getColumnName(i) ;
out.println("<td><B><font color=white>" + colName + "</font></b></td>\n");
}
out.println("</tr>");
while (rs.next()) {
String email=rs.getString("email");
mail.addElement(email);
out.println("<tr bgcolor='ffffff'>");
for(int i=1;i <= colCount; i++){
colName = rsStruc.getColumnName(i) ;

String fld = rs.getString(colName);
out.println("<td>" + fld + "</td>");
}
out.println("</tr>");
}
out.println("</table>");
rs.close();
C.close();}
catch (Exception E) {
out.println("SQLException: " + E.getMessage());
}
String add = "";
for(int i=0; i< mail.size(); i++){
add = mail.elementAt(i)+",";
out.println(add);
}
%>
<form action="simplemail.jsp" method="post">
<input type="text" name="address" value="<%=add%>">
<input type="submit" name="send" value="Send Mail">
</body>
</html>
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
declare at outside just ca let me to get the last data in the vector
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: headache can someone help me in this