-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
392 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package web.AppAPI; | ||
|
||
import entity.User; | ||
import org.junit.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
import service.ShiroUserService; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* Created by xuweijie on 2017/3/14. | ||
*/ | ||
@RequestMapping("/api") | ||
@Controller | ||
public class apitest { | ||
|
||
@Autowired | ||
private ShiroUserService shiroUserService; | ||
|
||
@RequestMapping("/jsontest") | ||
@ResponseBody | ||
public Map<String, User> getjsopn() { | ||
User user=shiroUserService.queryUser("许伟杰"); | ||
Map<String,User>map=new HashMap<String, User>(); | ||
map.put("user",user); | ||
return map; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/web/HomepageController.java → ...web/WebController/HomepageController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package web; | ||
package web.WebController; | ||
|
||
import entity.User; | ||
import org.apache.shiro.SecurityUtils; | ||
|
2 changes: 1 addition & 1 deletion
2
src/main/java/web/LoginController.java → ...va/web/WebController/LoginController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package web; | ||
package web.WebController; | ||
|
||
import entity.User; | ||
import exception.CustomException; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package web.WebController; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
|
||
/** | ||
* Created by xuweijie on 2017/3/14. | ||
*/ | ||
@Controller | ||
public class ftlcontroller { | ||
@RequestMapping(value="/welcome",method={RequestMethod.GET}) | ||
public ModelAndView getFirstPage(HttpServletRequest request) { | ||
//welcom就是视图的名称(welcom.ftl) | ||
ModelAndView mv = new ModelAndView("welcome"); | ||
mv.addObject("name", "My First Spring Mvc and Freemarker !"); | ||
return mv; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
|
||
jdbc.driver=com.mysql.jdbc.Driver | ||
jdbc.url=jdbc:mysql://139.199.10.50:3306/SSMTest?autoReconnect=true&useUnicode=true&characterEncoding=utf8 | ||
jdbc.url=jdbc:mysql://120.25.79.159:3306/SSMDB?autoReconnect=true&useUnicode=true&characterEncoding=utf8 | ||
jdbc.username=xuweijie | ||
jdbc.password=xuweijie | ||
jdbc.password=xuweijie | ||
|
||
jdbc.driver.slave=com.mysql.jdbc.Driver | ||
jdbc.url.slave=jdbc:mysql://139.199.10.50:3306/SSMDB?autoReconnect=true&useUnicode=true&characterEncoding=utf8 | ||
jdbc.username.slave=xuweijie | ||
jdbc.password.slave=xuweijie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> | ||
|
||
<bean id="freeMarkerConfigurer" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> | ||
<property name="templateLoaderPath" value="/WEB-INF/ftl"/> | ||
<property name="freemarkerSettings"> | ||
<props> | ||
<!--设置标签类型,[]和<>,[]这种解析要快--> | ||
<prop key="tag_syntax">auto_detect</prop> | ||
<!--模板更新时间间隔--> | ||
<prop key="template_update_delay">10</prop> | ||
<prop key="locale">UTF-8</prop> | ||
<prop key="default_encoding">UTF-8</prop> | ||
<prop key="boolean_format">true,false</prop> | ||
<prop key="datetime_format">yyyy-MM-dd HH:MM:SS</prop><!-- 时间格式化 --> | ||
<prop key="date_format">yyyy-MM-dd</prop> | ||
<prop key="number_format">#.##</prop> | ||
<!--去掉多余空格--> | ||
<prop key="whitespace_stripping">true</prop> | ||
</props> | ||
</property> | ||
</bean> | ||
|
||
<!-- freemarker视图解析器 --> | ||
<bean class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"> | ||
<property name="order" value="1"/> | ||
<property name="suffix" value=".ftl" /> | ||
<property name="contentType" value="text/html;charset=UTF-8" /> | ||
<property name="viewClass" value="org.springframework.web.servlet.view.freemarker.FreeMarkerView" /> | ||
<property name="allowSessionOverride" value="true" /> | ||
<property name="allowRequestOverride" value="true" /> | ||
<property name="exposeSpringMacroHelpers" value="false" /> | ||
<property name="exposeRequestAttributes" value="true" /> | ||
<property name="exposeSessionAttributes" value="true" /> | ||
<!-- 此变量值为pageContext.request, 页面使用方法:request.contextPath --> | ||
<property name="requestContextAttribute" value="request" /> | ||
</bean> | ||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>freemarker页面</title> | ||
</head> | ||
<body> | ||
Hello ${name} | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<%-- | ||
Created by IntelliJ IDEA. | ||
User: xuweijie | ||
Date: 2017/3/11 | ||
Time: 16:47 | ||
To change this template use File | Settings | File Templates. | ||
--%> | ||
<%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
<html> | ||
<head> | ||
<title>404</title> | ||
<link rel="stylesheet" type="text/css" href="/styles/errorpagestyle.css"> | ||
<script type="text/javascript" src="/resources/jquery-3.1.1/jquery-3.1.1.min.js"></script> | ||
<script type="text/javascript" src="/resources/jquery-3.1.1/jquery.particleground.min.js"></script> | ||
<script type="text/javascript" src="/js/errorpagejs.js"></script> | ||
</head> | ||
<body> | ||
<div id="particles"> | ||
|
||
<div class="intro"> | ||
|
||
<h1>405</h1> | ||
|
||
<p>不好意思哦!出错了呢</p> | ||
|
||
</div> | ||
|
||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Particleground demo | ||
* @author Jonathan Nicol - @mrjnicol | ||
*/ | ||
|
||
$(document).ready(function() { | ||
$('#particles').particleground({ | ||
dotColor: '#5cbdaa', | ||
lineColor: '#5cbdaa' | ||
}); | ||
$('.intro').css({ | ||
'margin-top': -($('.intro').height() / 2) | ||
}); | ||
}); |
40 changes: 40 additions & 0 deletions
40
src/main/webapp/resources/jquery-3.1.1/jquery.particleground.min.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.