B
balgach
Hello all, i am trying to load a class file into a JSP page and getting
a few errors...what ive got is a simple form, that reads a username,
password, and submits it to a login.jsp file. my login.jsp looks
like:
<%@ page import="IMASOS.UserInterface" %>
<html><head> ... <body>
<%
String uname=request.getParameter("username");
String passw=request.getParameter("password");
UserInterface ui = new UserInterface();
boolean success = ui.login(uname,passw);
if (success) out.println("<h2>User logged in</h2>");
else out.println("<h2>Login Failure</h2>");
%>
</body>
and the error im getting is...
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NullPointerException
IMASOS.UserInterface.login(UserInterface.java:92)
org.apache.jsp.login_jsp._jspService(org.apache.jsp.login_jsp:50)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
a few errors...what ive got is a simple form, that reads a username,
password, and submits it to a login.jsp file. my login.jsp looks
like:
<%@ page import="IMASOS.UserInterface" %>
<html><head> ... <body>
<%
String uname=request.getParameter("username");
String passw=request.getParameter("password");
UserInterface ui = new UserInterface();
boolean success = ui.login(uname,passw);
if (success) out.println("<h2>User logged in</h2>");
else out.println("<h2>Login Failure</h2>");
%>
</body>
and the error im getting is...
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NullPointerException
IMASOS.UserInterface.login(UserInterface.java:92)
org.apache.jsp.login_jsp._jspService(org.apache.jsp.login_jsp:50)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)