Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8619303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:18:29+00:00 2026-06-12T06:18:29+00:00

I have a spring project where, on a linux/tomcat6 server we have an external

  • 0

I have a spring project where, on a linux/tomcat6 server we have an external folder for person photos inside “/var/projectname/personphotos“. Tried making a symbolic link and the like and nothing seems to work, the application cannot see the external folder. I happened to stunble upon the <mvc:resources> tag and the <mvc:annotation-driven /> .How do I add it to the project ?
I was thinking something like

<mvc:resources mapping="/personphotos/" location="/var/projectname/personphotos" />

and in the application i can have something like <img src="/personphotos/bla-bla.jpg"/>

All of the tutorials say to use the tags but they don’t say where to place it. I assume the location must be understood, forgive my ignorance. I tried adding it to the applicationcontext.xml and that blew-up with errors. Other tutorials were saying to edit the servlet-context.xml, wherever that is ? see here

I am using spring 3.0.7 with STS and I tried changing to 3.1.0 in the pom file. The version change caused mvn tomcat:run to give some errors. I saw somewhere that the mvc:resource tage was available in 3.0.4 or highter, i guess I am safe for now. Please help to clear up these ambiguities.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:18:30+00:00Added an answer on June 12, 2026 at 6:18 am

    It has to be in your servlet-context.xml file, probably this way:

    <mvc:resources mapping="/personphotos/**" location="/var/projectname/personphotos" />
    

    and you can access it using:

    <img src="${pageContext.request.contextPath}/personphotos/bla-bla.jpg"/>
    

    the starting part is to make sure that you application context part gets added in too.

    EDIT
    For the benefit of others, the Final thing which is working is

    <mvc:resources mapping="/personphotos/**" location="file:/var/projectname/personphotos" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my project,I have integrated Spring Security with CAS server authentication. Now my project
We have a Flex client and a server that is using the Spring/Blazeds project.
I have win 2008 R2 server with .net mvc project and other Ubuntu Linux
I have a Tomcat6 server on a Linux server. The structure of the webapps
I have a Spring project using log4j on Linux (Debian, Ubuntu and RHEL). Now
I have a Spring Project with Wicket. I can successfully inject Services in Wicket
I have a Spring Roo project and I use mvn jetty:run to run my
I have a Spring 3.0.x web project that is displaying a page of links
I have a project with spring and hibernate in GWT, I am using below
I have a Maven based Spring-WS client project that I want to package as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.