基本的SpringMvC控制器无法正常工作 [英] Basic SpringMvC controller not working

查看:238
本文介绍了基本的SpringMvC控制器无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试建立一个基本的MVC控制器项目。我创建了一个servlet和
几个jsp页面。我可以部署项目并访问jsp页面。

I am trying to set up a basic MVC controller project. I have created a servlet and couple of jsp pages. I can deploy the project and access the jsp pages.

当我尝试使用LoginController时,问题就出现了。我得到的错误是404错误。请帮忙。

The problem starts when I try to use the LoginController. The error I am getting is 404 error. Please help.

我附上了我的代码和项目结构的屏幕截图。我本能的是调度程序servlet没有像它想象的那样工作(只是一个猜测)。

I have attached a screenshot of my codes and project structure. I gut instinct is the dispatcher servlet is not working the way it suppose to (just a guess).

我已经用google搜索过去5个小时的代码了徒劳无功。这是我第一次询问有关S / O的问题在此输入图像说明,所以我很抱歉这格式不正确。

I have googled and fiddled with the code for the past 5 hours to no avail. This is my first time asking question on S/O enter image description hereso I apologies If this is not in the correct format.

推荐答案

localhost:8084 / springmvcDemo / login

更改为

localhost:8084 / springmvcDemo / spring-mvc / login

此链接将为您提供帮助

这篇关于基本的SpringMvC控制器无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