jQuery in Action, 2nd edition
The moose likes Servlets and the fly likes calling two servlet 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 "calling two servlet " Watch "calling two servlet " New topic
Author

calling two servlet

rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
how to call two servlet on one button action in servlet
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56191
    
  13

Why? We need to know what you're actually trying to accomplish.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
Bear Bibeault wrote:Why? We need to know what you're actually trying to accomplish.

i have written a servlet for file uploading when i click on upload button upload servlet is being called but at the same time i want to click on another button so that another servlet is called.but at the same time two button cannot be clicked so i want it on same button....
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56191
    
  13

What is it you need to do at the same time?
bhavesh gawade
Greenhorn

Joined: Aug 08, 2011
Posts: 4
Hi,

Generally servlet is required to post HTML form parameters onto server. so with file upload servlet you will get the same. one thing probably you can do is keeping other servlet business logic in separate java bean and call the same. else you can try server to server call with HTTPConnection class.
Anurag Verma
Ranch Hand

Joined: Mar 30, 2012
Posts: 118

here if you want to make multiple requests on one click, then which response would you show? Anyways, if that is the case, on button click, you can make multiple AJAX calls & process their responses separately.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: calling two servlet
 
Similar Threads
What if browser request url matches two Url patterns defined in two differnet <servlet mappings> tag
Servelet Request Redirect
Create two instances for a servlet
Ajax: servlet called twice
calling servlet from another server.