]> WPIA git - gigi.git/blob - src/org/cacert/gigi/pages/MainPage.java
0cccbfb535ec223c452f0b132f0ad55a6d8d95ed
[gigi.git] / src / org / cacert / gigi / pages / MainPage.java
1 package org.cacert.gigi.pages;
2
3 import java.io.IOException;
4 import java.util.HashMap;
5
6 import javax.servlet.http.HttpServletRequest;
7 import javax.servlet.http.HttpServletResponse;
8
9 import org.cacert.gigi.output.template.Template;
10
11 public class MainPage extends Page {
12
13     private static final Template notLog = new Template(MainPage.class.getResource("MainPageNotLogin.templ"));
14
15     public MainPage() {
16         super("Home");
17     }
18
19     @Override
20     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
21         if (LoginPage.getUser(req) != null) {
22             getDefaultTemplate().output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
23         } else {
24             notLog.output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
25         }
26     }
27
28     @Override
29     public boolean needsLogin() {
30         return false;
31     }
32 }