问答详情
源自:3-6 用户模型管理--otp验证码获取

无法注入httpservletRequest

Description:


Field httpServletRequest in com.miaoshaproject.controller.UserController required a bean of type 'javax.servlet.http.HttpServletRequest' that could not be found.


The injection point has the following annotations:

- @org.springframework.beans.factory.annotation.Autowired(required=true)



Action:


Consider defining a bean of type 'javax.servlet.http.HttpServletRequest' in your configuration.


提问者:精慕门9468299 2020-04-18 13:48

个回答

  • smallbigfans
    2021-08-04 15:29:08

    代码也不上,怎么知道你的问题.

    估计是你没有自动注入,可以使用

    @bean注解方法和@autowire注解变量