Form jsp data are not going to servlet

Hi guys
i got a problem doing my uni assignment. this is an assignment about taking data from a html webpage. then storing the data in a xml document through java servlet. the problem is when i try to pass tha data through servlet it doesnt work. the error message it give is following:
Error: 500
Location: /BookingApp/servlet/BookingProcessServlet
Internal Servlet Error:
java.lang.NullPointerException
     at BookingProcessServlet.generateDOM(BookingProcessServlet.java:119)
     at BookingProcessServlet.doPost(BookingProcessServlet.java:294)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
     at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
     at org.apache.tomcat.core.Handler.service(Handler.java:235)
     at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
     at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
     at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
     at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
     at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
     at java.lang.Thread.run(Thread.java:479)
the coding in the corresponding linnes mentioned in the error message i have givan below:
for at BookingProcessServlet.generateDOM(BookingProcessServlet.java:119)
          BookingBean [] bookinglist = (BookingBean []) bookings;
     >>>>     for(int i=0; i<bookinglist.length; i++) >>>> this the line where the error is shown
               if (bookinglist[i] != null)
                    bookingcount++;
               else
                    continue;
for at BookingProcessServlet.doPost(BookingProcessServlet.java:294)
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
     String action = request.getParameter("action");
     if (action != null && action.equals("Back"))
          if(insertBookingToSession(request))
               response.sendRedirect("../jsp/deafault.html");
          else
          response.sendRedirect("../jsp/ListFullError.html");
     else if (action != null && action.equals("Confirm"))
          Document newDOMTree = generateDOM(request);
          generateXMLDocument(newDOMTree);
          HttpSession session = request.getSession(true);
          session.removeAttribute("BookingList ");
          response.sendRedirect("../jsp/confirm.html");
Please this is is urgent. the problem is I am new in JSP and Java Servlet programming. So I dont have any idea what is this problem.
please reply as soon as possible. thank u guys.
waiting for the replies.

