Why <servlet-name> use in web.xml

Why <servlet-name> use in web.xml

WHY DO WE USE THE <SERVLET-NAME>TAG IN WEB.XML APPLCATION

View Answers

February 22, 2008 at 1:32 PM

WHY DO WE USE THE <SERVLET-NAME>TAG IN WEB.XML APPLCATION AND HOW
A simple program of using <servlet-name> tag in web.xml


The <servlet-mapping> tag specifies the URLs which will invoke the servlet. In our case, the /hello URL invokes the servlet.In <web.xml > tag <servlet-name> tag specifies the name of the servlet & will invoke the <servlet-class> tag . The <servlet-class> tag will invoke & run the servlet class ? roseindia.RequestHeaderExample ?.

Now the code of this program :
<servlet>
<servlet-name>RequestInfoExample</servlet-name>
<servlet-class>roseindia.RequestHeaderExample</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>RequestInfoExample</servlet-name>
<url-pattern>/RequestInfoExample/</url-pattern>
</servlet-mapping>









Related Tutorials/Questions & Answers:
Why <servlet-name> use in web.xml - JSP-Servlet
Why &lt;servlet-name>; use in web.xml  WHY DO WE USE THE &lt;SERVLET-NAME>;TAG IN WEB.XML APPLCATION   WHY DO WE USE THE &lt;SERVLET-NAME>;TAG IN WEB.XML APPLCATION AND HOW A simple program of using &lt;servlet
web.xml
web.xml  what is web.xml file..? explain its types..?   The web.xml file is important file for j2ee application. this file is also called the deployment descriptor. When you web application started the web server reads
Advertisements
web.xml
web xml  which url address is given in web.xml?   When...". &lt;root> &lt;h:table xmlns:h="http://www.w3.org/TR/html4/"> &lt;h:tr> &lt;h:td>Apples</h:td> &lt;h:td>
How to Configure Spring in web.xml file ?
as &lt;servlet> &lt;servlet-name>;dispatcherServlet</servlet-name>; &lt;servlet-class>...-name>;dispatcherServlet</servlet-name>; &lt;url-pattern>*.htm<
How to use web.xml in Servlet 3.0
How to use web.xml in Servlet 3.0 In this tutorial you will learn how to use web.xml in Servlet 3.0. Here I am giving the simple example of a Servlet...; + id); } } web.xml &lt;?xml version="1.0" encoding="UTF-8"
How can I call a Servlet that is declare on web.xml with spring framework
web.xml &lt;servlet> &lt;servlet-name>;CrystalReportViewerServlet</servlet-name>; &lt;servlet-class>...;servlet-mapping> &lt;servlet-name>;CrystalReportViewerServlet</servlet
web.xml deployment descriptor - JSP-Servlet
;); out.println("&lt;/html>"); }} &lt;servlet> &lt;servlet-name>;HelloWorld</servlet-name>; &lt;servlet-class>HelloWorld</servlet-class>&lt;/servlet> &lt;servlet-mapping> &lt;servlet-name>;HelloWorld<
why to use hibernet as a dataacces layer
why to use hibernet as a dataacces layer  plz give me the reply
web.xml - XML
web.xml  Can you please help me to create web.xml I tried.... Is there any thing wrong with this web.xml otherwise please help me... Thanks...; Hi friend, Servlet and JSP Examples
Why to use Session interface in Hibernate?
Why to use Session interface in Hibernate?  Why to use Session interface in Hibernate?   Session interface is defined in org.hibernate.Session. It is a single-threaded, short-lived object representing a conversation
Why do we use ORM?
Why do we use ORM?  Why do we use ORM?   ORM is technology to access the data from the database. With the help of ORM framework, business... define the mapping of which property for which column. In ORM we can use plain java
why to use hibernet vs jdbc
why to use hibernet vs jdbc  plz send me the reply   Hi... JDBC is database specific 2) Hibernate is a set of Objects so there is no use of sql whereas in JDBC there is a use of SQL. 3) As Hibernate Supports two level
why we use constructors instead of methods in java?
why we use constructors instead of methods in java?   why we use constructors instead of methods in java
Why not use Double or Float to represent currency?
Why not use Double or Float to represent currency?  Why not use Double or Float to represent currency
Access web.xml init parameters
Access web.xml init parameters  How to access web.xml init parameters from java code
Why we use singleton class in hibernate sessionfactory?
Why we use singleton class in hibernate sessionfactory?  Hello, Please tell me why we use singleton class in hibernate sessionfactory? hibernate sessionfactory singleton example would be very helpful. Thanks
web.xml - servlet - Java Beginners
application. I was suggested to use tag in the web.xml file to run that servlet...web.xml - servlet  Hi All, In my web application, I have one servlet that has to run automatically when ever I start my web application
regarding web.xml - JSP-Servlet
regarding web.xml  I am the java beginner, please send the web.xml code and how to run a servlet for apache5.0.... my problem is in tomcat manager am getting the message 'fail' in web.xml  Hello,Please check the tomcat
why we use abstract class in java?
why we use abstract class in java?  what is the the purpose of abstract class.Give example when to use abstract and when use interface
Why to use Spring Framework?
Why to use Spring Framework in a web application? In this article I... depend on the Spring libraries. ADS4ThUnitADS Why to use the Spring Framework?ADS_TO_REPLACE_2 Here is points that describes why to use the Spring Framework
why we use design patterns in java?Example?
why we use design patterns in java?Example?  Hi..... Why we use design patterns?,why they are needed in programming languages?,advantages?   hi friend, please go through the following links may this will be helpful
Which java collection to use in scenario below and Why?
Which java collection to use in scenario below and Why?  I want to store thousands of record in a collection and later I want to search. For best and optimized results, which collection will I prefer
without writing web.xml file we can write servlet program
without writing web.xml file we can write servlet program  Sir Morning... Sir I have one Question "without writing web.xml file we can write servlet program". if yes which way? if no why? but without use Annotation........ Plz
Why we use Semicolon after SQL Statements?
Why we use Semicolon after SQL Statements?  Why we use Semicolon after SQL Statements?   Hi, Some database systems require a semicolon at the end of each SQL statement.The semicolon character is a statement
why we use struts framework instead of springs
why we use struts framework instead of springs  why we use struts framework instead of springs    It depends upon your application requirements.In some cases spring is better and in some cases struts is better
Configure Js request in Web.xml
Configure Js request in Web.xml  Hi all, I have 1 basic doubt,suppose i have 2 jsp,1 servlet,1 web.xml file.i need to redirect 1 page via servlet with help of web.xml file.Here just i need to redirect to mainCtrl.java
arrays,why we cannot use this statement
arrays,why we cannot use this statement  import java.util.*; class Dash{ public static void main(String args[]){ int x0=100; int[] x1=new int[3]; int[][] x2=new int[3][3]; int[][][] x3
arrays,why we cannot use this statement
arrays,why we cannot use this statement  import java.util.*; class Dash{ public static void main(String args[]){ int x0=100; int[] x1=new int[3]; int[][] x2=new int[3][3]; int[][][] x3
What is Angular and Why Use It?
AngularJS Tutorials: What is Angular and Why Use It? AngularJS is a widely popular JavaScript framework which is used for building wide variety of web apps, single page apps (SPA) mobile apps. As a JavaScript framework it has been
why we use ^ operator in sql, and what is the meaning of that operator?
why we use ^ operator in sql, and what is the meaning of that operator?  why we use ^ operator in sql, and what is the meaning of that operator
Why spring?
Why spring?  Why do we need to learn Spring? and where can we use it thanks
What are the elements in the deployment descriptor(web.xml)?
What are the elements in the deployment descriptor(web.xml)?  What do the following elements in the deployment descriptor(web.xml)are: â?¦â?¦.. â?¦.. â?¦â?¦â?¦ â?¦â
Why Use Docker for Development?
Docker for Development - Why Use Docker for Development? Traditionally we use... of problems while working on a laptop. But the use of Docker can easily avoid those. There are many reasons that a developer use Docker for development. Some
Assembling web.xml from fragments
This section contains detailed description on assembling web.xml from web fragments with an example
loacation of errorpage in web.xml for 404 error
loacation of errorpage in web.xml for 404 error   The webpage cannot be found HTTP 404 Most likely causes: â?¢There might be a typing error in the address. â?¢If you clicked on a link, it may be out of date. What you
Why PHP ?
Why PHP? Reasons to use PHP are given below: 1.    PHP is open source, free to download and use : PHP is free and you can download... of PHP is it supports a wide variety of database and it can be use with any
Why request.getParameter(
value I give to form is &lt;FORM ENCTYPE="multipart/form-data" ACTION="" METHOD="POST"> why it happen? Anybody plz help me.. i want use it my project...plz...Why request.getParameter(  Hi all, I want to to do upload file in my
Why NSMutableDictionary
Why NSMutableDictionary  Why NSMutableDictionary is used for?   NSMutableDictionary inherits from NSDictionary class, which is used to manage mutable associations of keys and values. Actually, NSMutableDictionary
Why we should use string args[] in main method in java?
Why we should use string args[] in main method in java?  we use only string in the main method not any other one.. specify the reason... and tell me... if (number &lt; largest && second >= number) second=number; else largest
Why "<![CDATA[ ]]>" CDATA tag.
Why tag.  . Why do we use this tag and what is the name of this tag
why this can't
why this can't  import java.util.*; class Dash{ public static void main(String args[]){ int x0=100; int[] x1=new int[3]; int[][] x2=new int[3][3]; int[][][] x3=new int[3][3][3
Why this is not working...?
Why this is not working...?  import java.util.*; public class Family... Person[size_of_family]; for ( int i = 0; i &lt; size_of_family; ++i...]); } } public void printOutFamily(){ for (int i = 0; i &lt; size_of_family
why php and mysql - PHP
why php and mysql  I noticed in most of the application that developer always use mysql with PHP. Why they do so,, as there are money other database are too available
why crieterias are importent in hibernate?
why crieterias are importent in hibernate?  why crieterias are importent in hibernate?   HiberanteTemplate is a class proposed by spring softies, here everything will be ready made to use. that is capsulized
why and where we use setter and getter methods in java, please give me one example program.....
why and where we use setter and getter methods in java, please give me one example program.....  why and where we use setter and getter methods in java, please give me one example program
Why Abstract Class?
Why Abstract Class?  What is the use of Abstract Class if it has Zero Abstract methods
Why Abstract Class?
Why Abstract Class?  What is the use of Abstract Class if it has Zero Abstract methods
why jre in jdk
why jre in jdk  why jre in jdk
Why it called Struts?
Why it called Struts?  Why it called Struts
why the php is open source?
why the php is open source?  why the php is open source

Ads