type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Exception in JSP: /bb.jsp:52 49: { 50: out.println("Failed to success"); 51: } 52: pstat.close(); 53: con.close(); 54: 55: Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373) 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:803) root cause java.lang.NullPointerException org.apache.jsp.bb_jsp._jspService(bb_jsp.java:96) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) 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:803) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.
Post your code. It seems that there is a programming error. Check your code.
OK this the code plz help me as quik as possible thnk u
blackberry.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <title>Blackberry & Datacard Asset</title> <head> <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" /> <!--[if lte IE 7]> <link rel="stylesheet" href="css/ie.css" type="text/css" charset="utf-8" /> <![endif]--> </head> <body> <div id="header"> <a href="index.html" id="logo"><img src="images/EATON-Logo.gif" alt="LOGO" /></a> <div id="navigation"> <ul> <li class="first"><a href="index.html">Home</a></li> <li class="selected"><a href="Asset.html">Asset Allocation</a></li> <li><a href="services.html">Contact</a></li> <li><a href="solutions.html">About</a></li> </ul> </div> <div id="search"> <form action=""> <input type="text" value="Search" class="txtfield" onblur="javascript:if(this.value==''){this.value=this.defaultValue;}"onfocus="javascript:if(this.value==this.defaultValue){this.value='';}" /> <input type="submit" value="" class="button" /> </form> </div> </div> <!-- /#header --> <div id="contents"> <div class="background"> <h3></h3> <div id="contents"> <div class="background"> <h3></h3> <p> <a href="blackberry.html">BlackBerry & DataCards</a>. </p> <center> <form name="form" action="bb.jsp" method="post"> <table cellpadding=12 cellspacing=6 border="1" bgcolor="#efefef" align="center"> <th bgcolor="#efefef" colspan=8> <font size=5>BlackBerry & DataCards Asset</font> <br> <font size=2 color="red"><sup>*</sup> Required Fields</font></th> <tr bgcolor="#efefef"> <td valign=top>EID<b><sup>*</sup></b></td> <td><input type="text" name="eid" value="" size=10 maxlength=10> <br> </td> </tr> <tr bgcolor="#efefef"> <td valign=top>UserName<b><sup>*</sup></b></td> <td><input type="text" name="usernm" value="" size=25 maxlength=10> <br> </td> </tr> <tr bgcolor="#efefef"> <td valign=top>WS NUmber<b><sup>*</sup></b></td> <td><input type="text" name="wsno" value="" size=25 maxlength=10> <br> </td> </tr> <tr bgcolor="#efefef"> <td valign=top>Device<b><sup>*</sup></b></td> <td><select name="device" id="course" style="width: 158px;"> <option value="Select">---- Select ----</option> <option value = "Blackberry">BlackBerry</option> <option value = "DataCards">DataCard</option> </select> <br> </td> </tr> <tr bgcolor="#efefef"> <td valign=top>Model<b><sup>*</sup></b></td> <td><input type="text" name="model" value="" size=10 maxlength=10> <br> </td> </tr> <tr bgcolor="#efefef"> <td valign=top>Service Provider<b><sup>*</sup></b></td> <td><input type="text" name="service" value="" size=20 maxlength=10> <br> </td> </tr> <tr bgcolor="#efefef"> <td valign=top>IMEI Number<b><sup>*</sup></b></td> <td><input type="text" name="imei" value="" size=15 maxlength=10> <br> </td> </tr> <tr bgcolor="#efefef"> <td valign=top>MEID Number<b><sup>*</sup></b></td> <td><input type="text" name="meid" value="" size=10 maxlength=10> <br> </td> </tr> <tr bgcolor="#efefef"> <td valign=top><br> <input type="submit" name="add" value="AddNew" size=25></td> <td valign=top><br> <input type="reset" name="button" value="reset" size=25> <br> </td> </tr> </table> </form> </center> <h3></h3> <p> <a href="laptop.html">Laptop & Desktop</a> </p> <h3></h3> <p> <a href=""> HeadPhone</a> </p> <p> <b></b> <a href="">Phone</a>.<br/><br/> </p> </div> </div> </div> </body> </html> bb.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.sql.*" %> <%@ page import="java.io.*" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <% String eid = request.getParameter("eid"); String usernm = request.getParameter("usernm"); String wsno = request.getParameter("wsno"); String device = request.getParameter("device"); String model = request.getParameter("model"); String service = request.getParameter("service"); String imei = request.getParameter("imei"); String meid = request.getParameter("meid"); Connection con = null; PreparedStatement pstat = null; int updateQuery = 0; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = DriverManager.getConnection("jdbc:odbc:asset"); String Qry = "INSERT INTO blackberry&datacards(User_id,User_name,WS_no,Device,Model,Service_Provider,IMEI,MEID) values('"+eid+"','"+usernm+"','"+wsno+"','"+device+"','"+model+"','"+service+"','"+imei+"','"+meid+"')"; pstat = con.prepareStatement(Qry); updateQuery = pstat.executeUpdate(); if(updateQuery != 0) {%> <br> <TABLE style="background-color: #E3E4FA;" WIDTH="30%" border="1"> <tr><th>Data is inserted successfully in database.</th></tr> </table> <% } } catch(Exception e) { out.println("Failed to success"); } pstat.close(); con.close(); %> </html>
Ads