Can someone please advise as to what this jsp error is all about and what I should do
to fix it?
I've enclosed the jsp source, reluctantly... it clearly shows that this is my first
shot at jsp.
[bcox@linux jswdk-1.0]$ JSDK WebServer Version 2.1
Loaded configuration from: file:/usr/local/java/jswdk-1.0/webserver.xml
endpoint created: localhost/127.0.0.1:8080
endpoint created: localhost/127.0.0.1:8085
com.sun.jsp.runtime.JspServlet: init
Scratch dir for the JSP engine is: work/%3A8080%2Fexamples
IMPORTANT: Do not modify the generated servlets
Unhandled error! You might want to consider having an error page to report such errors
more gracefully
com.sun.jsp.JspException: Compilation failed:I/O exception
I/O exception
2 errors
at com.sun.jsp.compiler.Main.compile(Main.java:295)
at com.sun.jsp.runtime.JspLoader.loadJSP(JspLoader.java:135)
at
com.sun.jsp.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:77)
at com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:87)
at com.sun.jsp.runtime.JspServlet.serviceJspFile(JspServlet.java:218)
at com.sun.jsp.runtime.JspServlet.service(JspServlet.java:294)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:155)
at com.sun.web.core.Context.handleRequest(Context.java:414)
at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:139)
------- source -------
<%@ page language="java"
import="com.sdi.franchisee.FranchiseeException,java.sql.*,com.sdi.franchisee.*,com.sdi.util.*"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>View Account</title>
<meta name="generator" content="BBEdit 5.1.1">
</head>
<body bgcolor="white">
<form ACTION="viewProduct.jsp" METHOD=POST ENCTYPE="application/x-www-form-urlencoded">
<%
DBConnectionManager connectionManager = DBConnectionManager.getInstance();
Connection connection = connectionManager.getConnection("sdi");
Statement stmt = connection.createStatement();
String viewerID = "BradJCox1";
ResultSet queryPerson = stmt.executeQuery(
"select\n" +
" Person.Name,\n" +
" Person.Email,\n" +
" Person.Phone,\n" +
" Person.Street,\n" +
" Person.City,\n" +
" Person.State,\n" +
" Person.ZipCode,\n" +
" Person.Country,\n" +
" Person.Status,\n" +
" MacroAccount.CreditCardType,\n" +
" MacroAccount.CreditCardNumber,\n" +
" MacroAccount.ExpirationDate\n" +
"from Person, MacroAccount\n" +
"where Person.ID = \"" + viewerID + "\"\n" +
" and MacroAccount.ID = Person.ID\n"
);
if (!queryPerson.next())
throw new FranchiseeException("identifier " + viewerID + " not found");
%>
<input name="viewer" value="<%= viewerID %>" type=hidden>
<table border=0 width=100%>
<TR valign=top>
<th align=left>Name</th><td><%= queryPerson.getString("Name")
%></td>
<th align=left>Address</th><td><%=
queryPerson.getString("Street") %>, <%= queryPerson.getString("City") %>, <%=
queryPerson.getString("State") %> (<%= queryPerson.getString("Country") %>) <%=
queryPerson.getString("ZipCode") %></td>
</tr>
<TR valign=top align=left>
<th align=left>Phone</th><td><%=
queryPerson.getString("Phone") %></td>
<th align=left>Email</th><td><%=
queryPerson.getString("Email") %></td>
</tr>
<TR valign=top align=left>
<th align=left><%= queryPerson.getString("CreditCardType")
%></th><td><%= queryPerson.getString("CreditCardNumber") %></td>
<th align=left>Expires</th><td><%=
queryPerson.getString("ExpirationDate") %></td>
</tr>
</table>
<%
ResultSet queryProduct = stmt.executeQuery(
"select\n" +
" ID,\n" +
" Status,\n" +
" Description\n" +
"from Product\n" +
"where OwnerID = \"" + viewerID + "\"\n"
);
if (queryProduct.next()) {
String ID = queryProduct.getString("ID");
%>
<h3>Products</h3>
<table border="0" width=100%>
<TR valign=top>
<th>Product Identifier</th>
<th>Product Description</th>
<th>Status</th>
<th>Credits</th>
<th>Debits</th>
<th>Total</th>
</tr>
<%
do {
ResultSet queryCredits = stmt.executeQuery(
"select sum(Amount)\n" +
" from MicroTransaction \n" +
"where ProductID=\"" + ID + "\"\n" +
" and PayToID=\"" + viewerID + "\"\n"
);
ResultSet queryDebits = stmt.executeQuery(
"select sum(Amount)\n" +
" from MicroTransaction\n" +
"where ProductID=\"" + ID + "\"\n" +
" and PayByID=\"" + viewerID + "\"\n"
);
%>
<TR valign=top>
<td><input name=ViewProduct value="<%= queryProduct.getString("ID")
%>" type=submit></td>
<td><%= queryProduct.getString("Description") %></td>
<td><%= queryProduct.getString("Status") %></td>
<td><%= queryCredits.getString(1) %></td>
<td><%= queryDebits.getString(1) %></td>
<td align=right>queryCredits.getString(1) -
queryDebits.getString(1)</td>
</tr>
<%
} while(queryProduct.next());
%>
</table>
<p><a href="foo">Click here</a> to add another product.
<%
} else {
%>
There are no products registered for via this account.
<%
}
ResultSet queryMessage = stmt.executeQuery(
"select\n" +
" FromID, \n" +
" ModifiedWhen, \n" +
" Message \n" +
"from Message \n" +
"where ToID = \"" + viewerID + "\"\n"
);
%>
<h3>Messages</h3>
<table width=100%>
<tr>
<th>From</th>
<th>Date</th>
<th>Message</th>
</tr>
<%
while (queryMessage.next()) {
%>
<tr>
<td><%= queryMessage.getString("FromID") %></td>
<td><%= queryMessage.getString("ModifiedWhen") %></td>
<td><%= queryMessage.getString("Message") %></td>
</tr>
<%
}
%>
</table>
</form>
</body>
</html>
---
Dr. Brad Cox [EMAIL PROTECTED] (update your address book)
Phone: 703 361 4751 Fax: 703 995 0422 Cellular: 703 919-9623
http://virtualschool.edu A Project with Paradoxical Goals
PGP Signature: E194 C6E5 92D8 B8FB 20E8 8667 929A 95A0 FCB6 7C62
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html