Policy failures:
Code warning - failed on resource ListArticleController.java. Reason: The import java.util.Date is never used, line 1 Override reason: hh
This commit is contained in:
@@ -15,6 +15,9 @@ button.reset=Reset
|
||||
button.OK=OK
|
||||
|
||||
|
||||
listarticle.title=Article's list
|
||||
|
||||
|
||||
preference.title=Choose the preference for articles
|
||||
preference.like=Like
|
||||
preference.indifferent=Indifferent
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<jsp:include page="/WEB-INF/jsp/header.jsp" />
|
||||
|
||||
<jsp:include page="/WEB-INF/jsp/header.jsp" />
|
||||
<div class="mainBloc">
|
||||
<div class="header"> </div>
|
||||
<div class="content">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
|
||||
pageEncoding="ISO-8859-1"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
|
||||
39
YACOSWeb/WebContent/WEB-INF/jsp/listArticle.jsp
Normal file
39
YACOSWeb/WebContent/WEB-INF/jsp/listArticle.jsp
Normal file
@@ -0,0 +1,39 @@
|
||||
<%@ include file="/WEB-INF/jsp/include.jsp"%>
|
||||
<%@ page session="false" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title><fmt:message key="title"/></title>
|
||||
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<jsp:include page="/WEB-INF/jsp/header.jsp" />
|
||||
|
||||
<div class="mainBloc">
|
||||
<div class="header"> </div>
|
||||
<div class="content">
|
||||
|
||||
<jsp:include page="/WEB-INF/jsp/menu.jsp" />
|
||||
<div id="main_content">
|
||||
|
||||
|
||||
|
||||
<c:forEach items="${listArticle}" var="article">
|
||||
<ul class="article">
|
||||
<li class="title">${article.title}</li>
|
||||
<li class="author">${article.mainAuthor}</li>
|
||||
<li class="topic">${article.topic}</li>
|
||||
<li class="article_url">${article.URL_article}</li>
|
||||
</ul>
|
||||
</c:forEach>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer"> </div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,6 +4,7 @@
|
||||
<div class="header">Menu</div>
|
||||
<div class="content">
|
||||
<ul>
|
||||
<li><a href="<c:url value="listArticle.htm"/>"><fmt:message key="listarticle.title" /></a></li>
|
||||
<li><a href="<c:url value="submissionArticle.htm"/>"><fmt:message key="submission.title" /></a></li>
|
||||
<li><a href="<c:url value="choosePreference.htm"/>"><fmt:message key="preference.title" /></a></li>
|
||||
<li><a href="<c:url value="dispatchArticle.htm"/>"><fmt:message key="dispatch.title" /></a></li>
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
|
||||
<bean name="/choosePreferenceOK.htm" class="org.yacos.web.PCmember.controller.ChoosePreferenceControllerOK" />
|
||||
|
||||
<bean name="/listArticle.htm" class="org.yacos.web.PCmember.controller.ListArticleController">
|
||||
<property name="articleManager" ref="articleManager" />
|
||||
</bean>
|
||||
|
||||
<bean name="/submissionArticle.htm" class="org.yacos.web.author.controller.SArticleController">
|
||||
<property name="sessionForm" value="true" />
|
||||
<property name="commandName" value="submissionArticle" />
|
||||
|
||||
@@ -113,4 +113,27 @@ body {
|
||||
|
||||
#main_content {
|
||||
display: table-cell;
|
||||
width: 640px;
|
||||
}
|
||||
|
||||
ul.article {
|
||||
border-bottom : thin solid #666;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
ul.article li {
|
||||
width: 100%;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
ul.article .title {
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
ul.article .author {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
ul.article .article_url {
|
||||
font-size: smaller;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.yacos.web.PCmember.controller;
|
||||
|
||||
import org.springframework.web.servlet.mvc.SimpleFormController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.yacos.core.article.*;
|
||||
|
||||
public class ListArticleController extends SimpleFormController {
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private IArticleManager articleManager;
|
||||
|
||||
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
logger.info("Returning listArticle view");
|
||||
|
||||
List<Article> listArticle = articleManager.getArticles();
|
||||
|
||||
getServletContext().setAttribute("listArticle", listArticle);
|
||||
|
||||
return new ModelAndView("listArticle");
|
||||
}
|
||||
|
||||
public IArticleManager getArticleManager() {
|
||||
return articleManager;
|
||||
}
|
||||
|
||||
public void setArticleManager(IArticleManager articleManager) {
|
||||
this.articleManager = articleManager;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user