Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP Status 500

 
tushar panda
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is what i got when i tried to pass servlet data to the same servlet.

output at browser :



servlet code :


is there a error in transferring the data from the servlet to itself
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a Tomcat question. Moved to the Servlets forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the important part:
java.lang.NullPointerException
auction.doPost(auction.java:21)
 
tushar panda
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
auction.doPost(auction.java:21)


line 21 is :
if(itemid.trim().equals(""))

and i don't think there is an error here


entire code is :



my purpose of writing this program is to transfer form data to servlet and if any data is not filled ,it is asked again to do so,
but the problem is i am unable to transfer the servlet data to the same servlet .

 
Charbel Keyrouz
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you sure that the itemid is not null?

You should change your tests to take into consideration the null values.
 
tushar panda
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Charbel Keyrouz wrote:are you sure that the itemid is not null?

You should change your tests to take into consideration the null values.


yeah i took null and got the result , but what't the difference between null and blank("")

cheers
Tushar
 
salvin francis
Bartender
Pie
Posts: 1227
10
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a huge difference between both.

Think of strings as an object.

so "", is also an Object in memory. it has properties such as length, etc.

now lets look at null, Its a Black hole, not even light can accept it.

a null is a reference thats initialised to nothing [pardon my non technical grammer here]
rather it "refers" to nothing.

consider the diff between:




and


and


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic