This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 9291

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
Similar Threads
Problem on Handler Mapping
home page downloads as a file using ssl
goGet vs. doPost
WARNING: Unexpected error forwarding to login page
Resource not found