diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/listArticle.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/listArticle.jsp
index 42964a0..383ba64 100644
--- a/YACOSWeb/WebContent/WEB-INF/jsp/listArticle.jsp
+++ b/YACOSWeb/WebContent/WEB-INF/jsp/listArticle.jsp
@@ -1,39 +1,33 @@
-<%@ include file="/WEB-INF/jsp/include.jsp"%>
-<%@ page session="false" %>
-
-
-
-
-
-Soumission OK
-
-
- File uploaded succesfully.
-
- ${file}
-
-
+Soumission OK
+
">Home
diff --git a/YACOSWeb/WebContent/stylesheets/base.css b/YACOSWeb/WebContent/stylesheets/base.css
index 35b3c73..5a0eeab 100644
--- a/YACOSWeb/WebContent/stylesheets/base.css
+++ b/YACOSWeb/WebContent/stylesheets/base.css
@@ -115,14 +115,22 @@ body {
display: table-cell;
width: 640px;
}
+
+.article a {
+ text-decoration: none;
+ color: #002bb8;
+ background: none;
+}
+.article a:hover {
+ text-decoration: underline;
+}
ul.article {
- border-bottom : thin solid #666;
- width: 100%;
+ border-bottom : thin solid #666;
+ padding-bottom: 5px;
}
ul.article li {
- width: 100%;
list-style: none;
}
@@ -132,8 +140,12 @@ ul.article .title {
ul.article .author {
font-size: small;
+}
+
+ul.article .topic {
+ font-size: small;
}
ul.article .article_url {
- font-size: smaller;
+ font-size: small;
}
\ No newline at end of file
diff --git a/YACOSWeb/src/org/yacos/web/author/controller/SArticleController.java b/YACOSWeb/src/org/yacos/web/author/controller/SArticleController.java
index 5f26594..9e1e978 100644
--- a/YACOSWeb/src/org/yacos/web/author/controller/SArticleController.java
+++ b/YACOSWeb/src/org/yacos/web/author/controller/SArticleController.java
@@ -1,14 +1,18 @@
package org.yacos.web.author.controller;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.net.URL;
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 org.springframework.validation.BindException;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;
@@ -22,37 +26,46 @@ public class SArticleController extends SimpleFormController {
/** Logger for this class and subclasses */
protected final Log logger = LogFactory.getLog(getClass());
- private IArticleManager articleManager;
+ private IArticleManager articleManager;
- public ModelAndView onSubmit(Object command)
- throws ServletException, IllegalStateException, IOException {
+ public ModelAndView onSubmit(HttpServletRequest request,
+ HttpServletResponse response, Object command, BindException errors)
+ throws ServletException, IllegalStateException {
String title = ((FormSubmission) command).getTitle();
String theme = ((FormSubmission) command).getTheme();
String mainauthor = ((FormSubmission) command).getMainauthor();
String secondaryauthor = ((FormSubmission) command).getSecondaryauthor();
- //String file = ((FormSubmission) command).getFile();
-
String liste = ((FormSubmission) command).getListe();
-
- System.out.println(liste);
-
- // let's see if there's content there
- MultipartFile file = ((FormSubmission) command).getFile();
- if (file == null) {
- // hmm, that's strange, the user did not upload anything
- }
-
- byte b[] = file.getBytes();
- File file2 = new File(file.getOriginalFilename());
-
- FileOutputStream fos = new FileOutputStream(file2);
-
- fos.write(b);
- fos.close();
-
- Article a = new Article(0, title, theme, "", mainauthor, null, 1);
+ String nomFile="";
+
+ try {
+ MultipartFile file = ((FormSubmission) command).getFile();
+ if (file == null) {
+
+ }
+ else {
+
+ byte b[] = file.getBytes();
+ File file2 = new File(file.getOriginalFilename());
+
+ FileOutputStream fos = new FileOutputStream(file2);
+
+ URL testURL = file2.toURL();
+ nomFile = testURL.toString();
+
+ fos.write(b);
+ fos.close();
+ }
+ }
+ catch (FileNotFoundException e) {
+ System.out.println(e);
+ } catch (IOException e) {
+ System.out.println(e);
+ }
+
+ Article a = new Article(0, title, theme, nomFile, mainauthor, null, 1);
articleManager.addArticle(a);
return new ModelAndView(new RedirectView(getSuccessView()));