在运行department_list.jsp时出现404找不到文件的错误
package com.imooc.oa.controller; import com.imooc.oa.biz.DepartmentBiz; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import java.util.List; import java.util.Map; @Controller("departmentController") @RequestMapping("/department") public class DepartmentController { @Autowired private DepartmentBiz departmentBiz; @RequestMapping("/list") public String list(Map<String,Object> map){ map.put("list",departmentBiz.getAll()); return "department_list"; } } =============================================================================================== spring_web.xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <import resource="spring_biz.xml"/> <context:component-scan base-package="com.imooc.oa.controller"/> <mvc:annotation-driven/> <!-- 打开静态资源设置规则--> <mvc:default-servlet-handler/> <!-- 视图转换器--> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <!-- 定义前缀--> <property name="prefix" value="/WEB-INF/pages/"/> <!-- 定义后缀--> <property name="suffix" value=".jsp"/> </bean> </beans>
3
收起
正在回答 回答被采纳积分+1
5回答
qq_慕前端8123077
2019-07-22 16:06:38
qq_慕前端8123077
2019-07-22 14:54:55
department_list.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <jsp:include page="top.jsp"/> <section id="content" class="table-layout animated fadeIn"> <div class="tray tray-center"> <div class="content-header"> <h2> 部门列表 </h2> <p class="lead"></p> </div> <div class="admin-form theme-primary mw1000 center-block" style="padding-bottom: 175px;"> <div class="panel heading-border"> <div class="panel-menu"> <div class="row"> <div class="hidden-xs hidden-sm col-md-3"> <div class="btn-group"> <button type="button" class="btn btn-default light"> <i class="fa fa-refresh"></i> </button> <button type="button" class="btn btn-default light"> <i class="fa fa-trash"></i> </button> <button type="button" class="btn btn-default light"> <i class="fa fa-plus" onclick="javascript:window.location.href='/department/to_add';"></i> </button> </div> </div> <div class="col-xs-12 col-md-9 text-right"> <div class="btn-group"> <button type="button" class="btn btn-default light"> <i class="fa fa-chevron-left"></i> </button> <button type="button" class="btn btn-default light"> <i class="fa fa-chevron-right"></i> </button> </div> </div> </div> </div> <div class="panel-body pn"> <table id="message-table" class="table admin-form theme-warning tc-checkbox-1"> <thead> <tr class=""> <th class="text-center hidden-xs">Select</th> <th class="hidden-xs">部门编号</th> <th class="hidden-xs">部门名称</th> <th class="hidden-xs">地址</th> <th>操作</th> </tr> </thead> <tbody> <c:forEach items="${list}" var="dept"> <tr class="message-unread"> <td class="hidden-xs"> <label class="option block mn"> <input type="checkbox" name="mobileos" value="FR"> <span class="checkbox mn"></span> </label> </td> <td>${dept.sn}</td> <td>${dept.name}</td> <td>${dept.address}</td> <td> <a href="/department/to_update?sn=${dept.sn}">编辑</a> <a href="/department/remove?sn=${dept.sn}">删除</a> </td> </tr> </c:forEach> </tbody> </table> </div> </div> </div> </div> </section> <jsp:include page="bottom.jsp"/>
=======================================================
qq_慕前端8123077
2019-07-22 14:53:46
top.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <!DOCTYPE html> <html> <!-- Mirrored from admindesigns.com/demos/absolute/1.1/admin_forms-validation.html by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 06 Aug 2015 02:56:15 GMT --> <head> <!-- Meta, title, CSS, favicons, etc. --> <meta charset="utf-8"> <title> 爱慕课OA--欢迎使用爱慕课OA系统 </title> <link rel="stylesheet" type="text/css" href="/assets/skin/default_skin/css/theme.css"> <link rel="stylesheet" type="text/css" href="/assets/admin-tools/admin-forms/css/admin-forms.css"> <link rel="shortcut icon" href="/assets/img/favicon.ico"> </head> <body class="admin-validation-page" data-spy="scroll" data-target="#nav-spy" data-offset="200"> <div id="main"> <header class="navbar navbar-fixed-top navbar-shadow"> <div class="navbar-branding"> <a class="navbar-brand" href="dashboard.html"> <b>爱慕课</b>OA </a> <span id="toggle_sidemenu_l" class="ad ad-lines"></span> </div> <ul class="nav navbar-nav navbar-right"> <li class="dropdown menu-merge"> <a href="#" class="dropdown-toggle fw600 p15" data-toggle="dropdown"> <img src="/assets/img/avatars/5.jpg" alt="avatar" class="mw30 br64"> <span class="hidden-xs pl15"> 刘备 </span> <span class="caret caret-tp hidden-xs"></span> </a> <ul class="dropdown-menu list-group dropdown-persist w250" role="menu"> <li class="list-group-item"> <a href="/self" class="animated animated-short fadeInUp"> <span class="fa fa-user"></span> 个人信息 <span class="label label-warning"></span> </a> </li> <li class="list-group-item"> <a href="/to_change_password" class="animated animated-short fadeInUp"> <span class="fa fa-gear"></span> 设置密码 </a> </li> <li class="dropdown-footer"> <a href="/quit" class=""> <span class="fa fa-power-off pr5"></span> 退出 </a> </li> </ul> </li> </ul> </header> <aside id="sidebar_left" class="nano nano-light affix"> <div class="sidebar-left-content nano-content"> <header class="sidebar-header"> <div class="sidebar-widget author-widget"> <div class="media"> <a class="media-left" href="#"> <img src="assets/img/avatars/3.jpg" class="img-responsive"> </a> <div class="media-body"> <div class="media-author">刘备--总经理</div> <div class="media-links"> <a href="/quit">退出</a> </div> </div> </div> </div> <div class="sidebar-widget search-widget hidden"> <div class="input-group"> <span class="input-group-addon"> <i class="fa fa-search"></i> </span> <input type="text" id="sidebar-search" class="form-control" placeholder="Search..."> </div> </div> </header> <ul class="nav sidebar-menu"> <li class="sidebar-label pt20">日常管理</li> <li> <a href="/claim_voucher/deal"> <span class="glyphicon glyphicon-book"></span> <span class="sidebar-title">待处理报销单</span> <span class="sidebar-title-tray"> <span class="label label-xs bg-primary">New</span> </span> </a> </li> <li class="active"> <a href="/claim_voucher/self"> <span class="glyphicon glyphicon-home"></span> <span class="sidebar-title">个人报销单</span> </a> </li> <li> <a href="/claim_voucher/to_add"> <span class="fa fa-calendar"></span> <span class="sidebar-title">填写报销单</span> </a> </li> <li class="sidebar-label pt15">基础信息管理</li> <li> <a class="accordion-toggle" href="#"> <span class="glyphicon glyphicon-check"></span> <span class="sidebar-title">员工管理</span> <span class="caret"></span> </a> <ul class="nav sub-nav"> <li> <a href="/employee/list"> <span class="glyphicon glyphicon-calendar"></span> 所有员工 </a> </li> <li class="active"> <a href="/employee/to_add"> <span class="glyphicon glyphicon-check"></span> 添加员工 </a> </li> </ul> </li> <li> <a class="accordion-toggle" href="#"> <span class="fa fa-columns"></span> <span class="sidebar-title">部门管理</span> <span class="caret"></span> </a> <ul class="nav sub-nav"> <li> <a href="/department/list"> <span class="glyphicon glyphicon-calendar"></span> 所有部门 </a> </li> <li class="active"> <a href="/department/to_add"> <span class="glyphicon glyphicon-check"></span> 添加部门 </a> </li> </ul> </li> </ul> <div class="sidebar-toggle-mini"> <a href="#"> <span class="fa fa-sign-out"></span> </a> </div> </div> </aside> <section id="content_wrapper">
bottom.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %> </section> </div> <style> /* demo page styles */ body { min-height: 2300px; } .content-header b, .admin-form .panel.heading-border:before, .admin-form .panel .heading-border:before { transition: all 0.7s ease; } /* responsive demo styles */ @media (max-width: 800px) { .admin-form .panel-body { padding: 18px 12px; } } </style> <style> .ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 48%; margin-top: 0; margin-bottom: 0; line-height: 25px; text-indent: 3px; color: #888; border-color: #DDD; background-color: #FDFDFD; -webkit-appearance: none; /*Optionally disable dropdown arrow*/ } </style> <script src="/vendor/jquery/jquery-1.11.1.min.js"></script> <script src="/vendor/jquery/jquery_ui/jquery-ui.min.js"></script> <script src="/assets/admin-tools/admin-forms/js/jquery.validate.min.js"></script> <script src="/assets/admin-tools/admin-forms/js/additional-methods.min.js"></script> <script src="/assets/admin-tools/admin-forms/js/jquery-ui-datepicker.min.js"></script> <script src="/assets/js/utility/utility.js"></script> <script src="/assets/js/demo/demo.js"></script> <script src="/assets/js/main.js"></script> <script type="text/javascript" src="/js/pages.js"></script> <script type="text/javascript" src="/js/items.js"></script> </body> </html>
SSM主流框架入门与综合项目实战2018版
- 参与学习 人
- 提交作业 205 份
- 解答问题 4317 个
Java中非常实用的SSM整合开发内容,从Spring开始,到MyBaits的进阶内容,再到SpringMVC的应用,最后是SSM整合开发案例,逐步深入,助你成长为一名Java工程师!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星