This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Servlet called 3 Times, not once 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 » Sockets and Internet Protocols
Reply Bookmark "Servlet called 3 Times, not once" Watch "Servlet called 3 Times, not once" New topic
Author

Servlet called 3 Times, not once

sam wootton
Ranch Hand

Joined: Apr 16, 2011
Posts: 48
Hi,

Thanks in advance for any help or advice. It is very much appreciated.

My Servlet is being called 3 times, instead of once.

I have a Servlet that is used called using:



Here i call the service:



The problem is that my Servlet is being aclled 3 times.

The number of times its getting called is the same as the number of entities i add (+1).

So if i remove e.g.



... then it only gets called twice. If i remove both entities, then it gets called once, i guess because of:



So it gets called 3 times. But this means all my server code ie executed 3 times.

Regards, Sam
sam wootton
Ranch Hand

Joined: Apr 16, 2011
Posts: 48
One thing ive noticed in my Servlet logging, is that with each call, it gets a little further than it did before the previous call.

There is a pattern (i wonder if this is a clue as to what is going on?):


MFServer.doPost()
MFServer.doPost()
MFServer.doPost()

contentType multipart/form-data; boundary=VkUH7hvdCUBYAUINYdVHAz3pScImfbCvdWe
contentType multipart/form-data; boundary=VkUH7hvdCUBYAUINYdVHAz3pScImfbCvdWe

contentType multipart/form-data; boundary=VkUH7hvdCUBYAUINYdVHAz3pScImfbCvdWe


isMultipartContent true
isMultipartContent true
isMultipartContent true



items.size() 2
item.isFormField() false


items.size() 2
item.isFormField() false
userUploads userUploads
userUploads userUploads


items.size() 2
item.isFormField() false
userUploads userUploads
bytesTotal 3696463
bytesTotal 3696463
bytesTotal 3696463
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Servlet called 3 Times, not once
 
Similar Threads
How to return a parameter from a servlet to the calling HttpClient
HttpClient and MultipartEntity vs. Jersey Multipart
Error in sample proxy servlet
Sending a jason object via Post
cannot connect to my MySQL db using HttpClient