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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:26:57+00:00 2026-06-13T09:26:57+00:00

I get the following error when trying to set up a Spring project with

  • 0

I get the following error when trying to set up a Spring project with Velocity.

PageNotFound - No mapping found for HTTP request with URI [/SpringMVCVelocity/Enquiries/viewAllEnquiries] in DispatcherServlet with name 'mvc-dispatcher'

I have set up the spring context.xml as-

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:webflow="http://www.springframework.org/schema/webflow-config"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans     
        http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-3.1.xsd
        http://www.springframework.org/schema/tx 
        http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
        http://www.springframework.org/schema/mvc 
        http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
        http://www.springframework.org/schema/webflow-config
        http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd">

    <context:component-scan base-package="ecommerce.dao" />     

    <bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
      <property name="resourceLoaderPath" value="/WEB-INF/view/"/>   
    </bean>

    <bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
      <property name="cache" value="false"/>
      <property name="prefix" value=""/>
      <property name="suffix" value=".vm"/>
      <property name="order" value="-1"/>
      <property name="exposeSpringMacroHelpers" value="true"></property>
    </bean>


    <mvc:annotation-driven/>

    <!-- Forwards requests to the "/" resource to the "welcome" view -->
    <mvc:view-controller path="/" view-name="welcome"/>

    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
      <property name="persistenceUnitName" value="ecommerce"/>
   </bean>
    <!-- enable the configuration of transactional behavior based on annotations -->
    <tx:annotation-driven transaction-manager="transactionManager"/>
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>

    <!-- Configures Handler Interceptors -->   
    <mvc:interceptors>
        <!-- Changes the locale when a 'locale' request parameter is sent; e.g. /?locale=de -->
        <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" />
    </mvc:interceptors>

    <!-- Saves a locale change using a cookie -->
    <bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver" />

    <!-- Application Message Bundle -->
    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
        <property name="basename" value="/WEB-INF/messages/messages" />
        <property name="cacheSeconds" value="0" />
    </bean>

    <!-- 
        FLOW HANDLING
     -->

    <!-- Enables FlowHandler URL mapping -->
    <bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
        <property name="flowExecutor" ref="flowExecutor" />
    </bean>

    <webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry"/>

    <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
        <property name="flowRegistry" ref="flowRegistry" />
        <property name="order" value="-1" />
    </bean>

    <webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
        <webflow:flow-location path="/WEB-INF/view/flows/flow.xml"/>
    </webflow:flow-registry>

    <webflow:flow-builder-services id="flowBuilderServices" view-factory-creator="mvcViewFactoryCreator" />

    <bean id="mvcViewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
        <property name="viewResolvers" ref="viewResolver" />
    </bean>

    <!-- 

       Bean Injections

    -->
    <bean id="carModelDao" class="ecommerce.dao.CarModelDao"/>

    <bean id="carController" class="ecommerce.controller.CarController">
        <property name="carModelDao" ref="carModelDao"/>
    </bean>

    <bean id="veloController" class="ecommerce.controller.VelocityController">
        <property name="carModelDao" ref="carModelDao"/>
    </bean>
</beans>

My controller is:

@Controller
@RequestMapping("/Enquiries")
@SessionAttributes({"enqList", "search"})

public class EnquiryController {

    private static final Logger logger = Logger.getLogger(EnquiryController.class);
    private PagedListHolder<Enquiry> enqList = null;
    private int pageSize = 10;

    @Autowired
    private EnquiryDao enquiryDao;

    @RequestMapping("/viewAllEnquiries")
    public String  getAllEnquiries(@RequestParam(required=false) String page, Model model) {

        if ("next".equals(page) && enqList != null) {
            enqList.nextPage();
        } else if ("previous".equals(page) && enqList != null) {
            enqList.previousPage();
        } else {
            // well there is no page parameter, so it must be a new request
            enqList = new PagedListHolder<Enquiry>(enquiryDao.getAllEnquiries());
            enqList.setPageSize(pageSize);
        }
        model.addAttribute("search", new Search());
        model.addAttribute("enqList", enqList);

        return "viewAllEnquiries";
    }

This controller is not even called. It does however successfully manage to resolve the welcome view with:

<mvc:view-controller path="/" view-name="welcome"/>
  • 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-13T09:27:01+00:00Added an answer on June 13, 2026 at 9:27 am

    Problem solved,
    I wasn’t scanning the controller (context:component-scan) and had not wired the bean either in the Spring context.

    So to fix it, I added it via spring injection:

    <bean id="enquiryDao" class="ecommerce.dao.EnquiryDao"/>
    <bean id="enquiryController" class="ecommerce.controller.EnquiryController">
        <property name="enquiryDao" ref="enquiryDao"/>
    </bean>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to set DoMatchParen I get the following error: E492: Not an editor
I'm trying to freeze my Python3.2 project and get the following error after running
I get following error when trying to access Xampp from a network I've tried
I get the following error when trying to run my application. There are no
I get the following error when trying to push changes to github from the
i get this following error when i am trying to connect my localhost mysql
I get the following error from the SQL Script I am trying to run:
While trying to validate my forms i get the following error: Expected a {
When trying to run a junit test I get the following error - java.lang.ClassCastException:
when trying to translate the confirmation message to Norwegian i get the following error:

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.