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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:49:36+00:00 2026-06-08T05:49:36+00:00

I am trying to add webflow and security configuration to an operational Spring 3.1

  • 0

I am trying to add webflow and security configuration to an operational Spring 3.1 MVC web application.

I got rid of the application-context.xml file and ContextLoaderListener, and use AnnotationConfigWebApplicationContext with an @EnableWebMvc @Configuration annotated class.

Yet, when I follow the webflow and security documentation, it seems like an application-context.xml file and ContextLoaderListener are necessary. The later seems to create a conflict with AnnotationConfigWebApplicationContext.

Can anyone provide a simple but complete Spring 3.1 MVC Web Application configuration with webflow and security enabled example? I am looking for a web.xml example file, plus any other required files.

If someone has a complete sample application downloadable online, it is even better.

  • 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-08T05:49:39+00:00Added an answer on June 8, 2026 at 5:49 am

    The following works when deploying to Tomcat 7:

    web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0"
        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_3_0.xsd"
        metadata-complete="false">
    
        <!-- Context Params -->
        <context-param>
            <param-name>contextClass</param-name>
            <param-value>
                org.springframework.web.context.support.AnnotationConfigWebApplicationContext
            </param-value>
        </context-param>
    
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>com.mypackage.web.WebConfig</param-value>
        </context-param>
    
    
        <!-- Filters --> 
        <filter>
            <filter-name>springSecurityFilterChain</filter-name>
            <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        </filter>
    
        <filter-mapping>
            <filter-name>springSecurityFilterChain</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
    
        <!-- Listeners -->
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
    
        <!-- Declaring and configuring the default Spring Servlet -->
        <servlet>
    
            <servlet-name>springExample</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    
            <!-- Enabling annotation configuration for web app -->
            <init-param>
                <param-name>contextClass</param-name>
                <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext
                </param-value>
            </init-param>
    
            <!-- Loading order -->
            <load-on-startup>1</load-on-startup>
    
        </servlet>
    
        <servlet-mapping>
            <servlet-name>springExample</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
    
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>    
    
    </web-app>
    

    WebConfig

    @EnableWebMvc
    @ImportResource({ "/WEB-INF/spring-security.xml", "/WEB-INF/spring-webflow.xml"})
    @Configuration
    public class WebConfig extends WebMvcConfigurerAdapter {
    
        // ...
    
    }
    

    Caveat: using @Import(SomeConfig.class) does not work anymore. It causes initialization issues. The workaround is to move the content of SomeConfig.class to WebConfig.class itself.

    It is important to add proper maven dependencies, otherwise, Tomcat results in 404 Resource not found error messages:

    pom.xml

    <properties>
        ...
        <spring.framework.version>3.1.2.RELEASE</spring.framework.version>
        <spring.security.version>3.1.1.RELEASE</spring.security.version>
        <spring.webflow.version>2.3.1.RELEASE</spring.webflow.version>
    </properties>
    
    <dependencies>
        ...
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.framework.version}</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${spring.security.version}</version>
        </dependency> 
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring.security.version}</version>
        </dependency> 
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring.security.version}</version>
        </dependency>
            <dependency>
                <groupId>cglib</groupId>
                <artifactId>cglib</artifactId>
                <version>2.1_3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.webflow</groupId>
            <artifactId>spring-webflow</artifactId>
            <version>${spring.webflow.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.webflow</groupId>
            <artifactId>spring-binding</artifactId>
            <version>${spring.webflow.version}</version>
        </dependency>
    </dependencies>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im new to asp.net mvc. I'm trying add new model class but it got
I am trying add two columns in a text file that are seperated by
Trying to add a functionality to our JSF 2 application to list active users
I'm trying add a directory of jar files (or barring that, each jar file
ím trying to add jstl/jsp component to a spring+flex+hibernate project. Im using Tomcat 5,
I'm trying to learn Spring, Hibernate and Webflow. Why is it that when I
I'm trying add a tab to my web page that looks like this: Using
I'm trying add Taskbar Icon overlay with text to windows7 application icon, I did
I am new to ROR. I am trying add translations to my application. I
I'm trying add data triggers to the default combobox style so each text item

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.