|
|
| exception in jsp |
Expert:keerthi
hi my code is given below.while running that code i got exception like given below.plz any body help me
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /Validate.jsp(109,33) Expecting "jsp:param" standard action with "name" and "value" attributes org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88) org.apache.jasper.compiler.Parser.parseParam(Parser.java:873) org.apache.jasper.compiler.Parser.parseBody(Parser.java:1829) org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1081) org.apache.jasper.compiler.Parser.parseForward(Parser.java:923) org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1234) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1588) org.apache.jasper.compiler.Parser.parse(Parser.java:132) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212) org.apache.jasper.compiler.ParserController.parse(ParserController.java:101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156) org.apache.jasper.compiler.Compiler.compile(Compiler.java:296) org.apache.jasper.compiler.Compiler.compile(Compiler.java:277) org.apache.jasper.compiler.Compiler.compile(Compiler.java:265) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.27
<!-- File : Validate.jsp
-->
<HTML>
<%@ page language="java" %> <%@ page import="java.sql.*" %> <%@ page import="java.lang.*" %>
<%@ page session="true" %> <head> <LINK href="styles.css" type="text/css" rel="stylesheet">
<head> <jsp:include page="MultiLevelmenu.htm"/><br><br><br> <body Class=SC> <%@ include file = "Header.html" %> <BR><BR><BR> <FONT FACE="Century Gothic">
<%! String user_id; %> <%! String pass_word; %> <%! int flag=0; %>
<%
/*Declaration of variables*/
Connection con=null; Statement stmt=null; ResultSet rs=null;
%>
<%-- Retrieve parameters from Session --%>
<% user_id = request.getParameter("uid"); pass_word = request.getParameter("pwd"); System.out.println("user_id = "+user_id+"\t"+"pass_word = "+pass_word); %>
<%
/*Checking for userid and password*/
if(pass_word.equals("") || user_id.equals("")) { //System.out.println("Redirecting to login to fill all credentials.."); %> <jsp:forward page="Login.jsp"> <jsp:param name="error" value="blankfields" /> </jsp:forward> <% } %>
<% try { /*Connection to MS Acess database is made with JDBC class one driver*/ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = DriverManager.getConnection("jdbc:odbc:ezee","root1","root1"); //Class.forName("com.mysql.jdbc.Driver"); //con = java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/loanamortizer", "root", "root"); System.out.println("Connection"+con); stmt = con.createStatement();
/*Retrives data from the database*/ rs = stmt.executeQuery("SELECT * from Login "); System.out.println(rs);
while(rs.next()) { if(user_id.equals(rs.getString(1)) && pass_word.equals(rs.getString(2))) { System.out.println("User has successfully logged in..."); /*Puts the username and connection variable to session*/ session.setAttribute("userr",user_id); session.setAttribute("connection",con); int value = rs.getInt(3); if(!(value < 0 )) session.setAttribute("auth",new Integer(value)); flag=1; } }
}
catch(Exception e) { System.out.println("Exception"+e); } %>
<% /*If username and password is validated, then the user is redirected to homepage*/ if(flag==1) { flag=0; %> <jsp:forward page="Home.html"> </jsp:forward > <% } else { /*If username and password is not valid, then the user is redirected back to Loginpage*/ %>
<jsp:forward page="Login.jsp"> <jsp:param name="error" value="invalid" /> </jsp:forward> <% } %>
</BODY> </HTML>
|
| Answers |
| More Questions |
|
|
Post Answers
Ask Question
Facing Programming Problem?
|
|
|
|
|