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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:07:01+00:00 2026-05-29T11:07:01+00:00

Hi I have the following code: Controller: @Controller public class HelloWorldController { @RequestMapping(/hello) public

  • 0

Hi I have the following code:
Controller:

@Controller

public class HelloWorldController {

    @RequestMapping("/hello")
        public ModelAndView HelloWorld() {
            String message = "My First SpringMVC Program ";
            return new ModelAndView("hello","message",message);
        }

web.xml

<servlet>
            <!-- load on startup is used to determine the order of initializing the servlet when the application
            server starts up. The lower the number, earlier it starts -->
            <servlet-name>spring</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>

spring-servlet.xml

<context:component-scan 
base-package="org.example.controller"/>

<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView">
</property>
<property name="prefix" value="/WEB-INF/jsp/">
</property>
<property name="suffix" value=".jsp"></property>

When I run this code, I get the following warning
“WARNING: No mapping found for HTTP request with URI [/SpringDemo/Hello.html] in DispatcherServlet with name ‘spring'”. What wrong am I doing?

  • 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-05-29T11:07:02+00:00Added an answer on May 29, 2026 at 11:07 am

    Your web.xml says all requests with url pattern *.html are forwarded to Spring. Your @RequestMapping only filters on /hello, but the request url reaching Spring is /hello.html. What you are missing is the .html. Your @RequestMapping should be /hello.html.

    After your request goes through your controller you are forwarding to a view named hello, and the configuration in your spring-servlet.xml resolves this to hello.jsp in WEB-INF/jsp, so make sure you have that as well.

    Happy coding!

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

Sidebar

Related Questions

I have written the following code : @Controller @RequestMapping(/test) public class Home { @RequestMapping(value
I have a controller class as in the following code segment: @Controller public class
I have a controller with the following action code: public JsonResult CheckPasswordStrength(string password, string
I have the following code: public abstract class BaseController : Controller { public IUserService
Inside my controller's action I have the following code: public ActionResult GridAction(string id) {
I have the following code public class BaseController : Controller { SqlConnection con; DataSet
I have the following code: class Controller { public Controller(Listener audioListener, Listener videoListener) {}
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have the following code in my controller: public ActionResult Details(int id) { var
I have the following code in controller: public ActionResult SearchPage() { return View(); }

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.