File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Url Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic

Url Pattern

Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426

I am currently unsure in my web apps if I am correctly assigning the correct url.

I have a list of links where user can download several files:

My url pattern for the following is set as

But when I click the link, I always get a 404 error and my servlet does not capture the url.

The resource folder is under the WEB-INF folder and I am planning to stream the files into the servlet output response.
I am not sure but I think I miss something.

Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Ankit Garg

Joined: Aug 03, 2008
Posts: 9466

Where is the page on which the links that you've given are?? You are using relative paths in the links, use full paths from the root of the context i.e. like

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi Ankit,

Thank you.. that is what I missed...

I will my post follow up question on the Spring forum since its spring specific.. I just tested it out on plain Servlet and JSP..

Kudos to you...
I agree. Here's the link:
subject: Url Pattern
It's not a secret anymore!