From 765dd731b4c7033b8841ce0a99db8a00db0de9b1 Mon Sep 17 00:00:00 2001 From: eveloson Date: Sun, 9 Apr 2017 12:14:45 +0800 Subject: [PATCH 1/2] change all needed jars from maven,add jdbc.properties --- .classpath | 2 +- pom.xml | 93 ++++++++++++------ .../ssm/blog/controller/IndexController.java | 7 ++ .../ssm/blog/listener/InitBloggerData.java | 8 +- src/main/resources/applicationContext.xml | 30 +++++- src/main/webapp/WEB-INF/web.xml | 4 +- target/classes/applicationContext.xml | 30 +++++- .../ssm/blog/controller/IndexController.class | Bin 4614 -> 4740 bytes .../ssm/blog/listener/InitBloggerData.class | Bin 2759 -> 2768 bytes 9 files changed, 130 insertions(+), 44 deletions(-) diff --git a/.classpath b/.classpath index 9b3fc69..a15b51e 100644 --- a/.classpath +++ b/.classpath @@ -24,7 +24,7 @@ - + diff --git a/pom.xml b/pom.xml index 606b13f..4faeb6b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,21 +5,43 @@ Blog war 0.0.1-SNAPSHOT + + + 4.2.8.RELEASE + + 4.10 + + 3.2.8 + + 5.1.40 + + 6.0 + + 1.0.20 + + 1.2.20 + + 1.2.5 + + 5.3.1 + 1.9.2 + 2.3.1 + - + - + javax.servlet @@ -31,60 +53,60 @@ org.springframework spring-core - 4.3.0.RELEASE + ${spring.version} org.springframework spring-beans - 4.3.0.RELEASE + ${spring.version} org.springframework spring-context - 4.3.0.RELEASE + ${spring.version} org.springframework spring-context-support - 4.3.0.RELEASE + ${spring.version} org.springframework spring-web - 4.3.0.RELEASE + ${spring.version} org.springframework spring-webmvc - 4.3.0.RELEASE + ${spring.version} org.springframework spring-tx - 4.3.0.RELEASE + ${spring.version} org.springframework spring-jdbc - 4.3.0.RELEASE + ${spring.version} org.springframework spring-aop - 4.3.0.RELEASE + ${spring.version} org.springframework spring-aspects - 4.3.0.RELEASE + ${spring.version} org.mybatis mybatis - 3.4.0 + ${mybatis.version} org.mybatis @@ -96,14 +118,14 @@ mysql mysql-connector-java - 5.1.30 + ${mysql.version} com.alibaba druid - 1.0.16 + ${druid-version} @@ -122,44 +144,44 @@ org.apache.shiro shiro-core - 1.2.5 + ${Shiro.version} org.apache.shiro shiro-web - 1.2.5 + ${Shiro.version} org.apache.shiro shiro-spring - 1.2.5 + ${Shiro.version} org.apache.lucene lucene-core - 5.3.1 + ${lucene.version} org.apache.lucene lucene-queryparser - 5.3.1 + ${lucene.version} org.apache.lucene lucene-analyzers-common - 5.3.1 + ${lucene.version} org.apache.lucene lucene-highlighter - 5.3.1 + ${lucene.version} org.apache.lucene lucene-analyzers-smartcn - 5.3.1 + ${lucene.version} @@ -206,7 +228,7 @@ junit junit - 4.12 + ${junit.version} test @@ -214,8 +236,23 @@ org.jsoup jsoup - 1.9.2 + ${jsoup.version} + + cn.songxinqiang + com.baidu.ueditor + 1.1.2-offical + + + com.hynnet + json-lib + 2.4 + + + org.json + json + 20151123 + Blog diff --git a/src/main/java/ssm/blog/controller/IndexController.java b/src/main/java/ssm/blog/controller/IndexController.java index e935326..61f8bfe 100644 --- a/src/main/java/ssm/blog/controller/IndexController.java +++ b/src/main/java/ssm/blog/controller/IndexController.java @@ -99,4 +99,11 @@ public ModelAndView index( return modelAndView; } + /* + * ַ̨ض + */ + @RequestMapping("/admin") + public String admin(){ + return "redirect:/admin/main.jsp"; + } } diff --git a/src/main/java/ssm/blog/listener/InitBloggerData.java b/src/main/java/ssm/blog/listener/InitBloggerData.java index 0e64559..4c781ad 100644 --- a/src/main/java/ssm/blog/listener/InitBloggerData.java +++ b/src/main/java/ssm/blog/listener/InitBloggerData.java @@ -35,9 +35,11 @@ public void contextInitialized(ServletContextEvent sce) { //ȡϢ Blogger blogger = bloggerService.getBloggerData(); //ҲȡˣȽУҲҪ԰յ - blogger.setPassword(null); - //Ϣapplication - application.setAttribute("blogger", blogger); + if (null != blogger) { + blogger.setPassword(null); + //Ϣapplication + application.setAttribute("blogger", blogger); + } //ͬϣȡϢ LinkService linkService = (LinkService) applicationContext.getBean("linkService"); diff --git a/src/main/resources/applicationContext.xml b/src/main/resources/applicationContext.xml index faa47a3..6463e9a 100644 --- a/src/main/resources/applicationContext.xml +++ b/src/main/resources/applicationContext.xml @@ -17,12 +17,32 @@ - + + + + + classpath*:jdbc.properties + + + - - - + + + + + + + + + + + + + + + @@ -61,7 +81,7 @@ - + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 2a2f62b..ce0a04a 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -2,7 +2,7 @@ Blog - a.jsp + index.html @@ -33,7 +33,7 @@ springMVC - *.do + / springMVC diff --git a/target/classes/applicationContext.xml b/target/classes/applicationContext.xml index faa47a3..6463e9a 100644 --- a/target/classes/applicationContext.xml +++ b/target/classes/applicationContext.xml @@ -17,12 +17,32 @@ - + + + + + classpath*:jdbc.properties + + + - - - + + + + + + + + + + + + + + + @@ -61,7 +81,7 @@ - + diff --git a/target/classes/ssm/blog/controller/IndexController.class b/target/classes/ssm/blog/controller/IndexController.class index 5db43c9cf64e2cb7e30c799435e4df0cea43a055..bf985f0d367080a9efa4f64556ee880286023d81 100644 GIT binary patch delta 189 zcmZouX;I}m^>5cc1_lO0My8Ei%XxKK6H{_C^B5V}^uY`chQEvq5=E&gnMJ9|B~}nY z{oKUNJiV;qg30T7OBtCrtMVOSE?{K%#gNCq#J~*Bpb!HSNH4-rMn(YD!XhI8 delta 64 zcmZosZByYo^>5cc1_lO0hJPEmmh(=2z+247v^j+D0J9ls P;tY%o644Bd#SDJ|e((@C diff --git a/target/classes/ssm/blog/listener/InitBloggerData.class b/target/classes/ssm/blog/listener/InitBloggerData.class index 8a3c09c12e9f33b094f81b58fdf673a22487b7fd..3c698dee5df6de92630e9a3dd70211143d10baf5 100644 GIT binary patch delta 270 zcmXAjyGjF56h+tM_T#mXJ+>6%PFpA>txwrnLKL*ssdXS zspvhV#5rXe>MjWxvBM*~JhRU`2SiFtss2+QVm>Q)V#-8^E|$0-^tdJ=`WxHybxFVz zHEym*3E$+50clC5BuNTRl84!6>53KwtQX*15>D<2ux SDO)vjv#m|Ll-d$5fRN$F>8@XhY*Bx5ph#fQ&ZY%($PVL11~rj_#65Q zPOko>Za6&C^S<|eUC$x35B;qy-;!hez^_?bakH~#^AhLUukmq1fG81Snm9=kkqu8=i16idx#UWl40Pz?5p%`6nnxnf#p~;W7~ecI;DmCM zCa-+pmE=t`?me&6eOS&K}#yZoHsI51fPibz2bDI-2-TYK}$As;BPtjED Mn)gMblG)n1e|$?O^Z)<= From 390cd3e7d46a3f9e04270cf83d5ad42d2bda9065 Mon Sep 17 00:00:00 2001 From: eveloson Date: Sun, 9 Apr 2017 12:31:47 +0800 Subject: [PATCH 2/2] jdbc.properties --- src/main/resources/jdbc.properties | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 src/main/resources/jdbc.properties diff --git a/src/main/resources/jdbc.properties b/src/main/resources/jdbc.properties new file mode 100755 index 0000000..f4155e2 --- /dev/null +++ b/src/main/resources/jdbc.properties @@ -0,0 +1,3 @@ +jdbc.url=jdbc:mysql://127.0.0.1:3306/db_blog +jdbc.user=root +jdbc.password= \ No newline at end of file