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 7889701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:09:58+00:00 2026-06-03T06:09:58+00:00

I am using Spring 3 ,java based configuration, with BootStrap. I have downloaded the

  • 0

I am using Spring 3 ,java based configuration, with BootStrap.

I have downloaded the bootstrap and put the css and js under resources directory.

The issue that I cann’t use these .css from within the freemarker page.
Howeve that I imported them.
As I am using the java based configuration,I have added the “addResourceHandler” as follows:

WebAppConfig:

@Configuration
@EnableWebMvc
@ComponentScan("com.springway")
public class WebConfig implements WebApplicationInitializer {

    @Override
    public void onStartup(final ServletContext servletContext) throws ServletException {
        final AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext();
        root.setServletContext(servletContext);
        root.scan("com.springway");
        root.refresh();

        final ServletRegistration.Dynamic servlet = servletContext.addServlet("spring", new DispatcherServlet(root));
        servlet.setLoadOnStartup(1);
        servlet.addMapping("/*");
    }

    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
    }

Tomcat log says :

“WARNING: No mapping found for HTTP request with URI

[/springway/resources/css/bootstrap-responsive.css] in
DispatcherServlet with name ‘spring’

Directory :

-SpringWay
>       -src
>            - main
>                   -webapp
>                           -resources
                            -WEB-INF
                                 -welcome.ftl
                                 -springway.ftl    

welcome.ftl:

[#ftl /]
[#include "springway.ftl" /]


<ul class="breadcrumb">
  <li>
    <a href="[@spring.url '/test'/]">Test</a> <span class="divider">/</span>
  </li>
  <li>
    <a href="#">Library</a> <span class="divider">/</span>
  </li>
  <li class="active">Data</li>
</ul>

springway.ftl:

    [#ftl/]
    [#import "spring.ftl" as spring /]

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>

        <title>

        </title>

       <link href="[@spring.url '/resources/css/bootstrap-responsive.css'/]" rel="stylesheet" type="text/css" media="screen"/>
        <link href="[@spring.url '/resources/css/bootstrap-responsive.min.css'/]" rel="stylesheet" type="text/css" media="screen"/>
        <link href="[@spring.url '/resources/css/bootstrap.css'/]" rel="stylesheet" type="text/css" media="screen"/>
        <link href="[@spring.url '/resources/css/bootstrap.min.css'/]" rel="stylesheet" type="text/css" media="screen"/>

        <script src="[@spring.url '/resources/js/bootstrap.js'/]" type="text/javascript"></script>
        <script src="[@spring.url '/resources/js/bootstrap.min.js'/]" type="text/javascript"></script>
      </head>

    <body ></body>
    </html>
  • 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-03T06:09:59+00:00Added an answer on June 3, 2026 at 6:09 am

    You have defined wrong resourceLocation.

    Instead of

    registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
    

    you should have done

    registry.addResourceHandler("/resources/**").addResourceLocations("/resources/**");
    

    Because your css folder is inside resources folder you need to put the extra ** after the / only after that it will identify the css folder otherwise it will load only from the resources folders no subfolders will be considered.

    Hope it helped you.

    Cheers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using the new feature of Spring 3.1.1 the java based configuration.
I have a Java-based server side and a flex client side using Spring BlazeDS
If I want to declare a bean using Spring 3's Java-based configuration, I can
I am using java annotation based configuration for initializing ehcache based caching, with Spring
I'm using Spring's SchedulerFactoryBean to run some Quartz jobs within a Spring based java
I am trying out spring's java configuration. While using xml config files my unit
I have a Java project connecting to an Ingres database and using the Spring
I have a client and server communicating via Spring remoting (using Java Serialization) over
In Java world, Acegi is a powerful security framework based on Spring that allows
I have previously used XML based configuration for my Spring app. Now, I want

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.