hei chk d ff code : this code works i tried dis before i gave it to u
<HTML>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%
if(request.getParameter("submit")!=null){
     String filename="C:/Program Files/Apache Group/Tomcat 4.1/webapps/lbc/xml/test.xml";
     String xmlString = "<xml>";
     Enumeration enums = request.getParameterNames();
     while(enums.hasMoreElements()){
     String tagname= (String) enums.nextElement();
     xmlString = xmlString +"<"+tagname+">";
     xmlString = xmlString +request.getParameter(tagname);
     xmlString = xmlString +"</"+tagname+">";
     System.out.println(xmlString);
     try {
     BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File(filename)));
     bos.write(xmlString.getBytes());
     bos.flush();
     bos.close();
     catch (IOException ioe) {
     System.out.println(ioe.toString());
response.sendRedirect("Confirmation.jsp");     
%>
<TABLE CELLSPACING="1" CELLPADDING="0" BORDER="0" WIDTH="50%">
<FORM method="post" NAME="test">     
     <TR>
     <TD BGCOLOR="#94976E">First Name:</TD>
     <TD><input type="text" name="fname"/></TD>
     </TR>
     <TR>
     <TD BGCOLOR="#94976E">Last Name</TD>
     <TD><input type="text" name="lname"/></TD>
     </TR>
     <TR>
     <TD BGCOLOR="#94976E">Middle Initial</TD>
     <TD><input type="text" name="iname"/></TD>
     </TR>
     <tr>
     <td colspan="2" align="center"><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Send"/></td>
     </tr>
</FORM>
</TABLE>
</HTML>

Similar Messages

  • After editing file in ACR 8.6 (Mac) , the file (NEF and XMP) modification dates are not updated

    With both my Mac's, reset Photoshop C  (2014) to previous version 2014.0. Now find that after editing file in ACR 8.6 (Mac) , the file (NEF and XMP) modification dates are not updated. Reloaded camera raw, etc., but still find modification dates are not updated, either using Finder or using Bridge to view dates. Editing other files, PSD, DNG, TIFF, etc., are updated and the information is correctly displayed.

    Ok, not entirely sure what I did but it's now working (Bizarre!). The only thing I did was 'eject' the ACR 8.6 .dmg file from the finder side bar and restart PS CC, so that may have been where I was going wrong all along!
    However, I now have another issue in that there is no preview of the shot in Finder on my iMac when I highlight the NEF file. I assume this is simply because Apple haven't yet released an update for the new D810 NEF files and so the computer doesn't know what it's looking at?!?
    If anyone has any other ideas though, then I'm more than willing to listen.
    Thanks again.

  • Reminders are not going off in my Calendar app

    Hi,
    The reminders I set in the Calendar app are not going off/alarming. I'm currently using Gmail as my default calendar, and it doesn't alarm when a reminder is due.
    I've already fixed the date-time settings of my gmail calendar to match my blackberry, and I still miss reminders because they don't alarm.
    Whenever I restart my q10, the reminders apprently go off/alarm, but as the day goes on, my reminders no longer alarm. does anyone else have the same problem? Any advice? Thanks. 
    Santi

    Hello santi51, 
    Welcome to the forums. 
    I would suggest you you contact your mobile service provider and ask that this issue be escalated to BlackBerry support for investigation and analysis. 
    -SR
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • WHAT ARE THE FORMS (SCRIPTS) WHICH ARE NOT PROVIDED BY STANDARD SAP?

    WHAT ARE THE FORMS (SCRIPTS) WHICH ARE NOT PROVIDED BY STANDARD SAP?

    Hi Pravin
    For a beginner in CRM - Sales would be a right choice to understand how CRM behaves when integrated with backend R/3.
    Still as far as CRM goes, most of the components are not exposed to their fullest potential and that is why its not outshining the competitors in market.

  • My photos from camera row are not going all to photostream in any device, iphone 4s and ipad mini What can I do, please.

    My photos from camera row are not going all to photostream in any device, iphone 4s and ipad mini What can I do, please.
    Both devices have the Icloud on.

    Try this on All Devices...
    Close All Open Apps...  Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430

  • Datas are not available to the query when upload a Infopackage

    Hello People,
    I Would like to know what can be the reason ..why the datas are not available when we execute an upload from FlatFile to the Cube (this one is the last target one).
    Considering tere aren´t any poroblem in may target (Cube)
    The system shows us the upload was ok, but the status about the "available datas to the query" was not activated.
    Thanks,
    Rosana.

    Hi ,
    Please go to T code SE16--> Table RSDDAGGR
    Here AggrUID(STARTUID)  give not equal to blank, you will get list of all the cubes which has aggregates.
    If your cybe is in this list , you need to rollup the data to mae this available in reporting.You can rollupp the data by going into Manage of the cube.
    -Vikram

  • Restore from time machine does not list all my backups.  I know they exist but there dates are not present on the restore list.  Any help appreciated.

    Restore from time machine does not list all my backups.  I know they exist but their dates are not present on the restore list.  Any help appreciated.  If I must use one of these older dates to restore, how do I then get the more current data off time machine?

    Ok, so am i correct in saying that the steps to fix are as follows.
    That's one option, but not what I meant by restoring in the time-travel view. The latter is what you get when you enter Time Machine.
    is the fresh install not going to be able to "see" the time machine backups that I have at the moment.
    It should, but sometimes people report that it fails. I'm not sure why that happens.

  • My documents are not going to the cloud from pages what should i do?

    Some of the documents that I have on my iphone are not going to icloud.  I went to the settings and i am supposed to be saving my documents to icloud but when i go to the icloud they are not there

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • When I plug in my iPhone to sync, it starts but does not complete the process and several pieces of data are not being transferred to my iPhone from my MacBook Air.

    Problem:
    When I plug in my iPhone to sync, it starts but does not complete the process and several pieces of data are not being transferred to my iPhone from my MacBook Air.
    Any help that you can provide in helping my iPhone accurately sync with iPhoto and iTunes will be greatly appreciated.
    Symptoms:
    1)   Sync:  It’s not completing the sync.  Below, I’ve provided all of my settings from the iTunes Summary tab so that you might tell me if I’ve selected any incorrect options.  I prefer to sync the “old school” way – by connecting to the computer – as opposed to syncing over the cloud. Perhaps this is what’s causing the problem? Here is a list of the steps displayed in the iTunes window as the sync progresses:
    waiting for sync to start (step 1 of 7)
    backing up (step 2 of 7)
    preparing to sync (step 3 of 7)
    determining apps to sync (step 4 of 7)
    preparing apps to sync (step 5 of 7)
    importing photos (step 6 of 7)
    waiting for changes to be applied (step 7 of 7)
    syncing apps / copying 1 of 4 (App name) (step 7 of 7)
    canceling sync
    apple icon
    2)   Photos: I've selected only certain of my iPhoto albums to sync to my iPhone.  All of the albums are correct/complete in iPhoto.  All of the albums are listed on my iPhone, both before and after the sync, but the albums are empty (no actual photos) before and after the sync. Perhaps this is tied to the fact that the sync isn’t completing, but because “importing photos” is one of the steps that the incomplete sync displays, I don’t know.
    3)   Apps: When I launch iTunes and click on the Apps folder under the Library listing, then click on the Updates tab, iTunes searches for any Apps needing to be updated and provides a list.  If I click on Update All, the Apps are successfully updated in iTunes.  But, when I plug in my iPhone so that the updates will transfer to the apps on my iPhone, the updates don’t transfer to the apps on my iPhone and those apps still reflect that they need updating on the iPhone.
    Other Potential Pertinent Info:
    The flash memory hard drive on my MacBook Air recently died (perhaps a month or two ago).  Apple had emailed me about a known issue and literally the next day, my MacBook Air crashed.  I installed a new flash memory drive and re-installed everything from a backup off of an external hard drive.  Everything seems to be working fine; it recreated accurately all of my software and data, including iPhoto and iTunes, the pictures and songs (respectively) for which are stored on that hard drive, as opposed to being on the flash memory in the MacBook Air itself.  However, I don’t recall if the start of the sync problem described herein started happening at the same time that I replaced the flash memory drive.  All I know is that the computer is working perfectly in all respects and that even as the sync is failing, it at least says that it’s doing the right things and looking in the right places (e.g., the list of albums on my iPhone matches the list of albums in iTunes, etc.).
    Settings/Status:
    MacBook Air
    OSX v. 10.9
    iPhoto ’11 v. 9.5 (902.7)
    iPhone iOS 7.0.4
    iTunes v. 11.1.3 (8)
    Summary Tab
    Backups (This Computer)
    Options
    Automatically sync when this iPhone is connected
    Sync only checked songs and videos
    Photos Tab
    Sync Photos from iPhoto (429 Photos)
    Selected albums, Events, and Faces, and automatically include (no Events)
    Albums – 9 are selected

    You need to download iTunes on your computer. iOS 6 requires the latest version of iTunes which is 10.7.

  • Sales data are not integrated in R/3

    Hello
    I use BTE DE_BALE on R/3 to integrate data coming from CRM extension (EEWB). Everythig's fine in the customer FM in R/3 : I get the extension data and I add to table CT_IDOC_DATA segment E1KNVVM with these data, but they are not updated in R/3. I try to debughow the IDoc table CT_IDOC_DATA is integrated and there seems to be a problem. I don't know which ALE configuration has to be done to integrate CRM IDocs (IDoc type seemsto be DEBMAS..). How can I check it ? Is there somewhere I can check that data are not integrated ?
    Thanks

    Hi Karuna
    Nice to have a so quick help.
    Thanks
    Below the source code of my FM :
    DATA :
      gv_partner_guid     TYPE BU_PARTNER_GUID_BAPI,
      gv_partner         TYPE BU_PARTNER,
      gv_crm_application LIKE bapimtcs-gen_chrstr VALUE 'Z1HT',
      s_eewb_saledata    TYPE ZZ1HT_BUPA_MAIN_APPEND,
      t_salesdata TYPE ZZ1HT_TABLE,
      s_salesdata LIKE  LINE OF t_salesdata,
      t_knvv TYPE STANDARD TABLE OF KNVV ,
      s_knvv LIKE LINE OF t_knvv,
      s_bapimtcs TYPE BAPIMTCS,
      t_bapimtcs TYPE STANDARD TABLE OF BAPIMTCS,
      ls_e1knvvm LIKE E1KNVVM.
      REFRESH : t_salesdata,t_knvv,t_bapimtcs.
      CLEAR : s_salesdata,s_knvv,s_eewb_saledata,gv_partner_guid,gv_partner,
              s_bapimtcs,ls_e1knvvm.
      IF sy-uname EQ 'SAGUETTA'.
        break-point.
      ELSE.
        EXIT.
      ENDIF.
      MOVE is_complex_structure-header-object_instance-bpartnerguid
      TO   gv_partner_guid.
      MOVE IS_COMPLEX_STRUCTURE-header-object_instance-bpartner
      TO gv_partner.
      LOOP AT it_bapimtcs INTO s_bapimtcs.
        APPEND s_bapimtcs TO t_bapimtcs.
      ENDLOOP.
      CALL FUNCTION 'COM_BUPA_BAPIMTCS_TO_SET'
        EXPORTING
          iv_partner_guid = gv_partner_guid
          iv_application  = gv_crm_application
        CHANGING
          ct_bapimtcs     = t_bapimtcs
          cs_set          = s_eewb_saledata.
      MOVE s_eewb_saledata-ZZ1HT_DATA TO t_salesdata.
      LOOP AT t_salesdata into s_salesdata.
        CALL FUNCTION 'PI_BP_INIT_IDOC_STRUCTURES'
          IMPORTING
            ES_E1KNVVM = LS_E1KNVVM
          EXCEPTIONS
            OTHERS     = 0.
        MOVE s_salesdata-data_key-salesdom(4) TO LS_E1KNVVM-vkorg.
        MOVE s_salesdata-data_key-salesdom+4(2) TO LS_E1KNVVM-vtweg.
        MOVE s_salesdata-data_key-salesdom+6(2) TO LS_E1KNVVM-spart.
        MOVE s_salesdata-data-perfk TO LS_E1KNVVM-perfk.
        MOVE s_salesdata-data-lprio TO LS_E1KNVVM-lprio.
        CT_IDOC_DATA-MANDT = sy-mandt.
        ls_e1knvvm-msgfn = '004'.
        CT_IDOC_DATA-SEGNAM = 'E1KNVVM'.
        CT_IDOC_DATA-SDATA  = ls_e1knvvm.
        APPEND CT_IDOC_DATA.
        CLEAR ls_e1knvvm.
      ENDLOOP.

  • Event dates are not bolded by Date Navigator in Outlook 2010

    Event dates are not bolded by Date Navigator in Outlook 2010 on my own  calendar.  Events are set to busy but it is not working. View Settings > Other Settings > "Bolded dates in Date Navigator represent days containing items" is
    checked. This previously worked for 2+ years but recently stopped working. All plugins were disabled, Outlook 2010 was uninstalled and then re-installed. OST file was deleted and re-synchronized with Exchange 2007. While the OST was re-synchronizing the
    bolding worked properly but upon next restart of Outlook it went away. Another symptom is that my Scheduling Assistant does not show my free/busy times correctly in my local view. If I look at my own schedule via the Scheduling Assistant of another user, the
    free/busy times show up correctly. My webmail account also correctly shows bolded dates and free/busy suggesting that this is a local problem. Some screen shots below. Anyone have any ideas as to what I need to tweak? Using Oulook 2010 v.14.7116.500 (32-bit).
    This is not a shared calendar.

    Hi,
    If you want to completely uninstall or remove Microsoft Office 2010, we can refer to the following article to do it:
    http://office.microsoft.com/en-us/support/how-to-uninstall-or-remove-microsoft-office-2010-suites-HA104027750.aspx
    Additionally, since the issue doesn’t happen in other computers, I think the issue may be also caused by some third-party programs in your original computer. If the complete uninstallation doesn’t help for this issue, I suggest we can try to perform a clean
    boot in your Windows for more troubleshooting:
    http://support.microsoft.com/kb/929135/en-us
    Thanks,
    Winnie Liang
    TechNet Community Support

  • In IPhoto I changed movie dates after thumb nails were created in IMovie but the new dates are not showing up in IMovie.  Is there someway to refresh the IPhoto event in IMovie?

    Background:  I'm transferring file folders from a Visa laptop via an external hard drive to my IMac.  In the folders are photos and videos from different cameras.  SO I first tried to import to IMovie but it would not recognize any of the files.  So then I imported into IPhoto and both photos and videos were imported and I created events for each folder.  When I first opened IMovie I had to wait for it to create "thumb nails".  Then I could view the events in IMovie BUT the video clips are not together because they have vastly different dates and are mixed with videos from other events.  I looked at the dates and said I can fix that in IPhoto which i did but those new dates are not showing up in IMovie.    I think I need to somehow refresh the event data that Imovie is using but have not found how to do that in either IPhoto or IMovie. 
    I'm doing this on three events with about 100 photos and videos.  But I have many 1000s more to do so need to know how to either fix this or delete these events, reimport, change the dates, then open again in IMovie.   I'm sure that would work but I can't understand why changing the dates in IPhoto is not being reflected in IMovie.  
    Appreciate any tips or pointers.
    OBTW this is my first question as a first time Apple owner. 

    It was suggested I move this question to IPhoto or IMovie which I did. 
    Well moving to a different discussion group did not provide an answer to this question either. But what I finally did was import one batch of photos and videos into IPhoto for a given day at a time. Working with these I could change the date and times in order to get them in the original sequench taken. Then I would create an album with that batch. These would all be on the same day (IMove was closed for this phase). Then I would open IMovie, generate the thumbnails for that album, and select the album I had created. This was necessary because the importing process in IPhoto was using incorrect dates for my video so it was a real struggle finding them in IMove until I developed this approach.
    I believe that this whole process was so screwy because I was importing from an external hard drive not a camera. I had these photos on a PC and did not have the original cameras to use to import directly which I am fairly sure would have made this easier!

  • Emails from the organization are not going through ePrint

    Hi,
    I've been having some issues with the ePrint feature that's configured in one of the printers that we have in our office. The printer is a HP LaserJet 200 color MFP M276nw. Every other client from other email addresses such as Hotmail, Gmail or any other address are able to send emails to our ePrint address and are able to print on it successfully. However, all the emails that are being sent from within our organization are not going through. We get an unsuccesful delivery message from the Exchange server stating that 
    The server has tried to deliver this message, without success, and has stopped trying. Please try sending this message again. If the problem continues, contact your helpdesk
    We had checked with our Exchange administrators and they have advised that the email is trying to be sent, but in the destination it is being rejected. How can I get this issue to be addressed?

    Hello praveen_haridas,
    Welcome to the HP Support forums.  I understand that your corporate emails are failing when trying to send an email to the Laserjet 200 MFP 276nw printer's ePrint email address.
    Are you getting any messages about the failed messages in your ePrintCenter/HP Connected account?  If so what does the message state about the failed job?
    Thank you.  
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • Service Account details are not going through header(OSB Business service)

    Hi
    I have an issue with service account. Assume I have a proxy service A, Business Service B, Proxy service C.
    A invokes B and B invokes C (A --> B --> C). All calls are through http protocol.
    I created a service account with userid and password details and attached it to the Business service B(Static for basic authentication).
    Added log activity in proxy service C for context variable $header to verify whether userid and password are coming through request header or not.
    I executed proxy service A from sbconsole but I couldn't see userid and password details of created service account in the logs. Only nemespace are logged in the file.
    <soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"></soap:Header>>
    Can someone please help me why service account details are not going through business service request. Am I missing any steps?
    Thanks in advance
    KK
    Edited by: 966531 on Oct 23, 2012 4:23 AM

    Basic authentication information is stored under transport headers (check $inbound) whereas $header is populated for message headers (for e.g. - SOAP headers), so you should be checking $inbound instead of $header
    Regards,
    Anuj

  • In XI pro, exporting PDF to Excel problem.  Excel columns and data are not properly aligned.  Help?

    I used 30 day trial of Acrobat XI and all the functions work perfectly.  But, when I buy the program (either download or disk) my PDF that export to Excel is not working.  The excel columns and data are not properly aligned as they should be.  The Trial version aligns everything perfectly.  What is happening?  I use a MAC 10.9.5.  But this shouldn't matter because the trial version works perfectly.  Can anyone help?

    just found out that this is posted in the wrong section.

Maybe you are looking for

  • Opening/Closing Balance value missing in J_3RFCASH15

    Hello, I am having a problem with the new program for printing cash journal for Russia. When I am executing program J_3RFCASH15 and then select the KO-4 form layout the following data is missing: - Opening Balance amount - Closing Balance amount - Da

  • I forgot my answers of security questions when i select (send a mail to reset my security questions) the mail wont received to my mail box?

    i forgot my answers of security questions when i select (send a mail to reset my security questions) the mail wont received to my mail box?

  • Access point strange spectrum

    Hello. I have 5 APs 3602E. They are all enabled for a/b/g/n standards. When I check client statistics I can see different clients using 2.4nGHz protocol and 5nGHz protocol. But if I take radio analyzer I dont see any 5GHz networks available((( Moreov

  • Getting message as attachment!!

    Hi all,, I have an ABAP program where i could send mails to the recipients. But the recipients are able to receive the content of the mails only in attached pdf format. But could not get as a body content in the email. I had passed packing_list-Docum

  • Why can't I ?

    I've used Contribute 2 for several years and love the program. Just upgraded to CS3 (Dreamweaver is on the way) but find a lot of my choices aren't available in the header ,a few are - such as changing text color, font size, etc. , change background