Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
Servlets
« Previous
Next »
Servlet mapping defines
Options
- an association between a URL pattern and a servlet
- an association between a URL pattern and a request page
- an association between a URL pattern and a response page
- All of the above
CORRECT ANSWER : an association between a URL pattern and a servlet
Discussion Board
Servlet mapping
Servlet mapping defines an association between a URL and servlet as it also specifies the web container of which java servlet should be invoked for a url given by client.
It provides the mapping url patterns to servlets. When client request then servlet container decides to which application it should forward to. Then context path of url is matched for mapping servlets. For this to happen servlets should be registered with the container of the servlet and it needs to have entries in web deployment descriptor or web.xml which is located in WEB-INF directory of the web application.
Entries to be done in web.xml for servlet-mapping:
<servlet-mapping>
<servlet-name>milk</servlet-name>
<url-pattern>/drink/*</url-pattern>
</servlet-mapping>
Rohit Sharma 11-29-2014 10:28 AM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
Java Beginner (11)
Java (39)
Java (40)
Java (22)
Java (30)
Java (25)
Java (20)
Java (20)
Core Java (20)
Core Java (10)
Core Java (72)
EJB (20)
JDBC (20)
Applet (20)
Struts (21)
Servlets (20)
Java Web Services (20)
Javascript (40)
J2EE (10)
jQuery (46)
Advertisement
▲