add a title specifc to each category
authorJean-Philippe Orsini <orsinije@fr.ibm.com>
Wed, 18 Oct 2017 22:04:54 +0000 (00:04 +0200)
committerJean-Philippe Orsini <orsinije@fr.ibm.com>
Wed, 18 Oct 2017 22:04:54 +0000 (00:04 +0200)
war/src/main/java/pnews/Category.java
war/src/main/java/pnews/servlet/HTML.java

index 2d50c06..6d1978a 100644 (file)
@@ -1,23 +1,29 @@
 package pnews;
 
 public enum Category {
-        TOP("top"),
-        FRANCE("france"),
-        SPORT("sport"),
-        EUROPE("europe"),
-        MONDE("monde"),
-        ECO("eco"),
-        ESSONNE("essonne"),
-        TECHNOLOGIE("technologie"),
-        PEOPLE("people");
+        TOP("top", "Les actualités à la une"),
+        FRANCE("france", "France"),
+        SPORT("sport", "Sport"),
+        EUROPE("europe", "Europe"),
+        MONDE("monde", "Monde"),
+        ECO("eco", "Economie"),
+        ESSONNE("essonne", "Essone"),
+        TECHNOLOGIE("technologie", "Technologie"),
+        PEOPLE("people", "People");
         
         private final String id;
+        private final String title;
                 
-        private Category(String id) {
+        private Category(String id, String title) {
                 this.id = id;
+                this.title = title;
         }
         
         public String getId() {
                 return id;
         }
+        
+        public String getTitle() {
+                return title;
+        }
 }
index b78d29b..7b7b142 100644 (file)
@@ -103,7 +103,9 @@ public class HTML {
                buf.append("<head>\n");
                buf.append("<meta charset=\"UTF-8\">\n");
                buf.append("<link rel='stylesheet' href='style.css' />\n");
-               buf.append("<title>PNews</title>\n");
+               buf.append("<title>");
+               buf.append(catActive.getTitle());
+               buf.append(" - PNews</title>\n");
                buf.append("</head>\n");
                buf.append("<body>\n");