• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NumberFormatException : null

 
Gaurav Wadhwani
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • 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.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
    • Quote
    • Report post to moderator
    Problem is the exception generated...its on line 115





     
    Matthew Brown
    Bartender
    Posts: 4568
    9
    • Mark post as helpful
    • send pies
    • 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
    Author and ninkuma
    Marshal
    Pie
    Posts: 65216
    95
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • 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
    • 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
    Author and ninkuma
    Marshal
    Pie
    Posts: 65216
    95
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • 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
    • 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
    • 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...


     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic