Mercurial Hosting > nabble
comparison src/nabble/view/web/Index.jtp @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7ecd1a4ef557 |
---|---|
1 <% | |
2 package nabble.view.web; | |
3 | |
4 import fschmidt.util.servlet.CanonicalUrl; | |
5 import fschmidt.util.servlet.JtpContext; | |
6 import nabble.model.Node; | |
7 import nabble.model.Site; | |
8 import nabble.model.UpdatingException; | |
9 import nabble.view.lib.Cache; | |
10 import nabble.view.lib.Jtp; | |
11 import nabble.view.lib.Permissions; | |
12 import nabble.view.lib.Shared; | |
13 import nabble.view.lib.UrlMappable; | |
14 import nabble.view.lib.help.Help; | |
15 import org.slf4j.Logger; | |
16 import org.slf4j.LoggerFactory; | |
17 | |
18 import javax.servlet.ServletException; | |
19 import javax.servlet.http.HttpServlet; | |
20 import javax.servlet.http.HttpServletRequest; | |
21 import javax.servlet.http.HttpServletResponse; | |
22 import java.io.IOException; | |
23 import java.io.PrintWriter; | |
24 import java.io.StringWriter; | |
25 import java.util.Calendar; | |
26 import java.util.Collections; | |
27 import java.util.Map; | |
28 import java.util.regex.Pattern; | |
29 | |
30 | |
31 public final class Index extends HttpServlet implements UrlMappable, CanonicalUrl { | |
32 | |
33 private static final Logger logger = LoggerFactory.getLogger(Index.class); | |
34 | |
35 private static final Pattern URL_PATTERN = Pattern.compile( "://[^/]+/$"); | |
36 | |
37 public static String url() { | |
38 return Jtp.homeContextUrl() + path(); | |
39 } | |
40 | |
41 public static String path() { | |
42 return "/"; | |
43 } | |
44 | |
45 public String getCanonicalUrl(HttpServletRequest request) { | |
46 return url(); | |
47 } | |
48 | |
49 public Map<String,String[]> getParameterMapFromUrl(HttpServletRequest request,String mappedUrl) { | |
50 return Collections.emptyMap(); | |
51 } | |
52 | |
53 public Pattern getUrlPattern() { | |
54 return URL_PATTERN; | |
55 } | |
56 | |
57 protected void service(HttpServletRequest request,HttpServletResponse response) | |
58 throws ServletException, IOException | |
59 { | |
60 PrintWriter out = response.getWriter(); | |
61 %> | |
62 please set homeContextUrl | |
63 <% | |
64 } | |
65 | |
66 } | |
67 %> |