Merge pull request #202 from Doha2012/master

add jsp header
This commit is contained in:
Eugen 2015-04-27 10:47:18 +03:00
commit ebc83338b5
8 changed files with 37 additions and 120 deletions

View File

@ -7,6 +7,7 @@ import java.util.List;
import org.baeldung.persistence.service.RedditTokenService;
import org.baeldung.reddit.classifier.RedditClassifier;
import org.baeldung.reddit.util.MyFeatures;
import org.baeldung.reddit.util.UserAgentInterceptor;
import org.baeldung.web.schedule.ScheduledTasks;
import org.springframework.beans.factory.annotation.Autowired;
@ -87,9 +88,11 @@ public class WebConfig extends WebMvcConfigurerAdapter {
@Bean
public RedditClassifier redditClassifier() throws IOException {
final Resource file = new ClassPathResource("data.csv");
final RedditClassifier redditClassifier = new RedditClassifier();
if (MyFeatures.PREDICTION_FEATURE.isActive()) {
final Resource file = new ClassPathResource("data.csv");
redditClassifier.trainClassifier(file.getFile().getAbsolutePath());
}
return redditClassifier;
}

View File

@ -21,26 +21,8 @@ border-color: #ddd;
</style>
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="<c:url value="/home.html" />">Schedule to Reddit</a>
</div>
<jsp:include page="header.jsp" />
<p class="navbar-text navbar-right">Logged in as
<b><sec:authentication property="principal.username" /></b>&nbsp;&nbsp;&nbsp;
</p>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="<c:url value="/posts" />">My Scheduled Posts</a></li>
<li><a href="<c:url value="/post" />">Post to Reddit</a></li>
<li><a href="<c:url value="/postSchedule" />">Schedule Post to Reddit</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="container">
<h1>Edit Scheduled Post</h1>
<form action="<c:url value="/updatePost/${post.getId()}" />" method="post" role="form" data-toggle="validator">

View File

@ -0,0 +1,24 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="<c:url value="/home.html" />">Schedule to Reddit</a>
</div>
<p class="navbar-text navbar-right">Logged in as
<b><sec:authentication property="principal.username" /></b>&nbsp;&nbsp;&nbsp;
<a href="<c:url value="/logout" />">Logout</a>&nbsp;&nbsp;&nbsp;
</p>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="<c:url value="/posts" />">My Scheduled Posts</a></li>
<li><a href="<c:url value="/post" />">Post to Reddit</a></li>
<li><a href="<c:url value="/postSchedule" />">Schedule Post to Reddit</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>

View File

@ -8,27 +8,8 @@
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Schedule to Reddit</a>
</div>
<jsp:include page="header.jsp" />
<p class="navbar-text navbar-right">Logged in as
<b><sec:authentication property="principal.username" /></b>&nbsp;&nbsp;&nbsp;
<a href="logout">Logout</a>&nbsp;&nbsp;&nbsp;
</p>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="posts">My Scheduled Posts</a></li>
<li><a href="post">Post to Reddit</a></li>
<li><a href="postSchedule">Schedule Post to Reddit</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="container">
<h1>Welcome, <small><sec:authentication property="principal.username" /></small></h1>
<br>

View File

@ -10,26 +10,8 @@
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="home.html">Schedule to Reddit</a>
</div>
<jsp:include page="header.jsp" />
<p class="navbar-text navbar-right">Logged in as
<b><sec:authentication property="principal.username" /></b>&nbsp;&nbsp;&nbsp;
</p>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="posts">My Scheduled Posts</a></li>
<li><a href="post">Post to Reddit</a></li>
<li><a href="postSchedule">Schedule Post to Reddit</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="container">
<h1>My Scheduled Posts</h1>
<table class="table table-bordered">

View File

@ -23,26 +23,8 @@ border-color: #ddd;
</style>
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="home.html">Schedule to Reddit</a>
</div>
<jsp:include page="header.jsp" />
<p class="navbar-text navbar-right">Logged in as
<b><sec:authentication property="principal.username" /></b>&nbsp;&nbsp;&nbsp;
</p>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="posts">My Scheduled Posts</a></li>
<li><a href="post">Post to Reddit</a></li>
<li class="active"><a href="postSchedule">Schedule Post to Reddit</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="container">
<h1>Schedule Post to Reddit</h1>
<form action="schedule" method="post" role="form" data-toggle="validator">

View File

@ -21,26 +21,8 @@ border-color: #ddd;
</style>
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="home.html">Schedule to Reddit</a>
</div>
<jsp:include page="header.jsp" />
<p class="navbar-text navbar-right">Logged in as
<b><sec:authentication property="principal.username" /></b>&nbsp;&nbsp;&nbsp;
</p>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="posts">My Scheduled Posts</a></li>
<li class="active"><a href="post">Post to Reddit</a></li>
<li><a href="postSchedule">Schedule Post to Reddit</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="container">
<h1>Post to Reddit</h1>
<form action="submit" method="post" role="form" data-toggle="validator">

View File

@ -9,26 +9,7 @@
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="home.html">Schedule to Reddit</a>
</div>
<p class="navbar-text navbar-right">Logged in as
<b><sec:authentication property="principal.username" /></b>&nbsp;&nbsp;&nbsp;
</p>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="posts">My Scheduled Posts</a></li>
<li><a href="post">Post to Reddit</a></li>
<li><a href="postSchedule">Schedule Post to Reddit</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<jsp:include page="header.jsp" />
<div class="container">
<h1>${msg}</h1>
</div>