| | |
| | | private static final Logger logger = Logger.getLogger(ViewServlet.class.getName());
|
| | | //private static final String HOME_CTX = "/home";
|
| | |
|
| | | /**
|
| | | * Handles the HTTP <code>GET</code> method.
|
| | | *
|
| | | * @param request servlet request
|
| | | * @param response servlet response
|
| | | * @throws ServletException if a servlet-specific error occurs
|
| | | * @throws IOException if an I/O error occurs
|
| | | */
|
| | | @Override
|
| | | protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
| | | throws ServletException, IOException {
|
| | | String contextPath = request.getContextPath();
|
| | | if(HOME_CTX.equals(contextPath)) {
|
| | | String userName = getUserName(request);
|
| | | if (userName != null) {
|
| | | String urlUser = getUrlUser(request, userName);
|
| | | if(userName.equals(urlUser)) {
|
| | | seiteAusgeben(request, response);
|
| | | } else {
|
| | | logger.fine("Wrong user.");
|
| | | }
|
| | | } else {
|
| | | logger.fine("Missing login.");
|
| | | }
|
| | | } else {
|
| | | seiteAusgeben(request, response);
|
| | | }
|
| | | }
|
| | | |
| | | private void seiteAusgeben(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
|
| | | protected void seiteAusgeben(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
|
| | | ServletOutputStream out = response.getOutputStream();
|
| | | printHeader(out);
|
| | | super.doGet(request, response);
|