(2)创建JSP目录
(3)创建springmvc.xml
<beans xmlns=“http://www.springframework.org/schema/beans”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:p=“http://www.springframework.org/schema/p”
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-4.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
<context:component-scan base-package=“com.itzheng.crm.controller” />
<mvc:annotation-driven />
(四)Web.xml文件
配置Spring
配置前端控制器
<web-app xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xmlns=“http://java.sun.com/xml/ns/javaee”
xsi:schemaLocation=“http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”
id=“WebApp_ID” version=“2.5”>
boot-crm
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
contextConfigLocation
classpath:spring/applicationContext-*.xml
org.springframework.web.context.ContextLoaderListener
encoding
org.springframework.web.filter.CharacterEncodingFilter
encoding
/*
boot-crm
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath:spring/springmvc.xml
1
boot-crm
*.action
下载JSP页面代码直接导入到项目当中:JSP页面下载地址:https://download.youkuaiyun.com/download/qq_44757034/16528744
1、创建控制器:CustomerController
package com.itzheng.crm.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/*
- 客户信息请求处理
*/
@Controller
@RequestMapping(“customer”)
public class CustomerController {
@RequestMapping(“list”)
public String list() {
return “customer”;
}
}
2、创建customer.jsp
<%@ page language=“java” contentType=“text/html; charset=UTF-8”
pageEncoding=“UTF-8”%>
<%@ page trimDirectiveWhitespaces=“true”%>
<%@ taglib prefix=“c” uri=“http://java.sun.com/jsp/jstl/core”%>
<%@ taglib prefix=“itzheng” uri=“http://itzheng.cn/common/”%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + “😕/” + request.getServerName() + “:” + request.getServerPort()
- path + “/”;
%>
type=“text/css”>
type=“text/css”>
style=“margin-bottom: 0”>
<button type=“button” class=“navbar-toggle” data-toggle=“collapse”
data-target=“.navbar-collapse”>
Toggle navigation <span
class=“icon-bar”> <span
class=“icon-bar”>
data-toggle=“dropdown” href=“#”>
-
令狐冲
昨天
今天晚上向大哥找我吃饭,讨论一下去梅庄的事... - 查看全部消息
data-toggle=“dropdown” href=“#”>
-
任务 1 完成40%
role=“progressbar” aria-valuenow=“40” aria-valuemin=“0”
aria-valuemax=“100” style=“width: 40%”>
完成40%
-
任务 2 完成20%
aria-valuenow=“20” aria-valuemin=“0” aria-valuemax=“100”
style=“width: 20%”>
完成20%
- 查看所有任务
data-toggle=“dropdown” href=“#”>
-
新回复 <span
class=“pull-right text-muted small”>4分钟之前
-
新消息 <span
class=“pull-right text-muted small”>4分钟之前
-
新任务 <span
class=“pull-right text-muted small”>4分钟之前
-
服务器重启 <span
class=“pull-right text-muted small”>4分钟之前
- 查看所有提醒
data-toggle=“dropdown” href=“#”>
- 用户设置
- 系统设置
退出登录
-
class=“fa fa-edit fa-fw”> 客户管理
class=“fa fa-dashboard fa-fw”> 客户拜访
客户管理
<c:forEach items=“${fromType}” var=“item”>
</c:forEach>
<c:forEach items=“${industryType}” var=“item”>
</c:forEach>
<c:forEach items=“${levelType}” var=“item”>
</c:forEach>
查询
客户信息列表ID 客户名称 客户来源 客户所属行业 客户级别 固定电话 手机 操作
<c:forEach items=“${page.rows}” var=“row”>
${row.cust_id} ${row.cust_name} ${row.cust_source} ${row.cust_industry} ${row.cust_level} ${row.cust_phone} ${row.cust_mobile}</c:forEach>
<itzheng:page url=“${pageContext.request.contextPath }/customer/list.action” />
aria-labelledby=“myModalLabel”>