]> WPIA git - gigi.git/blob - src/org/cacert/gigi/pages/PolicyRedir.java
e4e065cafab387575c07c8c68521420adb4062ca
[gigi.git] / src / org / cacert / gigi / pages / PolicyRedir.java
1 package org.cacert.gigi.pages;
2
3 import java.io.IOException;
4
5 import javax.servlet.http.HttpServletRequest;
6 import javax.servlet.http.HttpServletResponse;
7
8 public class PolicyRedir extends Page {
9         public PolicyRedir() {
10                 super("Policy");
11         }
12
13         public static final String PATH = "/policy/*";
14         @Override
15         public boolean beforeTemplate(HttpServletRequest req,
16                         HttpServletResponse resp) throws IOException {
17                 String substring = req.getPathInfo().substring(PATH.length() - 1);
18                 resp.sendRedirect("/static/policy/"
19                                 + substring.replace(".php", ".html"));
20                 return true;
21         }
22         @Override
23         public boolean needsLogin() {
24                 return false;
25         }
26         @Override
27         public void doGet(HttpServletRequest req, HttpServletResponse resp)
28                         throws IOException {
29
30         }
31
32 }