Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

What is meant by URL mapping? Can you provide example?

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know what is URL mapping. I see it often and also an example would be helpful, please.
 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kayla
Servlet mapping elements are defined in the deployment descriptor and basically determine which URL pattern will be handled by the servlet.
For instance:


<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>


will ensure that MyServlet services requests where the request URI contains the suffix ".jsp", eg:


http://localhost:8080/MyWebApp/servlet/WebService.jsp


This is a very simple example. There are a a few rules of precedence that the container follows in determining the appropriate servlet/url mapping.
 
Kayla Richard
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again Mark, that's what I initially thought.
 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark, i'm sorry but i think you wanted to say :
http://localhost:8080/MyWebApp/WebService.jsp
without '/servlet' because it's a mapping.
Thanks.
 
Mark Howard
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Engin
Cut and paste typo, you know how it goes
[ January 28, 2003: Message edited by: mark howard ]
 
Kayla Richard
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Engin and Mark, this is helpful.
 
it's a teeny, tiny, wafer thin ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic