aspose file tools*
The moose likes JSP and the fly likes Jsp calling multipul servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp calling multipul servlets" Watch "Jsp calling multipul servlets" New topic
Author

Jsp calling multipul servlets

Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1270

Hi

I need to call more then one servlet from a jsp. In my jsp Form Action define a servlet and there are some other buttons and links which invokes other servlet. What are the possible and best way to do it.

Fot now what I am doing I am calling a JSP and on it's form action calling a servlet which forwards me on a different JSP page, from where I cal other servlet. Here I need to call both Servlet from a same page on different differnt submit button events or link.




No Kaustubh No Fun, Know Kaustubh Know Fun..
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12789
    
    5
How would you make a plain HTML page FORM having submit buttons to different URLs?

Just think about it.

Bill
Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1270

William Brogden wrote:How would you make a plain HTML page FORM having submit buttons to different URLs?

Just think about it.

Bill



Hi Will want to make an correction, actually this is a jsp page, having a submit button and some links which takes me to different different servlets.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10113
    
165

Kaustubh G Sharma wrote:
William Brogden wrote:...

Bill



Hi Will


Pay attention to names while addressing others. Some might be offended and some may not, but it's always good to get that right.

[My Blog] [JavaRanch Journal]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10113
    
165

Kaustubh G Sharma wrote: actually this is a jsp page, having a submit button and some links which takes me to different different servlets.


So each link does take you to a different servlet, isn't it? What do you want to change then? Point the href attribute of the anchor tag to the right servlet.
Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1270

Jaikiran Pai wrote:
Kaustubh G Sharma wrote: actually this is a jsp page, having a submit button and some links which takes me to different different servlets.


So each link does take you to a different servlet, isn't it? What do you want to change then? Point the href attribute of the anchor tag to the right servlet.


Hi Jai

Tried my hand on it but gettting issues with correct selection of seperators '\\' '\\' '\' .. tried all of them but not worked out. Can you please give me some example for the same.

Thanks
K
raj talatam
Ranch Hand

Joined: Apr 19, 2012
Posts: 87
Kaustubh G Sharma wrote:Hi

I need to call more then one servlet from a jsp. In my jsp Form Action define a servlet and there are some other buttons and links which invokes other servlet. What are the possible and best way to do it.

Fot now what I am doing I am calling a JSP and on it's form action calling a servlet which forwards me on a different JSP page, from where I cal other servlet. Here I need to call both Servlet from a same page on different differnt submit button events or link.

your question is ,you want to keep Two html Buttons in the same Html Page,

with one submit button some action should be done, with other submit button some other action should be done....

is that right

Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1270

raj talatam wrote:

your question is ,you want to keep Two html Buttons in the same Html Page,

with one submit button some action should be done, with other submit button some other action should be done....

is that right



No that's not my requirement
Pongsakorn Semsuwan
Ranch Hand

Joined: May 15, 2011
Posts: 34

There isn't a proper way to submit two form at once or send request to two Servlets by one action.

However, I believe you could use AJAX here. Send one request to Servlet via javascript before submitting the form.


A web application developer wannabe from Thailand
My StartUp : http://www.dreamlog.co
Blog : http://pongsakornsemsuwan.wordpress.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp calling multipul servlets