Results 1 to 3 of 3

Thread: Best way to implement a File Servlet in Spring

  1. #1
    Join Date
    Nov 2004
    Posts
    15

    Default Best way to implement a File Servlet in Spring

    Am wondering if there's any Spring trick I could use to implement a FileServlet in Spring?

    I.e. something that will allow to serve files identified by their relative path to a preconfigured directory on disk.

    I already have some very simple code working with normal servlets in a different application, just wondering if there's any class in Spring that would make the thing more Spring like. I went quikcly throught the whole Spring web API without finding anything.

    What do you guys use?

  2. #2
    Join Date
    Aug 2004
    Location
    Auburn, AL, USA.
    Posts
    106

    Default

    I wrote a very simple implementation as a Spring Controller that simply used Spring to configure that paths that files were stored at, as well as a few other settings. This came in handy as I was testing on a Windows desktop, but deploying to a Linux server, so the paths were different.

  3. #3
    Join Date
    Nov 2004
    Location
    St. Louis, Missouri USA
    Posts
    33

    Default

    Check out the jakarta commons io package, filenameutils and the like.

Similar Threads

  1. Replies: 5
    Last Post: Aug 9th, 2008, 05:30 AM
  2. Gaijin Studio for Spring MVC 0.9.2 Released
    By dadams in forum Announcements
    Replies: 8
    Last Post: May 30th, 2007, 10:48 PM
  3. Saving large files to a db using hibernate?
    By Dan Washusen in forum Data
    Replies: 10
    Last Post: Sep 20th, 2006, 12:18 PM
  4. Replies: 2
    Last Post: Aug 5th, 2005, 12:52 PM
  5. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •