This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
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

servlet mapping

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I have to following servlet-mapping!
<servlet-mapping>
<servlet-name>pdfServlet</servlet-name>
<url-pattern>*.pdf</url-pattern>
</servlet-mapping>
Which of the following are forwarded to the pdfservlet?
a) http://someserver:8080/mydoc.pdf
b) http://someserver:8080/some/directory/mydoc.pdf
c) http://someserver:8080/pdf/mypdffile
I would say a) and b) .. is my thinking correct ..
Jas
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Essentially, yes. But only if you have a web application which is mapped to "root" scope for the server. In most cases a web aplication is deployed to a URL more like:
http://someserver:8080/myapp
So the following would be mapped:
  • http://someserver:8080/myapp/hello.pdf
  • http://someserver:8080/myapp/somewhere/hello.pdf


  • and the following wouldn't
  • http://someserver:8080/hello.pdf
  • http://someserver:8080/myapp2/hello.pdf
  • http://someserver:8080/myapp/hello_pdf
  • http://someserver:8080/myapp/pdf/hello

  •  
    The City calls upon her steadfast protectors. Now for a tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
      Bookmark Topic Watch Topic
    • New Topic