Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to invoke a Servlet?

Answer Posted / dara

<form action="/servlet/full.class.name">
</form>


This method uses the invoker servlet, provided by many
servlet containers. The much better way of invoking a
servlet is by providing an explicit mapping for it. This is
accomplished by using a pair of tags in your web
application's web.xml file. This is not the same file as
mentioned above. That file was located in Tomcat's conf/
directory. This web.xml file (which you will probably need
to create) will reside in your web-application's WEB-INF/
directory. For each servlet you want to call, provide a
pair of tags like the following:


...
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>your.package.name.HelloWorld</servlet-
class>
</servlet>
...
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
...

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you push data from an Applet to a Servlet?

1090


What do you mean by deployment descriptor?

1055


How to read request headers from servlets?

1045


What are important features of Servlet 3?

1089


What is the advantage of Servlets when compared with other server side technologies?

2344


What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?

1107


What do you mean by annotations in servlet?

1057


What is java servlet session?

972


Why jsp is better than servlet?

1027


How do you design microservices?

1075


what is multiple server?

2304


What is a java servlet?

1070


What are the advantages of cookies?

1121


What do you mean by web applications? Explain web application directory arrangement?

959


Can we refresh servlet in client and server side automatically?

1049