forked from eugenp/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eugenp#169 from Doha2012/master
add graph and readme
- Loading branch information
Showing
5 changed files
with
158 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
========= | ||
|
||
## Login and Registration Example Project with Spring Security | ||
|
||
|
||
### Relevant Articles: | ||
- [Spring Security Registration Tutorial](http://www.baeldung.com/spring-security-registration) | ||
|
||
|
||
|
||
### Build the Project | ||
``` | ||
mvn clean install | ||
``` | ||
|
||
|
||
### Set up MySQL | ||
``` | ||
mysql -u root -p | ||
> CREATE USER 'tutorialuser'@'localhost' IDENTIFIED BY 'tutorialmy5ql'; | ||
> GRANT ALL PRIVILEGES ON *.* TO 'tutorialuser'@'localhost'; | ||
> FLUSH PRIVILEGES; | ||
``` | ||
|
||
|
||
### Set up Email | ||
|
||
You need to configure the email by renaming file "email.properties.sample" to "email.properties" and provide your own username and password. | ||
You also need to use your own host, you can use Amazon or Google for example. |
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
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
42 changes: 42 additions & 0 deletions
42
spring-security-rest-full/src/main/webapp/WEB-INF/view/graph.jsp
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,42 @@ | ||
<html> | ||
<head> | ||
<title>Metric Graph</title> | ||
<script | ||
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | ||
<script type="text/javascript" src="https://www.google.com/jsapi"></script> | ||
<script type="text/javascript"> | ||
google.load("visualization", "1", { | ||
packages : [ "corechart" ] | ||
}); | ||
function drawChart() { | ||
$.get("http://localhost:8080/spring-security-rest-full/metric-graph", | ||
function(mydata) { | ||
var data = google.visualization.arrayToDataTable(mydata); | ||
var options = { | ||
title : 'Website Metric', | ||
hAxis : { | ||
title : 'Time', | ||
titleTextStyle : { | ||
color : '#333' | ||
} | ||
}, | ||
vAxis : { | ||
minValue : 0 | ||
} | ||
}; | ||
var chart = new google.visualization.AreaChart(document | ||
.getElementById('chart_div')); | ||
chart.draw(data, options); | ||
}); | ||
} | ||
</script> | ||
</head> | ||
<body onload="drawChart()"> | ||
<div id="chart_div" style="width: 900px; height: 500px;"></div> | ||
</body> | ||
</html> |