• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

NumberFormatException : null

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help
Im not able to find wheres the problem and how to resolve



The servlet is to upload 2 files and insert the data in the form.

 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what's the problem? What line it is on?

Here's some helpful hints:

  • Just posting a bunch of code and asking "what's wrong with it?" isn't an effective way to get help on an issue.
  • Always provide the exact error message, not your paraphrasing of it.
  •  
    Gaurav Wadhwani
    Ranch Hand
    Posts: 68
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Problem is the exception generated...its on line 115





     
    Bartender
    Posts: 4568
    9
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    It seems likely that one of the parameters you think is an integer isn't in fact an integer. If you want more than that you'll have to tell us where the error happens.

    Edit: ah, there you go. What's the value of the day parameter?
     
    Bear Bibeault
    Sheriff
    Posts: 67637
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Basic debugging step #1, what is the value returned by the call to getParameter()? That's something that should be checked long before you post the problem to a forum.
     
    Gaurav Wadhwani
    Ranch Hand
    Posts: 68
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    ok i checked....it returns null.

    the form has a element with name "day". Then why the problem?

     
    Bear Bibeault
    Sheriff
    Posts: 67637
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Use a tool such as HttpFox for Firebug to see the HTTP request for the form submission. Is the request parameter there as you expect?
     
    Gaurav Wadhwani
    Ranch Hand
    Posts: 68
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    you are right...
    I tested using HttpFox, it doesnt return any value...



    and if you notice 2 rows below it, then those the images i want to be uploaded. Method turns into GET....thats strange
     
    Gaurav Wadhwani
    Ranch Hand
    Posts: 68
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Ok i found the solution....

    Multipart/form is handled dependent on the API one uses. I used Apache's org.apache.commons.fileupload . for it this is the way to go...

    request.getParameters() wont work...


     
    There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
    free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
    reply
      Bookmark Topic Watch Topic
    • New Topic