Package javax.servlet.http

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


            statisticMgmtService.incBlogViewCount(request, response);
        } catch (final ServiceException e) {
            LOGGER.log(Level.ERROR, e.getMessage(), e);

            try {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            } catch (final IOException ex) {
                LOGGER.error(ex.getMessage());
            }
        } catch (final JSONException e) {
            LOGGER.log(Level.ERROR, e.getMessage(), e);
View Full Code Here


            }
        } catch (final JSONException e) {
            LOGGER.log(Level.ERROR, e.getMessage(), e);

            try {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            } catch (final IOException ex) {
                LOGGER.error(ex.getMessage());
            }
        }
    }
View Full Code Here

        final HttpServletResponse response = context.getResponse();

        final String queryString = request.getQueryString();

        if (Strings.isEmptyOrNull(queryString)) {
            response.sendError(HttpServletResponse.SC_BAD_REQUEST);
            return;
        }

        final String oIdMap = queryString.split("&")[0];
        final String tagId = oIdMap.split("=")[1];
View Full Code Here

        try {
            final JSONObject tag = tagRepository.get(tagId);

            if (null == tag) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }

            final String tagTitle = tag.getString(Tag.TAG_TITLE);
View Full Code Here

            final String tagTitle = tag.getString(Tag.TAG_TITLE);

            final JSONObject preference = preferenceQueryService.getPreference();

            if (null == preference) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }

            final String blogTitle = preference.getString(Preference.BLOG_TITLE);
            final String blogSubtitle = preference.getString(Preference.BLOG_SUBTITLE) + ", " + tagTitle;
View Full Code Here

            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

        try {
            final JSONObject preference = preferenceQueryService.getPreference();

            if (null == preference) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }

            final String blogTitle = preference.getString(Preference.BLOG_TITLE);
            final String blogSubtitle = preference.getString(Preference.BLOG_SUBTITLE);
View Full Code Here

        context.setRenderer(renderer);

        final String queryString = request.getQueryString();

        if (Strings.isEmptyOrNull(queryString)) {
            response.sendError(HttpServletResponse.SC_BAD_REQUEST);
            return;
        }

        final String oIdMap = queryString.split("&")[0];
        final String tagId = oIdMap.split("=")[1];
View Full Code Here

        try {
            final JSONObject tag = tagRepository.get(tagId);

            if (null == tag) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }

            final String tagTitle = tag.getString(Tag.TAG_TITLE);
View Full Code Here

            final String tagTitle = tag.getString(Tag.TAG_TITLE);

            final JSONObject preference = preferenceQueryService.getPreference();

            if (null == preference) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }

            final String blogTitle = preference.getString(Preference.BLOG_TITLE);
            final String blogSubtitle = preference.getString(Preference.BLOG_SUBTITLE) + ", " + tagTitle;
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.