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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:15:32+00:00 2026-05-15T22:15:32+00:00

I am studying springmvc. When I use @RequestMapping(value=/helloWorld, headers = content-type=text/*) and connect to

  • 0

I am studying springmvc. When I use @RequestMapping(value="/helloWorld", headers = "content-type=text/*") and connect to http://localhost:8080/SpringMVC_10100/helloWorld, the following is output in the console:

WARN
org.springframework.web.servlet.PageNotFound
– No matching handler method found for servlet request: path '/helloWorld',
method 'GET', parameters
map[[empty]]

My code is:

@Controller
public class HelloWordController {
    private Logger logger = LoggerFactory.getLogger(HelloWordController.class);

    @RequestMapping(value="/helloWorld", headers = "content-type=text/*")
    public ModelAndView helloWorld() {
        logger.debug("jin ru le");
        logger.info("The helloWorld() method is use");
        ModelAndView view = new ModelAndView();
        view.setViewName("/helloworld");
        return view;
    }
}

web.xml is

<servlet>
    <description>This is Spring MVC DispatcherServlet</description>
    <servlet-name>SpringMVC DispatchServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <description>SpringContext</description>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:springmvc.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>SpringMVC DispatchServlet</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

Why?

  • 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-15T22:15:33+00:00Added an answer on May 15, 2026 at 10:15 pm

    Its most likely the case that /helloworld is not inside the path configured for your dispatcher servlet

    e.g. If i have a servlet configured like so:

      <servlet>
        <servlet-name>BMA</servlet-name>
        <servlet-class>
           org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>2</load-on-startup>
      </servlet>
    
      <servlet-mapping>
        <servlet-name>BMA</servlet-name>
        <url-pattern>/bma/*</url-pattern>
      </servlet-mapping>
    

    And i have a controller configured like so:

    @RequestMapping(value = "/planner/plan/{planId}/delete", method = RequestMethod.GET)
    public ModelAndView deletePlanConfirm(HttpServletRequest request,  
           @PathVariable("planId")   Long planId)   {}
    

    Then the request in browsder would be:

    http://localhost:8080/bma/planner/plan/1223/delete
    

    Edit:
    Also if you have content-type header narrowing on your handler, make sure that content-type haeder is sent in your request.

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

Sidebar

Related Questions

Studying compilers course, I am left wondering why use registers at all. It is
After studying TCP/UDP difference all week, I just can't decide which to use. I
I'm studying how to use ZeroMQ together with EventMachine. To test things out, I
Studying at http://ruby.railstutorial.org/ version 3.2 Stucked in the end of 6.2.1 section with the
I'm studying enterprise patterns to use with .NET, I read a lot of theory
when studying RMI sometimes (head first Java) dudes use Naming.rebind(name, object) but other peoples
Studying vision, I would like to play with the Microsoft Kinect. Can I use
Studying MS Exam 70-536 .Net Foundation I've got to Chapter 11 Application Security and
While studying for a Functional Programming exam, I came across the following questions from
While studying for a Functional Programming exam, I came across the following question from

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.