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

Why the concept of single thread model interface is used?

1000


How can we refresh automatically when new data is entered into the database?

1107


What are the difference between session and cookies in servlet? Explain

1046


How to find whether a parameter exists in the request object?

1113


Can a jsp be called using a servlet?

1147


Can filter be used as request or response?

976


Why doesn’t a servlet include main()? How does it work?

1167


How we can call a jsp from the servlet?

1011


List out difference between a JavaBean from a Servlet?

1038


What are the drawbacks of cgi?

1044


Describe the phases of servlet lifecycle?

1071


What are the advantages of servlets over traditional cgi?

1104


How a servlet is unloaded?

1094


Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?

1104


Difference between GET and POST?

1165