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

What is the dispatcher servlet?

922


Explain the methods of request dispatcher in servlet?

983


Why do we have servlet listeners?

1023


Can filter be used as request or response?

915


How many servlet objects are created?

1010


What is setattribute in servlet?

1063


Explain Action Servlet?

1027


What are session variable in servlets?

979


What is the difference between using getSession(true) and getSession(false) methods?

987


What are the uses of servlets?

1072


How do we translate jsp?

989


What is the use of send redirect () method?

1023


How we can create war file in servlet?

1066


What does the term localization refer to?

1035


Which java application server is the best?

980