commit | author | age
|
05b5c0
|
1 |
/* |
U |
2 |
WebBox - Dein Server. |
|
3 |
Copyright (C) 2017 Ulrich Hilger, http://uhilger.de |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Affero General Public License as |
|
7 |
published by the Free Software Foundation, either version 3 of the |
|
8 |
License, or (at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU Affero General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU Affero General Public License |
|
16 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
package de.uhilger.wbx.web; |
|
19 |
|
5bfcdd
|
20 |
import java.io.IOException; |
U |
21 |
import javax.servlet.ServletException; |
|
22 |
import javax.servlet.http.HttpServletRequest; |
|
23 |
import javax.servlet.http.HttpServletResponse; |
05b5c0
|
24 |
|
U |
25 |
/** |
|
26 |
* |
|
27 |
* @author ulrich |
|
28 |
*/ |
5bfcdd
|
29 |
public class MarkdownServlet extends WbxServlet { |
U |
30 |
|
|
31 |
|
|
32 |
/** |
|
33 |
* Handles the HTTP <code>GET</code> method. |
|
34 |
* |
|
35 |
* @param request servlet request |
|
36 |
* @param response servlet response |
|
37 |
* @throws ServletException if a servlet-specific error occurs |
|
38 |
* @throws IOException if an I/O error occurs |
|
39 |
*/ |
|
40 |
@Override |
|
41 |
protected void doGet(HttpServletRequest request, HttpServletResponse response) |
|
42 |
throws ServletException, IOException { |
|
43 |
String contextPath = request.getContextPath(); |
|
44 |
if(HOME_CTX.equals(contextPath)) { |
|
45 |
String userName = getUserName(request); |
|
46 |
if (userName != null) { |
|
47 |
String urlUser = getUrlUser(request, userName); |
|
48 |
if(userName.equals(urlUser)) { |
|
49 |
seiteAusgeben(request, response); |
|
50 |
} else { |
|
51 |
logger.fine("Wrong user."); |
|
52 |
} |
|
53 |
} else { |
|
54 |
logger.fine("Missing login."); |
|
55 |
} |
|
56 |
} else { |
|
57 |
seiteAusgeben(request, response); |
|
58 |
} |
|
59 |
} |
|
60 |
|
|
61 |
private void seiteAusgeben(HttpServletRequest request, HttpServletResponse response) { |
|
62 |
|
|
63 |
} |
05b5c0
|
64 |
|
U |
65 |
} |