From 84ab115308bc42ece293a09f1ce694397937086e Mon Sep 17 00:00:00 2001 From: crossoverJie Date: Sat, 12 Nov 2016 23:43:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0tomcat=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 8 +++++++- .../crossoverJie/controller/IndexController.java | 15 +++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 86d2063..94e3cf3 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.crossoverJie SSM war - 1.6 + 1.6.1 @@ -18,9 +18,15 @@ 1.6 + + org.apache.tomcat.maven + tomcat7-maven-plugin + 2.2 + + UTF-8 4.1.4.RELEASE diff --git a/src/main/java/com/crossoverJie/controller/IndexController.java b/src/main/java/com/crossoverJie/controller/IndexController.java index feae85b..593f9c8 100644 --- a/src/main/java/com/crossoverJie/controller/IndexController.java +++ b/src/main/java/com/crossoverJie/controller/IndexController.java @@ -1,6 +1,5 @@ package com.crossoverJie.controller; -import com.fasterxml.jackson.databind.util.JSONPObject; import com.crossoverJie.lucene.LuceneIndex; import com.crossoverJie.pojo.Content; import com.crossoverJie.pojo.PageEntity; @@ -8,21 +7,19 @@ import com.crossoverJie.service.ContentService; import com.crossoverJie.service.IUserService; import com.crossoverJie.util.CommonUtil; -import com.crossoverJie.util.DateUtil; import com.crossoverJie.util.PageUtil; -import com.crossoverJie.util.StringUtil; -import com.fasterxml.jackson.databind.util.ObjectBuffer; +import com.fasterxml.jackson.databind.util.JSONPObject; import net.sf.json.JSONObject; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -51,6 +48,8 @@ public String index(@RequestParam(value = "page", required = false, defaultValue model.addAttribute("users", users); StringBuffer param = new StringBuffer(); + + String pageHtml = PageUtil.genPagination(request.getContextPath() + "/index", total, page, 10, param.toString()); model.addAttribute("pageHtml", pageHtml); return "index";