Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes JSP to Servlet call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP to Servlet call" Watch "JSP to Servlet call" New topic
Author

JSP to Servlet call

eswar kumar
Ranch Hand

Joined: Oct 20, 2002
Posts: 98
how to call a servlet from a JSP page?
Benny Tang
Greenhorn

Joined: Aug 03, 2003
Posts: 26
Hi,
In order to call servlet from the JSP page, you can achieve this by setting the attribute action of the <form> in HTML to the servlet and then submit the form.
Benny T
Nagaseshagiri poola
Greenhorn

Joined: Oct 18, 2003
Posts: 25
HI,
In order to call the servlet from JSP page u can add the
<form name="" action="SERVLET_PATH">
</form>
It is one method and u can also call servlet using the JavaScript in the <head> tag of the .jsp page
and also directly from the anchor <a> Tag.
Have a nice time
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
If you need to call it from outside of a form, you can use a link to the url of the servlet. It would look like:

[ November 19, 2003: Message edited by: Matthew Phillips ]

Matthew Phillips
 
jQuery in Action, 2nd edition
 
subject: JSP to Servlet call