Hi i am writing a code in which i have to call one
jsp page from another but as soon as the control gets transferred i get the error msg as:
Syntax error on token(s), misplaced construct(s)
16: if(rs.next()==false)
17: {
18:
19: <jsp:forward page="success.jsp"/>
20:
21: }
22: %>
An error occurred at line: 19 in the jsp file: /second/process.jsp
Syntax error, insert "AssignmentOperator Expression" to complete Assignment
16: if(rs.next()==false)
17: {
18:
19: <jsp:forward page="success.jsp"/>
20:
21: }
22: %>
An error occurred at line: 19 in the jsp file: /second/process.jsp
Syntax error, insert ";" to complete Statement
16: if(rs.next()==false)
17: {
18:
19: <jsp:forward page="success.jsp"/>
20:
21: }
22: %>
An error occurred at line: 19 in the jsp file: /second/process.jsp
forward cannot be resolved
16: if(rs.next()==false)
17: {
18:
19: <jsp:forward page="success.jsp"/>
20:
21: }
22: %>
An error occurred at line: 19 in the jsp file: /second/process.jsp
The operator / is undefined for the argument type(s)
String, void
16: if(rs.next()==false)
17: {
18:
19: <jsp:forward page="success.jsp"/>
20:
21: }
22: %>
An error occurred at line: 19 in the jsp file: /second/process.jsp
Syntax error on tokens, delete these tokens
16: if(rs.next()==false)
17: {
18:
19: <jsp:forward page="success.jsp"/>
20:
21: }
22: %>
An error occurred at line: 22 in the jsp file: /second/process.jsp
Syntax error, insert "}" to complete Statement
19: <jsp:forward page="success.jsp"/>
20:
21: }
22: %>
23:
24: <%
25: else
An error occurred at line: 31 in the jsp file: /second/process.jsp
Syntax error, insert "Finally" to complete TryStatement
28: <jsp:forward page="fail.jsp"/>
29: <%
30: }
31: }
32: %>
33: <%catch(Exception e)
34: {
An error occurred at line: 32 in the jsp file: /second/process.jsp
Syntax error, insert "}" to complete Block
29: <%
30: }
31: }
32: %>
33: <%catch(Exception e)
34: {
35:
I am using MS-ACCESS AS DATABASE.
the jsp code is:
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="java.io."%>
<%@ page import = "java.sql."%>
<%
String account=request.getParameter("ac");
String password=request.getParameter("pass");
String url="Jdbc:Odbc:Namrata";
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection(url);
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select from database1 where Account="account"and Password="+password);
if(rs.next()==false)
{
<jsp:forward page="success.jsp"/>
}
%>
<%
else
{
%>
<jsp:forward page="fail.jsp"/>
<%
}
}
%>
<%catch(Exception e)
{
out.println("the exception is:"+e);
}
%>