刚开始学java,碰到404,卡了1天了,求大佬指教。就SSM项目,没有用到maven和springboot
springmvc.xml配置
<!-- 扫描controller包 -->
<context:component-scan base-package="com.car.bus.controller"></context:component-scan>
<context:component-scan base-package="com.car.sys.controller"></context:component-scan>
<!-- 配置文件上上传 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="uft-8"></property>
<property name="uploadTempDir" value="upload/temp"></property>
<property name="maxUploadSize" value="20971520"></property>
</bean>
<!-- 配置自动映射 -->
<mvc:annotation-driven/>
<!-- 配置静态文件放行 -->
<mvc:default-servlet-handler/>
<!-- 配置视图类 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/view/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
web.xml配置
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" id="WebApp_ID" version="4.0">
<display-name>car</display-name>
<!-- 配置application-context加载监听器 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:application-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 编码过滤器设置 -->
<filter>
<filter-name>charset</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<!-- 编码过滤器映射 -->
<filter-mapping>
<filter-name>charset</filter-name>
<servlet-name>springmvc</servlet-name>
</filter-mapping>
<!-- 配置前端控制器 -->
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<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</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
controller内容
package com.car.sys.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;import com.car.sys.constast.SYS_CONSTAST;
import com.car.sys.domain.User;
import com.car.sys.service.UserService;
import com.car.sys.utils.WebUtils;
import com.car.sys.vo.UserVo;@Controller
@RequestMapping("login")
public class LoginController {
@Autowir