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

  • Home
  • SEARCH
  • 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 9013849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:22:11+00:00 2026-06-16T03:22:11+00:00

My application’s folder structure is as follows. web/WEB-INF/templates/ -home.ftl web/resources/css/Home_files -test.css When using both

  • 0

My application’s folder structure is as follows.

web/WEB-INF/templates/
    -home.ftl

web/resources/css/Home_files
    -test.css

When using both <mvc:annotation-driven /> and <mvc:resources mapping="/resources/**" location="/resources/css/Home_files" /> tags it couldn’t resolve view (http://localhost:8080/info/home/index.html).

  • without <mvc:resources mapping="/resources/**" location="/resources/css/Home_files" /> tag view is resolved but images ans css couldn’t resolve.
  • without <mvc:annotation-driven /> tag view could not be resolved but images and css could be resolved.

How do i load both view and static content together?

here is my config xml files and homeController.

info-servlet.xml (configuration file)

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"

       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/cache
       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
        ">

<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
    <property name="templateLoaderPath" value="/WEB-INF/templates/"/>
</bean>

<bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
    <property name="cache" value="true"/>
    <property name="prefix" value=""/>
    <property name="suffix" value=".ftl"/>
</bean>

<context:component-scan base-package="com.test.web.controllers"/>

<context:component-scan base-package="com.test"/>

<mvc:annotation-driven />
<mvc:resources mapping="/resources/**" location="/resources/css/Home_files" />

</beans>

controller

@Controller

@RequestMapping("/home")

public class HomeController {

    @RequestMapping(value = "/index.html")

    public String getHome(@ModelAttribute("model") ModelMap model) {

        return "home";

    }

}

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" >

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/spring/info-servlet.xml
        </param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>info</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/spring/info-servlet.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- The mapping for the default servlet -->
    <servlet-mapping>
        <servlet-name>info</servlet-name>
        <url-pattern>/</url-pattern>

    </servlet-mapping>
  • 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-16T03:22:14+00:00Added an answer on June 16, 2026 at 3:22 am

    It seems that path is not correct in <mvc:resources> tag. Add a forward slash (/) at the end of location.

    Instead of

    <mvc:resources mapping="/resources/**" location="/resources/css/Home_files" />
    

    Use this:

    <mvc:resources mapping="/resources/**" location="/resources/css/Home_files/" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Application-Stack: Rails3, CanCan, Devise, Shoulda I've got some nested Resources and want to test
My application is connecting to a web service rpc/encoded. Im using Axis 1.4. When
Application db connection in web service. i haveto connect the db using that web
Application configuration: Web application using java first method of creating JAX-WS 2.0 Web Services
Application launch through Java web start(JWS) checks for update when we are launching it.
The application prepared by me is using GCM to get push notifications from the
APPLICATION_LOG_DIR=/home/users/sosst51/test-chinboon/logs/testdata1 PREFIX=mylog for i in `ls ${APPLICATION_LOG_DIR}/${PREFIX}*` Is this a for loop whereby i
Application was built using MS interop, to export .xls to infoPath and vice versa.
Application ID in appengine is configured in appengine-web.xml: <?xml version=1.0 encoding=utf-8?> <appengine-web-app xmlns=http://appengine.google.com/ns/1.0> <application>myid</application>
Application pool for my web service has Identity set to myDomain\myUser. When I run

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.