It's not a secret anymore!
The moose likes Servlets and the fly likes HTTP Status 500 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "HTTP Status 500 " Watch "HTTP Status 500 " New topic
Author

HTTP Status 500

tushar panda
Ranch Hand

Joined: Feb 16, 2009
Posts: 133
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

Do Right , Fear No Man
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

Not a Tomcat question. Moved to the Servlets forum.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

Here's the important part:
java.lang.NullPointerException
auction.doPost(auction.java:21)
tushar panda
Ranch Hand

Joined: Feb 16, 2009
Posts: 133
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

Joined: Jun 10, 2005
Posts: 46
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

Joined: Feb 16, 2009
Posts: 133
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
Ranch Hand

Joined: Jan 12, 2009
Posts: 915

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



My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 500
 
Similar Threads
Servlet becomming slow
http error?
Servlet becomming slow
Hi 'm strugling lot to run a simple hello world prgm
servlet exception occurs at "dispatcher.forward()"