I am getting the following error when I am running the
JSP Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
Below is the sample code. I am using WebLogic Sever and am running the same example on two different computers with the same weblogic 5.1.0 . It works on one m/c and doesn't work on other.
<html>
<head>
<title>
Contact Address Search
</title>
</head>
<%@ page import="java.sql.*" %>
<body bgcolor="#c0c0c0" Text="800000">
<h1> Select an Address</h1>
<form method="post" action="srchproc.jsp">
<table border="1" width = "400">
<tr>
<td><b>Address:</b></td> <td><input name = "inpaddr", type = "text" width = "30"></td>
</tr>
<tr>
<td><b>City:</b></td> <td><input name = "inpcity", type = "text" width = "30"></td>
</tr>
<tr>
<td><b>State:</b></td> <td><select name = "inpstate" >
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc
dbc:sampleJSP","abc","example");
Statement stmt = con.createStatement();
ResultSet mySet = stmt.executeQuery("select objid, name from table_state_prov");
if (mySet != null){
while (mySet.next()) {
String strobj = mySet.getString("objid");
String strstate = mySet.getString("name");
%>
<option value="<%= strstate %>" > <%= strstate %>
<%
}
}
%>
</select></td>
</tr>
<tr>
<td><b>Zip Code:</b></td> <td><input name = "inpzip", type = "text" width = "30"></td>
</tr>
<%
stmt.close();
con.close();
%>
<tr>
<td colspan="2">
<center>
<input name = "cmdSearch", type = "submit" value="Search"></td>
</center>
</tr>
</table>
</form>
</body>
</html>