页面404是为什么,tomacat也没有报错
package com.imooc.sm.controller; import com.imooc.sm.entity.Department; import com.imooc.sm.service.DepartmentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; @Controller("departmentController") public class DepartmentController { @Autowired private DepartmentService departmentService; public void list(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<Department> list = departmentService.getAll(); request.setAttribute("list",list); request.getRequestDispatcher("../department_list.jsp").forward(request,response); } } ===============================================================================
[2019-07-20 04:55:09,601] Artifact sm_web:war exploded: Artifact is deployed successfully
[2019-07-20 04:55:09,601] Artifact sm_web:war exploded: Deploy took 3,807 milliseconds
20-Jul-2019 16:55:15.713 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\docs]
20-Jul-2019 16:55:16.183 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\docs] has finished in [335] ms
20-Jul-2019 16:55:16.184 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\examples]
20-Jul-2019 16:55:21.332 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\examples] has finished in [5,148] ms
20-Jul-2019 16:55:21.332 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\host-manager]
20-Jul-2019 16:55:21.717 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\host-manager] has finished in [385] ms
20-Jul-2019 16:55:21.717 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\manager]
20-Jul-2019 16:55:21.797 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\manager] has finished in [79] ms
20-Jul-2019 16:55:21.797 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\mybatispro_war]
20-Jul-2019 16:55:21.888 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\mybatispro_war] has finished in [91] ms
20-Jul-2019 16:55:21.888 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\oa_web_war]
20-Jul-2019 16:55:32.058 信息 [localhost-startStop-2] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Jul-2019 16:55:32.563 信息 [localhost-startStop-2] org.springframework.web.servlet.FrameworkServlet.initServletBean Initializing Servlet 'springMVC'
20-Jul-2019 16:55:36.506 信息 [localhost-startStop-2] org.springframework.web.servlet.FrameworkServlet.initServletBean Completed initialization in 3943 ms
20-Jul-2019 16:55:36.513 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\oa_web_war] has finished in [14,625] ms
20-Jul-2019 16:55:36.513 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\ROOT]
20-Jul-2019 16:55:36.558 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\ROOT] has finished in [45] ms
20-Jul-2019 16:55:36.558 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\rumenchengxu_war]
20-Jul-2019 16:55:38.732 信息 [localhost-startStop-2] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Jul-2019 16:55:39.107 信息 [localhost-startStop-2] org.springframework.web.servlet.FrameworkServlet.initServletBean Initializing Servlet 'dispatcherServlet'
20-Jul-2019 16:55:40.383 信息 [localhost-startStop-2] org.springframework.web.servlet.FrameworkServlet.initServletBean Completed initialization in 1276 ms
20-Jul-2019 16:55:40.398 信息 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\tomcat and javaEE\apache-tomcat-8.5.41\webapps\rumenchengxu_war] has finished in [3,840] ms
=================================================================
<%-- Created by IntelliJ IDEA. User: Administrator Date: 2019/7/20 Time: 15:42 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>部门列表</title> <link rel="stylesheet" type="text/css" href="../css/reset.css"/> <link rel="stylesheet" type="text/css" href="../css/common.css"/> <link rel="stylesheet" type="text/css" href="../css/thems.css"> <script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script> <script type="text/javascript"> $(function(){ //自适应屏幕宽度 window.onresize=function(){ location=location }; var main_h = $(window).height(); $('.hy_list').css('height',main_h-45+'px'); var search_w = $(window).width()-40; $('.search').css('width',search_w+'px'); //$('.list_hy').css('width',search_w+'px'); }); </script> <!--框架高度设置--> </head> <body onLoad="Resize();"> <div id="right_ctn"> <div class="right_m"> <div class="hy_list"> <div class="box_t"> <span class="name">部门列表</span> </div> <div class="space_hx"> </div> <!--列表--> <table cellpadding="0" cellspacing="0" class="list_hy"> <tr> <th class="xz" scope="col">选择</th> <th scope="col">名称</th> <th scope="col">地址</th> <th scope="col">操作</th> </tr> <c:forEach items="list" var="dep"> <tr> <td class="xz"><input name="" type="checkbox" value=""></td> <td>${dep.name}</td> <td>${dep.address}</td> <td> <a href="add.html" class="btn">编辑</a> <a href="" class="btn">删除</a> <a href="detail.html" class="btn">查看</a> </td> </tr> </c:forEach> </table> <!--列表--> <!--右边底部--> <div class="r_foot"> <div class="r_foot_m"> <a href="add.html" class="btn">添加</a> </div> </div> <!--右边底部--> </div> <!--会议列表--> </div> </div> </body> </html>
正在回答 回答被采纳积分+1
同学你好!
1.同学控制台不是list吗?同学访问list.do是不可以的
2.同学的另一个问题老师已经回复了,https://class.imooc.com/course/qadetail/136668 同学可以看一下。
如果我的回答解决了你的疑惑,请采纳,祝学习愉快~
- 参与学习 人
- 提交作业 205 份
- 解答问题 4317 个
Java中非常实用的SSM整合开发内容,从Spring开始,到MyBaits的进阶内容,再到SpringMVC的应用,最后是SSM整合开发案例,逐步深入,助你成长为一名Java工程师!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星