双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

SpringMVC的@RequestMapping开发问题,404

蛋疼汇编 蛋疼汇编 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
在@controller加入@RequestMapping,运行时后台无报错,但页面会显示404错误,看看是哪的问题,代码如下:
@Controller
@RequestMapping("/Cabinet")
public class CabinetListController{

@Autowired
private CabinetService cabinetService;

@RequestMapping("/queryCabinet")
public ModelAndView queryCabinet() throws Exception {
// TODO Auto-generated method stub
List<CabinetHeadExtend> cabinetList =cabinetService.findCabinetHeadList(null);


ModelAndView modelAndView = new ModelAndView();

modelAndView.addObject("cabinetList",cabinetList );
modelAndView.setViewName("cabinet/cabinetList");
return modelAndView;
}

DEBUG时如下,访问controller正常,并且成功访问数据库,并且成功返回ModelAndView

DEBUG [http-bio-8080-exec-6] - ==> Preparing: SELECT cabinet_head.* FROM cabinet_head
DEBUG [http-bio-8080-exec-6] - ==> Parameters:
DEBUG [http-bio-8080-exec-6] - <== Total: 2
DEBUG [http-bio-8080-exec-6] - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1ca905c]
DEBUG [http-bio-8080-exec-6] - Returning JDBC Connection to DataSource
DEBUG [http-bio-8080-exec-6] - Rendering view [org.springframework.web.servlet.view.JstlView: name 'cabinet/cabinetList'; URL [WEB-INF/jsp/cabinet/cabinetList.jsp]] in DispatcherServlet with name 'springmvc'
DEBUG [http-bio-8080-exec-6] - Added model object 'cabinetList' of type [java.util.ArrayList] to request in view with name 'cabinet/cabinetList'
DEBUG [http-bio-8080-exec-6] - Forwarding to resource [WEB-INF/jsp/cabinet/cabinetList.jsp] in InternalResourceView 'cabinet/cabinetList'
DEBUG [http-bio-8080-exec-6] - Successfully completed request

但是页面会报404的错误
HTTP Status 404 - /FaceRecognitionCabinet/Cabinet/WEB-INF/jsp/cabinet/cabinetList.jsp

type Status report

message /FaceRecognitionCabinet/Cabinet/WEB-INF/jsp/cabinet/cabinetList.jsp

description The requested resource is not available.

Apache Tomcat/7.0.56
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
蛋疼汇编
其他 10,612 成员 29,026 内容