Unable to compile class for JSP
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   khaled_mohsen
Posted On:   Thursday, June 27, 2002 02:42 PM

I wrote a jsp file to access a database (code will follow).But i am getting this error message org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred between lines: 20 and 24 in the jsp file: /login.jsp Generated servlet error: .../sitelogin$jsp.java:76: Missing term. I checked the code and there are no errors. Could this be a configuration problem? Note: ALL TAGS HAVE AN "_" TO BE SEEN AS TAGS OR ELSE THEY WILL BE INTERPRETED AS HTML TAGS WHEN I SUBMIT THE QUESTION <%@ page import="java.sql.*,java.util.*,libConnect" %>    More>>

I wrote a jsp file to access a database (code will follow).But i am getting this error message

org.apache.jasper.JasperException: Unable to compile class for JSP



An error occurred between lines: 20 and 24 in the jsp file: /login.jsp




Generated servlet error:

.../sitelogin$jsp.java:76: Missing term.



I checked the code and there are no errors. Could this be a configuration problem?





Note: ALL TAGS HAVE AN "_" TO BE SEEN AS TAGS OR ELSE THEY WILL BE INTERPRETED AS HTML TAGS WHEN I SUBMIT THE QUESTION




			

<%@ page import="java.sql.*,java.util.*,libConnect" %>




<%
String user=request.getParameter("user");
String pass=request.getParameter("pass");

System.out.println("user: "+user+"
"+"pass: "+pass);

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con= DriverManager.getConnection("jdbc:odbc:login_dsn","","");

Statement stmt=con.createStatement();

String query="select * from login";
ResultSet rs=stmt.executeQuery(query);
while(rs.next()){
%>







<% }
if(rs != null) rs.close();
if(stmt !=null)stmt.close();
if(con !=null) con.close();
%>
user pass
<%= rs.getString(1)%> <%= rs.getString(2)%>



   <<Less

Re: Unable to compile class for JSP

Posted By:   Anonymous  
Posted On:   Saturday, June 29, 2002 08:57 AM

1. Shouldn't there be a "WHERE" in the SQL statement to test whether "user" and "pass" are correct?

2. As I read the SQL query, you have asked for a list of ALL user names and passwords. That could make for one hell of a big record set.

3. "user" and "pass" appear to be java variables being used OUTSIDE java blocks. Could that be a problem?

4. For my logins, I throw an exception using "IF rs.next()" ..."else".

Hope this is of some use. Let me know if I'm totally off track.

praxis-j@videotron.ca
About | Sitemap | Contact