java.lang.AssertionError: Content type not set while junit Spring MVC Controller?

后端 未结 2 449
一向
一向 2020-12-18 02:07

I am using JUnit to test my Spring MVC controller. Below is my method which returns a index.jsp page and shows Hello World on the screen -

2条回答
  •  我在风中等你
    2020-12-18 02:33

    You should also check your request mappings:

    Does get("/...") match @RequestMapping ?

    If the handleRequest is never called, you will get the same error Content type not set.

提交回复
热议问题