This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes servlet mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "servlet mapping" Watch "servlet mapping" New topic

servlet mapping

Jaspreet Singh UK
Ranch Hand

Joined: Mar 06, 2001
Posts: 42
If I have to following 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 ..
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
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:
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

  • Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
    I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
    subject: servlet mapping
    It's not a secret anymore!