File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP to Servlet call" Watch "JSP to Servlet call" New topic

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

Joined: Aug 03, 2003
Posts: 26
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

Joined: Oct 18, 2003
Posts: 25
In order to call the servlet from JSP page u can add the
<form name="" action="SERVLET_PATH">
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
I agree. Here's the link:
subject: JSP to Servlet call
It's not a secret anymore!