Skip to content

Commit

Permalink
jquery
Browse files Browse the repository at this point in the history
  • Loading branch information
fgliu committed Jul 18, 2016
1 parent 606a6db commit 58839b4
Show file tree
Hide file tree
Showing 9 changed files with 298 additions and 208 deletions.
376 changes: 170 additions & 206 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Empty file removed d:/seckilllog/debug.log
Empty file.
2 changes: 1 addition & 1 deletion src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="ROOT_LOG_PATH" value="d:/seckilllog" />
<property name="ROOT_LOG_PATH" value="/seckilllog" />

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/spring/spring-web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ http://www.springframework.org/schema/tx/spring-tx.xsd">
<!-- 4:配置 jsp 显示viewResolver-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>

Expand Down
11 changes: 11 additions & 0 deletions src/main/webapp/WEB-INF/jsp/common/head.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- 引入 Bootstrap -->
<link href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">

<!-- HTML5 Shim 和 Respond.js 用于让 IE8 支持 HTML5元素和媒体查询 -->
<!-- 注意: 如果通过 file:// 引入 Respond.js 文件,则该文件无法起效果 -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
2 changes: 2 additions & 0 deletions src/main/webapp/WEB-INF/jsp/common/tag.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
19 changes: 19 additions & 0 deletions src/main/webapp/WEB-INF/jsp/detail.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>秒杀详情页</title>
<%@include file="common/head.jsp"%>
</head>
<body>
<div class="container">
<div class="pannel pannel-defalut text-center">
<div class="pannel-heading">${seckill.name}</div>
</div>
<div class="panel-body">
</div>
</div>

</body>
<script src="http://apps.bdimg.com/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>
</html>
57 changes: 57 additions & 0 deletions src/main/webapp/WEB-INF/jsp/list.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="common/tag.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>秒杀列表页</title>
<%@include file="common/head.jsp"%>
</head>
<body>
<!--页面显示部分 -->
<div class="container">
<div class="pannel pannel-default">
<div class="pannel-heading text-center">
<h2>秒杀列表</h2>
</div>
<div class="pannel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>库存</th>
<th>开始时间</th>
<th>结束时间</th>
<th>创建时间</th>
<th>详情页</th>
</tr>
</thead>

<tbody>
<c:forEach var="sk" items="${list}">
<tr>
<td>${sk.name}</td>
<td>${sk.number}</td>
<td>
<fmt:formatDate value="${sk.startTime}" pattern="yyyy-MM-dd HH:mm:ss" />
</td>
<td>
<fmt:formatDate value="${sk.endTime}" pattern="yyyy-MM-dd HH:mm:ss" />
</td>
<td>
<fmt:formatDate value="${sk.createTime}" pattern="yyyy-MM-dd HH:mm:ss" />
</td>
<td>
<a class="btn btn-info" href="/seckill/${sk.seckillId}/detail" target="_blank"
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</div>

</body>
<script src="http://apps.bdimg.com/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>
</html>
37 changes: 37 additions & 0 deletions target/classes/spring/spring-web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8" ?>
<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:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/tx"
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/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
<!--配置springMVC -->
<!--1:开启springMVC 注解模式 -->
<!--简化配置
1:自动注册DefaultAnnotationHandleMapping,AnnotationMethodHandleAdapter
2: 提供一系列:数据绑定,数字和日期的format @NumberFormat @DateFormat,
xml,json 默认读写支持
-->
<mvc:annotation-driven>
<!--
1:静态资源默认servlet 配置
2:加入对静态资源的处理:js,gif,png
3:允许使用"/" 做整体映射
-->

</mvc:annotation-driven>

<!-- 4:配置 jsp 显示viewResolver-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>

<!--5:打描web相关的bean -->
<context:component-scan base-package="org.seckill.web" />
</beans>

0 comments on commit 58839b4

Please sign in to comment.