Forums Register Login

Jsp calling multipul servlets

+Pie Number of slices to send: Send
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.


+Pie Number of slices to send: Send
How would you make a plain HTML page FORM having submit buttons to different URLs?

Just think about it.

Bill
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
 

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
+Pie Number of slices to send: Send
 

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

 
+Pie Number of slices to send: Send
 

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
+Pie Number of slices to send: Send
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.
Yup, yup, yup. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1978 times.
Similar Threads
Problem while redirecting to action class from AJAX
Problem seeing my servlet from JSP
How to navigate from jsp-to servlets-and again to another -jsp
Configure a new servlet in Struts 2.0
Call an action defined within another package
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:20:16.