File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

Url Pattern

Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi,

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
Sheriff

Joined: Aug 03, 2008
Posts: 9304
    
  17

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...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Url Pattern