null pointer exception in jsp
index.html
<html>
<body>
<table align=center>
<form action="Login.jsp" method="get">
<tr>
<td colspan=2><h1>Student Login</h1></td></tr>
<tr>
<td>UserName</td>
<td><input type="text" name="un"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="ps"></td>
</tr>
<tr>
<td><input type="Submit" value="Login"></td>
</tr>
</form>
<table>
</body>
</html>
Login.jsp
<%@ page import="java.sql.*" %>
<%!
Connection con;
public void Conn()
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","system","oracle");
}
catch(Exception e)
{
System.out.println(e);
}
}
%>
<html>
<body>
<%
try
{
String un,ps;
int flag=0;
un=request.getParameter("un");
ps=request.getParameter("ps");
Conn();
Statement st=con.createStatement();
String view="select * from Login";
ResultSet rs=st.executeQuery(view);
while(rs.next())
{
if(un.equals(rs.getString(1)) && ps.equals(rs.getString(2)))
{
flag=1;
break;
}
}
if(flag==1)
{
RequestDispatcher rd=request.getRequestDispatcher("Login1.jsp");
rd.forward(request,response);
}
else{
RequestDispatcher rd=request.getRequestDispatcher("index.html");
rd.include(request,response);
}
}
catch(Exception e)
{
out.println(e);
}
%>
</body>
</html>
when I am runnning this project getting **java.lang.NullPointerException** error , please see and resolve
View Answers
Ads
Related Tutorials/Questions & Answers:
null pointer exception in jsp
null pointer exception in jsp index.html
<html>
<...(
Exception e)
{
System.out.println(e);
}
}
%>...);
}
}
catch(
Exception e)
{
out.println(e);
}
%>
Getting Null pointer Exception in the jsp page
Getting
Null pointer Exception in the
jsp page I have developed this
jsp page to store the data in database.While storing the value of check box in database I am getting
null pointer exception in the following code
Advertisements
Getting Null pointer Exception in the jsp page
Getting
Null pointer Exception in the
jsp page I have developed this
jsp page to store the data in database.While storing the value of check box in database I am getting
null pointer exception in the following code
Getting Null pointer Exception in the jsp page
Getting
Null pointer Exception in the
jsp page I have developed this
jsp page to store the data in database.While storing the value of check box in database I am getting
null pointer exception in the following code
Getting Null pointer Exception in the jsp page
Getting
Null pointer Exception in the
jsp page I have developed this
jsp page to store the data in database.While storing the value of check box in database I am getting
null pointer exception in the following code
null pointer exception in java
null pointer exception in java What is
null pointer exception in Java and when it occurs? Show it with an example.Thanks!
Java
Null Pointer Exception
Httpservletresponse null pointer exception.
Httpservletresponse
null pointer exception. What is Httpservletresponse
null pointer exception?
NullPointerException occurs when we try to implement an application without referencing the object and allocating
Null Pointer Exception
Null Pointer Exception whis is the
Null Pointer Exception in java? or define
Null Pointer Exception with exp?
NullPointerException occurs, when you try to implement an application without referencing the object
NULL POINTER EXCEPTION
NULL POINTER EXCEPTION What is the Root cause for Class caste
exception in struts frame work .and how 2 handle
that 1 please help me
NUll POINTER EXCEPTION
of code i m getting
null pointer Exception.
can some one please explain what...
NUll POINTER EXCEPTION public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
Java null pointer exception
Java
null pointer exception Hi
I've made an array of Book objects that I made, the array is called library and it can hold 100 books, but currently...]!=
null){
if(strfield.contains(param)){
result+=library[counter
Java null pointer exception handling
Java
null pointer exception handling What... program? Is this extends from
exception class of Java?
Java
null pointer exception handling
What is Java NullPointerException? In Java
null pointer exception cannot be removed
null pointer exception cannot be removed class list {
public...
Exception nothing;
public int r;
public list() {
this(
null,null,0);
}
public list(String e,int i) {
this.elem = e;
this.next =
null
Handle Null Pointer Exception while text file upload
Handle
Null Pointer Exception while text file upload I want the code for handling
null pointer exception in
jsp page.
That is I need an error page for
null pointer exception.
The cause for
null pointer exception is while
when do we get null pointer exception in java
when do we get
null pointer exception in java can anybody explain me abt
null pointer exception?
like in wt situation do v get NPE?
Are these 2 strings same?
String str;
String str=
null
null pointer
null pointer dear sir ,
what is mean by
null pointer in c
Null pointer execption
Null pointer execption what is
null pointer exception. I am getting the
null pointer exception in this line conn= com.mypay.dao.Connection.getConnection(); what is wrong
Null pointer execption
Null pointer execption what is
null pointer exception. I am getting the
null pointer exception in this line conn= com.mypay.dao.Connection.getConnection(); what is wrong
check null exception java
check
null exception java check
null exception java - How to check the
null exception on Java?
The
null pointer exception in java occurs... on it.
See the example
null pointer exception
null pointer exceptions
null pointer exceptions import java.util.*;
public class employee {
static int ch;
static int emp[];
String name;
int id,age...");
}
}
}
Exception in thread "main" java.lang.NullPointerException
at employee.insert
null pointer error
null pointer error Respected sir there is a problem in this code
when i add any new record in ms access data base from my code, it gives only
null pointer error
sir please help me
my code are given below
compilatation class
null pointer error
null pointer error Respected sir there is a problem in this code
when i add any new record in ms access data base from my code, it gives only
null pointer error
sir please help me
my code are given below
compilatation class
JasperException: Exception in JSP
org.apache.jasper.JasperException:
Exception in
JSP: /UserMonitor.jsp:23
20: <input type="submit" value...JasperException:
Exception in JSP Hi,
I am facing below problem while getting paramater as int from
jsp.
Same code is working fine for string
Getting an exception - JSP-Servlet
Getting an exception Dear Sir ,
While sending a mail am getting an following
exception
javax.mail.MessagingException: 554 mail server permanently rejected message (#5.
3.0)so how to over come from this please help
method returning null on JSP page.Plz HELP!!!
method returning
null on
JSP page.Plz HELP!!! public String... on the
jsp page it is returning
null while the parameter values are successfully... sAddress =
null;
if(sPort>=0)
{
sAddress
pointer
pointer CONSTRTUCT A STRUCTURE FOR EMPLOYEE RECORD THAT CONTAINS A PERSON'S NAME, AGE, EMPLOYEE AND SALARY.WRITE A STATEMENT THAT DECLARES A VARIABLE empInfo and a
pointer emPtr of type EMPLOYEE.then use the
pointer to display