Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet Why <servlet-name> use in web.xml
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Krishna Chowdary
Why <servlet-name> use in web.xml
1 Answer(s)      6 years and 11 months ago
Posted in : JSP-Servlet


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


Advertisement
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
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...); } } web.xml &lt;?xml version="1.0" encoding="UTF-8"?> &lt;web
Advertisements
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
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>
why to use hibernet as a dataacces layer
why to use hibernet as a dataacces layer  plz give me the reply
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
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<
why to use hibernet vs jdbc
why to use hibernet vs jdbc  plz send me the reply   Hi... 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 of cache, you
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
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 to use Spring Framework?
Why to use Spring Framework in a web application? In this article I... on the Spring libraries. ADS4ThUnitADS Why to use the Spring Framework? Here is points that describes why to use the Spring Framework? Spring framework
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
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
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 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
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
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
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
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 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
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 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
Access web.xml init parameters
Access web.xml init parameters  How to access web.xml init parameters from java code
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
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
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
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
Advertisements
 

 

 

DMCA.com