Защита от f5 в java

Подскажите, как в java приложении реализовать защиту от f5? Можно ли это делать не в сервлете, а просто прописывать в jsp странице? Спасибо. Пример через роутер:

~private void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Optional commandOptional = ActionFactory.defineCommand(request.getParameter("command"));

    if (commandOptional.isPresent()) {
        Command command = commandOptional.get();
        logger.log(Level.DEBUG, command);

        Router router = command.execute(request);
        if (router != null) {
            if (router.getType().equals(RouteType.FORWARD)) {
                RequestDispatcher dispatcher = request.getRequestDispatcher(router.getPagePath());
                dispatcher.forward(request, response);
            } else {
                response.sendRedirect(request.getContextPath() + router.getPagePath());
            }
        } else {
            request.getSession().setAttribute("nullPage", "Page not found");
            response.sendRedirect(request.getContextPath() + PathForJsp.ERROR.getPath());//LOGIN
        }
    }~

Ответы (0 шт):