Package javax.servlet.http

Examples of javax.servlet.http.HttpServletResponse.sendError()


            final JSONObject tagArticleResult = tagArticleRepository.getByTagId(tagId, 1, outputCnt);
            final JSONArray tagArticleRelations = tagArticleResult.getJSONArray(Keys.RESULTS);

            if (0 == tagArticleRelations.length()) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }

            final List<JSONObject> articles = new ArrayList<JSONObject>();
View Full Code Here


            LoginProcessor.tryLogInWithCookie(httpServletRequest, httpServletResponse);

            final GeneralUser currentUser = userService.getCurrentUser(httpServletRequest);
            if (null == currentUser) {
                LOGGER.warning("The request has been forbidden");
                httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);

                return;
            }

            final String currentUserEmail = currentUser.getEmail();
View Full Code Here

                return;
            }

            LOGGER.warning("The request has been forbidden");
            httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
        } catch (final Exception e) {
            httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND);
        }
    }
View Full Code Here

            }

            LOGGER.warning("The request has been forbidden");
            httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
        } catch (final Exception e) {
            httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND);
        }
    }

    @Override
    public void destroy() {
View Full Code Here

                return;
            }
        } catch (final RepositoryException e) {
            LOGGER.log(Level.SEVERE, "Processes article permalink filter failed", e);
            httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND);

            return;
        }

        // If requests an article and the article need view passowrd, sends redirect to the password form
View Full Code Here

            try {
                httpServletResponse.sendRedirect(Latkes.getServePath()
                                                 + "/console/article-pwd" + articles.buildArticleViewPwdFormParameters(article));
                return;
            } catch (final Exception e) {
                httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }
        }

        dispatchToArticleOrPageProcessor(request, response, article, page);
View Full Code Here

                    try {
                        httpServletResponse.sendRedirect(Latkes.getServePath()
                                                         + "/console/article-pwd" + articles.buildArticleViewPwdFormParameters(article));
                        return;
                    } catch (final Exception e) {
                        httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND);
                        return;
                    }
                }
            }
        } catch (final Exception e) {
View Full Code Here

            final JSONObject currentUser = userQueryService.getCurrentUser(httpServletRequest);

            if (null == currentUser) {
                LOGGER.warn("The request has been forbidden");
                httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);

                return;
            }

            final String userRole = currentUser.optString(User.USER_ROLE);
View Full Code Here

            final String userRole = currentUser.optString(User.USER_ROLE);

            if (Role.VISITOR_ROLE.equals(userRole)) {
                LOGGER.warn("The request [Visitor] has been forbidden");
                httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);

                return;
            }

            chain.doFilter(request, response);
View Full Code Here

            chain.doFilter(request, response);
        } catch (final IOException e) {
            LOGGER.log(Level.ERROR, "Auth filter failed", e);

            httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND);
        }
    }

    @Override
    public void destroy() {}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.