Please help!!! Blank input in JSP

Hi all,
What should I do when I get blank input from a form into JSP i.e the user do not enters anything in the textbox ?
I want to store it as NULL in my database file.Can anybody help how should i do that ?
Thanks for any help in advance.
regards,
savdeep.

Double post
http://forum.java.sun.com/thread.jspa?threadID=666647&tstart=0

Similar Messages

  • Please help me resolve this JSP compilation error

    Hi,
    We have deployed our web app in Sun one web server 7.0 running on Sun os, and with JRE 5.0.
    Until recently, every thing was running fine, but since a few days, I am unable to get a JSP file compiled.
    This file, has a <%@include file= .. > to another file, and both these used to work fine earlier.
    This is the error message I am getting:
    <!-- org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:604)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:464)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:358)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:792)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:472)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:353)
    at com.bt.bmsnet.shared.BMSServletBase.forward(BMSServletBase.java:126)
    at com.bt.gma.web.AccountServlet.actionUpdateAccount(AccountServlet.java:2704)
    at com.bt.gma.web.AccountServlet.doGet(AccountServlet.java:5049)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:796)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
    at com.sun.webserver.connector.nsapi.NSAPIProcessor.service(NSAPIProcessor.java:160)
    Caused by: java.io.IOException: tmpFile.renameTo(classFile) failed
    at org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:208)
    at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:131)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:336)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:595)
    ... 23 more
    -->
    The line "Caused by: java.io.IOException: tmpFile.renameTo(classFile) failed" suggests that the JSP file isn't getting compiled into the corresponding servlet.
    Can some one please help?

    Yes I have done that. Simple JSP pages are compiling well. But I have about 5 jsps which call some partial jsp using
    <%@ include file="somefile.jsp" %>
    And all these files are showing this error.
    I have a feeling that this is probably due to some kind of restriction on file sizes of compiled jsps in the server. Is there any such restriction?

  • Please Help! NullPointerException on JSP Report

    I've been trying to run a JSP Report on Oracle 9iAS, but when I call it on browser the error below appears.
    Please, Help me!
    Reports Error Page
    Mon Jul 01 14:04:24 GMT 2002
    java.lang.NullPointerException:
    java.lang.NullPointerException:
         at oracle.reports.rwclient.RWClient.getTrace(RWClient.java:969)
         at oracle.reports.jsp.JspTagUtil.getRWClient(JspTagUtil.java:59)
         at oracle.reports.jsp.RwTag.setPageContext(RwTag.java:54)
         at oracle.reports.jsp.ReportTag.setPageContext(ReportTag.java:85)
         at bench.AssemblyHistory._jspService(_AssemblyHistory.java:55)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java, Compiled Code)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:435)
         at org.apache.jserv.JServConnection.run(JServConnection.java, Compiled Code)
         at java.lang.Thread.run(Thread.java, Compiled Code)

    hi artur,
    please check if the reports server works correctly
    on your iAS installation.
    to check this run the test.jsp report from the
    reports server test page.
    you can find the test page by accessing the default
    home page of your webserver
    http://hostname.domain:port/
    click on the demonstrations tab - business intelligence and forms - reports services
    click on the 'Test a JSP Report...' link.
    regards,
    christian

  • Please Help on ControllerServlet-DataAccessObject-JSP

    Hello,
    First of all sorry if this seems an obvious simple issue. I am new to Servlets and JSP and am trying to develop an application using these technologies.
    I once found a question on the forum but can't seem to locate the link for reference. Many thanx to those guys because the code is from their discussion and am just trying to understand it.
    I will later get the records from the database using the same concept + some other design patterns I have read on(action classes etc).
    I have a controller servlet TestControllerServlet.java which forwards the request to a jsp page for display. The servlet gets ArrayList (from the data access object)of objects and stores it inside an HTTP Request then forwards the request to a JSP page. Each record is store a JavaBean instance.
    When I access the controller servlet I don't get the info from the records(I just get a blank page).I have included the code below:
    TestControllerServlet]
    package test_javabean;
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.ArrayList;
    public class TestControllerServlet extends HttpServlet {
        public void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            //Getting the ArrayList of Objects from the database
            DeclarationDataAccess declarationDataAccess = new DeclarationDataAccess();
            ArrayList<DeclarationBean> dataRecords = declarationDataAccess.getDeclarationRecords();
            //Store the ArrayList of objects into HTTP Request
            request.setAttribute("dataRecords", dataRecords);
            //Forward the HTTP Request to a JSP page
            RequestDispatcher reqstDisp =
                    getServletContext().getRequestDispatcher("/TestDeclarationView.jsp");
            reqstDisp.forward(request,response);
        public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
    TestDeclarationView
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <html>
        <head>
            <title>JSP Page</title>
        </head>
        <body>
            <jsp:useBean id="declarationRecords" class="java.util.ArrayList" scope="request"/>
            <h1>Test Declaration</h1>
            <c:forEach var="currentRecord" items="${declarationRecords}">
                First Name: ${currentRecord.firstName}</br>
                Surname: ${currentRecord.surName}
            </c:forEach>
        </body>
    </html>
    DeclarationDataAccess
    package test_javabean;
    import java.util.*;
    public class DeclarationDataAccess {
         public ArrayList<DeclarationBean> getDeclarationRecords() {
            ArrayList<DeclarationBean> declarationRecords = new ArrayList<DeclarationBean>();
            DeclarationBean declarationRecord;
            declarationRecord = new DeclarationBean();
            declarationRecord.setFirstName("AiEx");
            declarationRecord.setSurName("Kuomboka");
            declarationRecords.add(declarationRecord);
            return declarationRecords;
    DeclarationBean
    package test_javabean;
    import java.sql.*;
    import java.io.*;
    public class DeclarationBean implements Serializable{
        private String firstName;
        private String surName;
        public DeclarationBean() {
        public String getFirstName() {
            return firstName;
        public void setFirstName(String firstName) {
            this.firstName = firstName;
        public String getSurName() {
            return surName;
        public void setSurName(String surName) {
            this.surName = surName;
    }problems:
    1. I can't understand why am getting a blank page
    2. in the TestDeclarationView.jsp I haven't understood well(from the example on the forum) why the class in <jsp:useBean id="declarationRecords" class="java.util.ArrayList"> I thought it should be <jsp:useBean id="declarationRecords" class="test_javabean.DeclarationDataAccess"> but when I do so I get the error: "javax.servlet.ServletException: Don't know how to iterate over supplied "items" in <forEach>;"
    Thank you in advance for the help.

    I always use scriplets instead of the JSP tag libs so lost touch on the JSP tag libs. Still , probably I can help you. The only problem I see in the code is regarding the id.
    Please change the following line of code
    <jsp:useBean id="declarationRecords" class="java.util.ArrayList" scope="request"/>
    to following
    <jsp:useBean id="dataRecords" class="java.util.ArrayList" scope="request"/>
    probably its the name which is creating the problem.
    Hope this helps.
    Thanks

  • Please Help with my first jsp

    Hi, this may seem basic to you but i've frying my head with simple jsp. Any books i looked at only show code segments!
    All i want to do is create an html entry page with form fields for username, password, email address, send the information to a jsp page that validates the form entries and then stores the info in database, and be able to display the info stored in the db also.
    Any help or pointers would be appreciated, or links to good tutorials!
    Thanks in advance.....

    with this i am sending my own code :
    its a html page :
    <Script LANGUAGE="JavaScript" ></Script>
    <%@ page import="java.util.*" %>
    <%@ page import="java.lang.*" %>
    <html>
    <head>
    <title>Login</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="Microsoft Theme" content="expeditn 011">
    </head>
    <body background="exptextb.jpg" bgcolor="#FFFFFF" text="#000000" link="#993300" vlink="#666600" alink="#CC3300">
    <!--mstheme--><font face="Book Antiqua, Times New Roman, Times">
    <form name="frmlogin" method="post">
    <p> 
    </p>
    <p> 
    </p>
    <p> 
    </p>
    <p> 
    </p>
    <p>                                                       
    User Name : 
    <input type="text" name="txtname">
    <br>
    <br>
    Password   : 
    <input type="password" name="txtpassword">
    </p>
    <p>                                                                    
    <input type="submit" name="submit" value="Submit" onclick="javascript: return loadmy('sub')">
    </p>
    </form>
    <script>
    var i=0;
    function loadmy(val)
              if(val=="new")
                   document.frmlogin.action='form.jsp';          
              }else
                   if(onCheck())
                        document.frmlogin.action='login.jsp';
                   }else
                        return false;
    function onCheck()
         if(document.frmlogin.txtname.value=="")
              alert("Please enter user name ..");
              document.frmlogin.txtname.select();
              document.frmlogin.txtname.focus();
              return false;
         if( document.frmlogin.txtpassword.value=="")
              alert("Please enter password ..");
              document.frmlogin.txtpassword.select();
              document.frmlogin.txtpassword.focus();
              return false;
         return true;
    </script>
    <p> </p><!--mstheme--></font></body>
    </html>
    IN this page i am taking user name and password. ok?
    now another JSP file with database connection is here: I think you have enough idea for database connection. So i'll ommit that.
    <html>
    <head>
    <title>Login Result Page</title>
    <meta name="Microsoft Theme" content="expeditn 011">
    </head>
    <%@ page import="java.lang.*,java.sql.*"%>
    <%@ page import ="Database.*" %>
    <body background="exptextb.jpg" bgcolor="#FFFFFF" text="#000000" link="#993300" vlink="#666600" alink="#CC3300">
    <!--mstheme--><font face="Book Antiqua, Times New Roman, Times">
    <%
         String uname = request.getParameter("txtname");
    String password = request.getParameter("txtpassword");
         String pquery="Select * from login where uname='"+uname+"'";
         String query="Select * from login where uname='"+uname+"'and password='"+password+"'";
         ClsDataBase cdb = new ClsDataBase();
         Connection con = cdb.getConnection();
         Statement stmt = con.createStatement();
         ResultSet rs = stmt.executeQuery(pquery);
         if(rs!=null)
              if(rs.next())
                   ResultSet r=stmt.executeQuery(query);
                   if(r!=null)
                        if(r.next())
                        session.setAttribute("uname",uname);
                        session.setAttribute("Lflag","true");
    %>
    <p><font size=4 color="green">Wel Come <%= uname %>!!!</font></p>
    <p>
    <form action="listofuser.jsp" method="post" name="f1">
    </form>
    <%                    }
                        else
    %>
    <p> <font size=4 color="red">Wrong Password.</font> </p>
    <p><font size="4" color="green">Go back to login screen</font></p>
    <%
              else
    %>
         <font size=4 color="red">Invalid user....</font>
         <p><font size="4" color="green">Go back to login screen</font></p>     
    <%
         stmt.close();
         cdb.close();
    // conn.close();
    %>
    <!--mstheme--></font>
    </body>
    </html>
    hope this will help you. bye....

  • Please help me with the jsp page

    Hi,
    I have a parent jsp page. I have a button in that page. If I click the button in the parent page, a child page will be opened which consists of huge data. I have set an option such that if I click the jsp page it asks to open directly or save so as to edit the data in MSWORD format. The child page has a print button at the end of the page which prints all the data. But since the data is very vast I want page breaks at certain places so that when I edit the data and click print button it prints the data with page breaks at certain points. I know that in MSWORD we have page breaks. But I should not do it manually as there would be thousands and thousands of pages to be printed.
    ANY IDEA OR HELP IN THIS MATTER IS GREATLY APPRECIATED. I HAVE BEEN TRYING TO SOLVE THIS MATTER AND POSTED IN MANY SITES. BUT NOBODY RESPONDED. ATLEAST PLEASE LET ME KNOW IF THE IDEA WHICH I MENTIONED IS WORNG OR NOT.
    THANKYOU
    MOUNTAINEER

    use java report?

  • Please Help (Mouse input and graphics for small game)

    Hi everyone, I'm new to this forum, but it looked like a good place to get some help with a simple-ish game I've been working on. I sorta posted the beginnings of it on a forum dedicated to another cool game called Soldat.
    So that I don't have to retype much about the game itself, the link to the discussion is here (please mind the non-dev talk in there):
    http://www.soldatforums.com/topic.asp?topic_id=20916
    and the start of the 'game' is here:
    http://llsc.us/members/Solidarnosc/uploads/SolidarnoscNew.jar
    Anyhow, I need some advice on fast graphics. My game is sorta 3D (sorta-3D = that enigmatic 3D look in a 3D environment with sprites and no perspective), but I managed to use some simple mathematics and the basic AWT drawing methods to replicate 3D. The problem is that this is rather slow.
    I have started to have a look at different methods of drawing such as OpenGL using JOGL etc, but this is all rather daunting at the moment for someone somewhat self taught (OK, I have done a bit of Java at high school, but it didn't get as far as using such big words as Classpath, Package, let alone Buffer) and I seem to have a curse like Tubbers when it comes to semi-complicated tutorials. Ideally, it would be handy if there was a very simple example or a class that extended a Frame or something similar that had a modified graphics/drawing system with a 'perfect' buffering system (OK, maybe I'm dreaming).
    The other thing that I need help with is mouse movement detection. Currently, I am using a simple system of reading the mouse position on the frame to determine movement, but ideally I need a system that allows the mouse to keep moving without the constraints of the cursor needing to be in the form and not moving at edges of screen, etc.
    Help would be appreciated, but thanks for reading this anyway.

    Maybe I'm not making myself clear here (or maybe I
    missed a sign that that said "open source only"). I
    don't need a part of my program fixed by someone else
    as such, but rather I was just wondering what the
    easiest way to speed up AWT graphics is and how can I
    read mouse motion (specific to neither the cursor nor
    the application's frame) or even just set the
    cursor's position relative to frame. Failing that,
    can someone tell me how I should read mouse input in
    a way similar to a standard First Person Shooter?Unless I am missunderstanding what you want again, then take a look at AWT's Toolkit, it has
    public void addAWTEventListener(AWTEventListener listener,
                                    long eventMask)and it should do what you want.

  • URGENT PLEASE HELP!!! jsp changes not geeting reflected

    Hello all,
    I am very new to java/jsp.
    I have a jsp file, which was working till I made changes . I made changes to it like changing the title. I complied it, and compiled with no errors. I deployed it in a remote server . cleared the cache of the server and bounced it. When I test it it doesn't reflect my changes.
    please provide some suggestions .. what should i do..
    thanks in advance.

    I understand that it should be able to detect the change and recompile . but still the problem persists... Try using a complete refresh in the browser (ctrl+F5) so that it reloads everything.
    It determines if a JSP needs to be recompiled by looking at the date/time of the jsp.
    Make sure that the time of the JSP is recent, otherwise it doesn't bother to recompile it. Can occur if the server machine and your own machine have different times set.
    What server are you using? What version?
    Where are you putting the JSP file?

  • Please help..servlet calling JSP

    I have a servlet that for the time being (cut out all validation code...everything) is just trying to call a JSP. I keep getting The requested URL /servlet/hellos was not found on this server.---I'm running this at my local host, so it is not a path problem. the code is below.--
    Note..when I use getServletContext().getRequestDispatcher("/servlet/log"); this works (calling another servlet) but when the below is executed I get the error.
    package hellos;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class hellos extends HttpServlet {
    public void doGet (HttpServletRequest req, HttpServletResponse res)
         throws ServletException, IOException
              RequestDispatcher dispatcher =
              getServletContext().getRequestDispatcher("/ITS/itsLoginhtml.jsp");
              dispatcher.forward(req, res);

    Ok here is what is going on. I don't want to use redirect I want to use the dispatcher. The code is below and it works with redirect, but not dispatcher???? It says the URL cannot be found on server?????Can anyone help me get the dispatcher to work??
    package hellos;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class hellos extends HttpServlet {
    public void doGet (HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException
              res.sendRedirect("/ITS/itsLoginhtml.jsp");
              //RequestDispatcher dispatcher =
                        //getServletConfig().getServletContext().getRequestDispatcher("/ITS/itsLoginhtml.jsp");
              //dispatcher.forward(req, res);

  • Please help ... evaluating jsp:expression in attributes

    Dear All,
    I have searched the forum and found a few posts expressing a similar problem. However none seemed to divulge any solution.
    <option value="<jsp:expression> signals[count] </jsp:expression>"><jsp:expression> signals[count] </jsp:expression></option>In the code above the second expression evaluates fine but the first causes problems. Its the angle brackets of the jsp:expression:
    The value of attribute "value" must not contain the '<' characterI have also tried <%= %> and %= % as has been suggested in previous posts
    <%= => fails also because of the angle brackets
    %= % is set to the value, instead of the evaluated expression.
    Am Completely Stumped. Surely there must be a way to do this!?!
    Thanks is advance

    Hi Steve, thanks for your help I have resolved the problem. Somewhere in the J2EE Tutorial I found a snippet of code that talked about using CDATA tags.
    My working code now looks like this:
    <td><select name="signal_list" multiple="multiple">
        <jsp:useBean id="signalslist" class="acreweb.SignalsList" scope="session" />
            <jsp:scriptlet>
                int count = 0;
                System.out.println("useBean");
                String[] signals = signalslist.getSignals();
                while(count < signals.length)
         //Display signal names in select box
         System.out.println(signals[count]);
         </jsp:scriptlet>
              <![CDATA[<option value=']]><jsp:expression>new String(signals[count])</jsp:expression><![CDATA[' />]]><jsp:expression> signals[count] </jsp:expression>
         <jsp:scriptlet>     
         count++;
               </jsp:scriptlet>
        </select>
    </td>Sorry about formatting am being dragged to the pub, impatient work colleagues

  • Please help me urgently, Ajax Jsp issue (Escape Character issue)

    Hi all,
    in my application
    i am making an ajax call with a paramter
    like
    http://www.abc.com/Login.jsp?query=%25
    and iam encoding that parameter with encodecomponent() function of javascript
    but
    in my servlet iam getting the parameter as
    query=%
    how to solve this
    if i am not clear
    i will try to explain clearly again
    so it is failing to decode it again
    how to solve this issue
    iam using firebug debugger
    in that it is showing th url as specified above
    but in params tab it sho

    Can you use URLDecoder.decode(String) on the parameter
    [http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLDecoder.html]

  • Please, HELP me. Servlet/JSP

    Hi,
    I have a servlet that builds an URl to extract the .XLS file fromt he repository. Becoz MS EXCEL is unable to open if there are more than 65000 records, I split the files which are holding over 60,000 records in to two parts. naming them like filenamePart1.XLS and Filenamepart2.XLS.
    Now my problem is. How can i check whether my file has more than 60,000 records is there any direct method. I wrote the following program, but is not working fine.
    One more problem is ,How can i display these split files?.Again Remember, I used to build the URL and open it using Request dispatcher and forwarding the request. But now I have two files. How can I go about it. Any suggestion or code would be appriciated. Thank you.

    Infact I have the same file in .TXT format in the same
    folder, So I am checking this from txt file(
    filename.txt). It still doesn't work.I belive the
    following servlet code explains better.1��. Try to call the method countLines with the full path of your file.(e.g. "C:\\reports\\filename.txt"). Should work.
    If you want to count the records of your xls file
    take a look at http://jakarta.apache.org/poi/hssf/index.html. Can help you manipulate Excel files from java.
    2��. To display the 2 files in your browser (if that's what you want...)
    you can respond from your servlet with an html like the following:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <HTML>
    <HEAD>
    <TITLE></TITLE>
    </HEAD>
    <SCRIPT LANGUAGE="JavaScript">
         function openFiles() {
              window.open('url-of-filenamePart1.XLS ','file1','toolbar=yes,status=yes,scrollbars=yes,location=yes,menubar=yes,directories=yes,width=640,height=480');
              window.open('url-of-filenamePart2.XLS ','file2','toolbar=yes,status=yes,scrollbars=yes,location=yes,menubar=yes,directories=yes,width=640,height=480');
    </SCRIPT>
    <BODY onLoad="openFiles();">
    </BODY>
    </HTML>
    2 windows for the 2 excel files will be popped up. url-of-filenamePart1.xls and url-of-filenamePart2.xls are the values of the String variables urlPdf1 and urlPdf2 in your code.
    Regards
    BG

  • Please help with input

    Sorry just trying to save some time. Instead of going through pages and pages, i would rather just ask someone. I am planning on getting the K8N SLI-F motherboard and will be running 1gb (2 512mb sticks) of Geil Ultra Platinum PC3200 ram. Are there any known conflicts with this setup? Not that it should matter but i will be running an AMD 64 3200+ cpu and will likely not do much overclocking (if any).

    Shouldn't be have a problem with that. But make sure you've the gd PSU.

  • Can't decode JSP Server Error Please help!

    Hi,
    I wrote this code and I get this huge server error when I run it and I can't for the life of me figure out what's wrong, can someone please help me debug my jsp or explain to me what any of those errors mean?
    Here is the error message:
    type Exception report
    message
    description
    The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    java.lang.NullPointerException
         at org.apache.jsp.Pdb_Add_jsp._jspService(Pdb_Add_jsp.java:530)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:536)
    Apache Tomcat/4.1.24
    Here is the code: Pdb_Add.jsp
    <%@ include file="authenticate.jsp" %>
    <%@ page import="java.sql.*" %>
    <%
    String connectionURL = "jdbc:mysql://localhost:3306/xxxxx?user=****&password=***";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    %>
    <html>
    <head>
    <title>Project Portal Confirm New Project</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="style.css" rel="stylesheet" type="text/css">
    <link type="text/css" rel="stylesheet" href="xtree.css">
    <script src="xtree.js"></script>
    </head>
    <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
    <table bgcolor="#ffffff" width="761" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="337" valign="top">
         <table width="761" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="11" valign="top"><IMG height=1 src="images/spacer.gif" width=1></td></tr>
          <tr>
            <td height="291" valign="top">
              <table width="761" border="0" cellspacing="0" cellpadding="0">
                   <tr>
                        <td width="10"><IMG height=1 src="images/spacer.gif" width=1></td>
                        <td width="399" valign="top">
                        <table width="399" border="0" cellspacing="0" cellpadding="0">
                        <TBODY>
                             <tr><!--IMAGE SQUARE ONE: TOP -->
                                  <td height="300" background="images/BB7250.jpg"><IMG height=1 src="images/spacer.gif" width="100%"></td>
                             </tr>
                             <tr>
                                  <td height="0" valign="top">
                                       <table width="300" height="200" border="0" cellpadding="0" cellspacing="0">
                                       </tr>
                                       </table>
                                  </td>
                             </tr>
                        <tr></tr>
         </table>
         </td>
                      <td width="340" valign="top">
                        <table width="340" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                      <td height="91" valign="top">
                          <table width="340" height="88" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="3"><IMG height=1 src="images/spacer.gif" width=1></td>
                            <td width="167" valign="top" background="images/S1.gif">
                                       <table width="167" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                 <td width="80"> </td>
                                                 <td width="86" valign="top" class="text2" style="PADDING-TOP: 24px"></td>
                                            </tr>
                                       </table>
                                  </td>
                                  <td width="3"><IMG height=1 src="images/spacer.gif" width=1></td>
                            <td width="167" valign="top" background="images/V.gif">
                                       <table width="167" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                 <td width="70"> </td>
                                                 <td width="95" valign="top" class="text2" style="PADDING-TOP: 23px"></td>
                                            </tr>
                                       </table>
                                  </td>
                          </tr>
                     </table>
                         </td>
                   </tr>
                      <tr>
                      <td height="88" valign="top">
                          <table width="340" height="88" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="3"><IMG height=50 src="images/spacer.gif" width=1></td>
                            <td width="77" valign="top" background="images/and.gif">
                                       <table width="167" border="0" cellspacing="0" cellpadding="0">
                                          <tr>
                                             <td width="80"> </td>
                                              <td width="86" valign="top" class="text2" style="PADDING-TOP: 21px"></td>
                                            </tr>
                                       </table>
                                  </td>
                                  <td width="3"><IMG height=1 src="images/spacer.gif" width=1></td>
                            <td width="167" valign="top" background="images/V.gif">
                                       <table width="167" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                            <td width="77"> </td>
                                            <td width="90" valign="top" class="text2" style="PADDING-TOP: 21px"></td>
                                            </tr>
                                       </table>
                                  </td>
                         </tr>
                      </table>
                          </td>
                   </tr>
                      <tr>
                      <td valign="top" style="PADDING-LEFT: 4px">
                          <table width="336" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="300" height="4" valign="top" background="images/spacer.gif">
                                 </td>
                          </tr>
                               <tr>
                            <td width="300" height="116" valign="top" background="images/portalspiral.jpg">
                                 </td>
                          </tr>
                      </table>
                          </td>
                   </tr>
                </table></td>
                <td><IMG height=1 src="images/spac" width=1></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td valign="top">
              <table width="761" height="35" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="10" valign="top"> </td>
                <td width="517" valign="top">
                   <table width="517" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td valign="top">
                        <table width="517" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td height="3" bgcolor="#000000">
                             <IMG height=1 src="images/spacer.gif" width=1></td>
                      </tr>
                      <tr>
                        <td valign="top">
                             <table width="250" border="0" cellspacing="0" cellpadding="1">
                            <tr>
                              <td width="75" valign="top">
                                       <A href="PIndex.html"><IMG height=31 src="images/but2.gif" width=99 border=0></A></td>
                              <td width="80" valign="top" style="PADDING-RIGHT: 1px">
                                       <A href="ProjectPortal_Add.html"><IMG height=31 src="images/but3.gif" width=104 border=0></A></td>
                              <td width="100" valign="top" style="PADDING-RIGHT: 6px">
                                       <A href="index-2.html"><IMG height=31 src="images/but4.gif" width=104 border=0></A></td>
                              <td width="100" valign="top">
                                       <A href="PDir.html"><IMG id=IMG1 height=31 src="images/but5.gif" width=134 border=0 ></A></td>
                              <td width="75" valign="top">
                                       <A href="index-4.html"><IMG height=31 src="images/but6.gif" width=99 border=0></A></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td height="1" bgcolor="#e3e3e3">
                        <IMG height=1 src="images/spacer.gif" width=1></td>
                  </tr>
                </table></td>
                <td width="150" valign="top">
                   <table width="150" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="3" bgcolor="#000000"><IMG height=1 src="images/spacer.gif" width=1></td>
                  </tr>
                  <tr>
                    <td height="1"><IMG height=1 src="images/spacer.gif" width=1></td>
                  </tr>
                  <tr>
                    <td height="31" valign="top">
                        <table width="150" height="31" border="0" cellpadding="0" cellspacing="0" background="images/spacer.gif" bgcolor="#ffffff">
                      <tr>
                        <td width="80" valign="top" style="PADDING-TOP: 7px"><IMG height=25 src="images/spacer.gif" width=56></td>
                        <td width="100" valign="top" style="PADDING-RIGHT: 4px; PADDING-TOP: 8px"
                               ><input name="textfield" class="form" ></td>
                        <td valign="top" style="PADDING-TOP: 5px">
                             <A href="#"><IMG height=21 src="images/minis.gif" width=20 border=0></A></td>
                      </tr>
                    </table></td>
                  </tr><tr>
                       <td height="1" bgcolor="#e3e3e3"><IMG height=1 src="images/spacer.gif" width=1></td>
                      </tr>
                </table></td>
                <td><IMG height=1 src="images/spacer.gif" width=1></td>
              </tr>
            </table></td>
          </tr>
        </table></TD></TR>
      <tr>
        <td height="362" valign="top">
         <table width="761" height="362" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="218" valign="top">
              <table width="218" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="12" valign="top">
                    <IMG height=1 src="images/spacer.gif" width=1></td>
                <td width="218" valign="top">
              <table width="218" border="0" cellspacing="0" cellpadding="0" style="WIDTH: 218px; HEIGHT: 472px">
              <tr>
                <td width="12" valign="top"><IMG height=1 src="images/spacer.gif" width=1></td>
                <td width="205" valign="top">
                <IMG alt="" src="file://C:\Documents and Settings\atavakkolie\Desktop\Project Portal\images\PDir.gif"
                      id=IMG1
                     >
                      <DIV id=DIV1
                      style="PADDING-RIGHT: 5px; PADDING-LEFT: 15px; LEFT: 5px; PADDING-BOTTOM: 5px; OVERFLOW: auto; WIDTH: 200px; PADDING-TOP: 0px; POSITION: relative; TOP: 10px; HEIGHT: 100%"><!-- js file containing the tree content, edit this file to alter the menu,
                        the menu will be inserted where this tag is located in the document -->
                      <SCRIPT src="tree.js"></SCRIPT>
                      </DIV></td>
                     <td>
                        </td>
              </tr>
            </table></td>
              </tr>
            </table></td>
            <td width="1" valign="top"><table width="1" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="2"><IMG height=1 src="images/spacer.gif" width=1></td>
              </tr>
              <tr>
                <td height="920" bgcolor="#e3e3e3"><IMG height=1 src="images/spacer.gif" width=1></td>
              </tr>
              <tr>
                <td height="2"><IMG height=1 src="images/spacer.gif" width=1></td>
              </tr>
            </table></td>
            <td width="542" valign="top">
              <table width="542" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="530" valign="top">
                   <table width="530" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td valign="top">
                        <table width="530" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td height="41" valign="top" style="PADDING-TOP: 6px"><IMG id=IMG1
                                  style="LEFT: 409px; TOP: 552px" height
                                  =44 src="images/Addp.gif" width=207></td>
                      </tr><!-- Form starts here-->
                      <tr>
                        <td valign="top"
                                >
                             <table width="530" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td class="text" style="PADDING-LEFT: 18px">
                                      <!-- ***** START EDITABLE REGION  -->
    <%
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    connection = DriverManager.getConnection(connectionURL, "", "");
    statement = connection.createStatement();
    String name = request.getParameter("name");
    String email = request.getParameter("email");
    String pname = request.getParameter("pname");
    String pmanager = request.getParameter("pmanager");
    String svvpp = request.getParameter("svvpp");
    String pdphase = request.getParameter("pdphase");
    String pdptarget = request.getParameter("pdptarget");
    String etimecode = request.getParameter("etimecode");
    if( request.getParameter("name").equals("") || request.getParameter("email").equals("") || request.getParameter("pname").equals("")
    || request.getParameter("pmanager").equals("") || request.getParameter("svvpp").equals("") || request.getParameter("pdphase").equals("")
    || request.getParameter("pdptarget").equals("") || request.getParameter("etimecode").equals(""))
    out.println("<b>ERROR:</b> All fields were not filled out. Please go back and try again.");
    else
    try
      int retval = statement.executeUpdate("INSERT INTO project VALUES('" + name + "," + email + "," + pmanager + "," +  svvpp + "," + pname + "," + pdphase + "," + pdptarget + "," + etimecode + "')");
      out.println("<b>SUCCESS:</b> Your changes have been successfully written to the database.");
      session.putValue("entry", "<b>" + pname + " (Add Project)</b>: added user with email: " + email + ", pmanager: " + pmanager + ", svvpp: " + svvpp + ", pdphase: " + pdphase + ", pdptarget: " + pdptarget + ", etimecode: " + etimecode);
      %>
      <jsp:include page="log.jsp" />
      </jsp:include>
      <%
      catch (SQLException e)
       if (e.getErrorCode() == 1062)
       { out.println("<p><b>ERROR:</b> There is something wrong. Please go back and try again.</p>");
       else
        out.println("<p><b>ERROR:</b> Unexpected error <b>" + e.getErrorCode() + "</b> occurred.</p>");
        out.println("<p>" + e + "</p>");
    %>
                        </td>
                         </tr>
                        </table>
                            </td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
                <td width="12"> </td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="71" valign="top"><table width="761" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table width="761" height="25" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="13">
                   <IMG height=1 src="images/spacer.gif" width=1></td>
                <td width="738" align="middle" background="images/back_4.gif" bgcolor="#808080" class="links">
                   <A class=links href="index.html"><strong> Home page</strong></A> 
                   |  <A class=links href="index-1.html"><strong>About us</strong></A> 
                   |  <A class=links href="index-2.html"><strong>Search</strong></A> 
                   | <A class=links href="index-3.html"><strong> Contact</strong></A> 
                   |  <A class=links href="#"><strong>SV&V Links</strong></A> 
                   |  <A class=links href="index-4.html"><strong>Help</strong></A> 
                   |  <A class=links href="#"><strong>Site map</strong></A> 
                   |  <A class=links href="#"><strong>Links</strong></A></td>
                <td width="10">
                   <IMG height=1 src="images/spacer.gif" width=1></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="18" valign="top"><IMG height=1 src="images/spacer.gif" width=1></td>
          </tr>
          <tr>
            <td align="middle" valign="top" class="copy">
              <A class=copy style="TEXT-DECORATION: none" href="index-5.html" >Copyright 2004-2005 � SV&V Project Portal. All rights reserved.</A></td>
          </tr>
        </table></td>
      </tr></TBODY></TABLE></TABLE>
    </body>
    <script>
    function addNode() {
         if (tree.getSelected()) {
              tree.getSelected().add(new WebFXTreeItem('New'));
    function addNodes() {
         if (tree.getSelected()) {
              var foo = tree.getSelected().add(new WebFXTreeItem('New'));
              var bar = foo.add(new WebFXTreeItem('Sub 1'));
    function delNode() {
         if (tree.getSelected()) {
              tree.getSelected().remove();
    </script>
    </html>

    request.getParameter("name").equals("")You are using this in your 'if' statement. But if a parameter by the name "name" is not found, it would return a null reference and calling equals() would call a NullPointerException.
    I observed that you are already assigning those parameters to Strings. You should add null checking for each of them. :)

  • Urgent, Please help !!! Input Date field in Mysql database using JSP

    Hi All,
    Please help me ! I am trying to store a date field in MySql databaseusing JSP on Tomcat Server.I am gettting the following error.
    I am taking the String Input and then trying to convert it into date type
    inorder to store it into date field in a database.
    I am using the following code :
    <%
    try{
    String dt=request.getParameter("avldt");
    SimpleDateFormat adt= new SimpleDateFormat("dd-MM-yyyy");
    Date sqlToday = new java.sql.Date(adt.parse(dt).getTime());
    catch(ParseException e){
         e.printStackTrace();
    %>
    But I am getting the following error message :
    Class jsp.myjsp.SimpleDateFormat not found.
    Please help me !!!.It's very urgent.
    Thanks,
    Savdeep

    programming is more then copy pasting, it actually is usefull to think about what you are doing. First you declare that you date is format dd-MM-yyyy, then you want to parse a date in format dd/MM/yyyy and behold Java warns you it cannot parse the one into the second ! Cant you solve the rest of this puzzle yourself then ?

Maybe you are looking for

  • When opening adobe priemere elements 11 get incompatible display driver error message?

    have intel ( r ) hd graphics 2.1.0. build 8.15.10.2622---gone to intel display driver on my pc and it is up-to-date----is adoble elements not liking my current display driver on my pc and if so what can i do?

  • HP Protect Smart not working with windows 7

    Hi there i bought hp dv4 special edition with windows vista installed  hp protect smart was working fine on windows vista  i replaced vista by windows 7 RC but HP protect smart not working now ( disabled because the drive is not supported!!!!!!!!) i

  • Installing CS3 on Yosemite

    I own 2 copies of CS3 and I'm trying to install one on a new macbook pro running Yosemite. When I try to enter my serial number, it says my serial number is not valid. I've tried both serial numbers I own, but can't get CS3 to accept them. Additional

  • In a search...how do I change "Last Opened" to "Date Modified"

    This has been driving me crazy for a long time and I want to fix it. When I do a search for a file the menu lists: File name | Kind | Last Opened I really couldn't care less when the last time a file was opened. As a matter of fact I don't even under

  • HP LP3065 Monitor issue

    I am a proud owner of a HP LP3065 and I have recently incurred some issues.  When I plug it in and boot the PC it starts with a full screen then goes to a situation where it cuts off and then about 30 seconds, it comes back and repeats this for ever.