• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Need Help Reading/Writing an Image using Spring MVC

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm converting one of my old projects to use spring mvc and one of the tasks was to read/write an image using a servlet. The jsp contained an image src that looked like this: <img src="/image?file=<%=imagePath%>" /> which executed the servlet and wrote the image on the fly. Things are a little complicated because the image is not on a web server. I had to use jcifs smbfile to retrieve the image off of a windows shared folder. The servlet read in the image and performed resizing.


So, now my dilemma is how do I do the same task using Spring MVC. I started writing an ImageController with a RequestMapping("/image") but my controller never gets executed.


Here are some snippets of what I have:

my jsp


my Controller




spring-servlet.xml



web.xml file




Any suggestions? Or any documentation that may help me would be appreciated too.

Thanks.
reply
    Bookmark Topic Watch Topic
  • New Topic