Package org.springframework.web.servlet.support

Examples of org.springframework.web.servlet.support.RequestContext


    public int doStartTag() throws JspException {

        try {
            this.requestContext =
                    new RequestContext((HttpServletRequest) this.pageContext.getRequest());
        } catch (RuntimeException ex) {
            throw ex;
        } catch (Exception ex) {
            pageContext.getServletContext().log("Exception in custom tag", ex);
        }
View Full Code Here


    }

    public Errors getValidationErrors(HttpServletRequest request, HttpServletResponse response, Object handler, Map model) {
        String commandName = this.resolveCommandName(handler);
        if (commandName != null) {
            RequestContext requestContext = new RequestContext(request, model);
            return requestContext.getErrors(commandName);
        } else {
            logger.warn("No command name found for handler : " + handler);
            return null;
        }
    }
View Full Code Here

     * Use the application context itself for default message resolution.
     */
    private MessageSource getMessageSource() {
        try {
            this.requestContext =
                new RequestContext((HttpServletRequest) this.pageContext.getRequest());
        }
        catch (RuntimeException ex) {
            throw ex;
        }
        catch (Exception ex) {
View Full Code Here

        final IContext context = processingContext.getContext();
        if (!canApply || !(context instanceof IWebContext)) {
            return action;
        }

        final RequestContext requestContext =
                (RequestContext) context.getVariables().get(SpringContextVariableNames.SPRING_REQUEST_CONTEXT);
        if (requestContext == null) {
            return action;
        }
View Full Code Here

        final IContext context = processingContext.getContext();
        if (!canApply || !(context instanceof IWebContext)) {
            return value;
        }

        final RequestContext requestContext =
                (RequestContext) context.getVariables().get(SpringContextVariableNames.SPRING_REQUEST_CONTEXT);
        if (requestContext == null) {
            return value;
        }
View Full Code Here

        final IContext context = processingContext.getContext();
        if (!canApply || !(context instanceof IWebContext)) {
            return null;
        }

        final RequestContext requestContext =
                (RequestContext) context.getVariables().get(SpringContextVariableNames.SPRING_REQUEST_CONTEXT);
        if (requestContext == null) {
            return null;
        }
View Full Code Here

        final IContext context = processingContext.getContext();
        if (!canApply || !(context instanceof IWebContext)) {
            return url;
        }

        final RequestContext requestContext =
                (RequestContext) context.getVariables().get(SpringContextVariableNames.SPRING_REQUEST_CONTEXT);
        if (requestContext == null) {
            return url;
        }
View Full Code Here

        final Errors errors = bindStatus.getErrors();
        if (errors == null) {
            return Collections.EMPTY_LIST;
        }

        final RequestContext requestContext =
                (RequestContext) processingContext.getContext().getVariables().get(SpringContextVariableNames.SPRING_REQUEST_CONTEXT);
        if (requestContext == null) {
            return Collections.EMPTY_LIST;
        }

        final List<DetailedError> errorObjects = new ArrayList<DetailedError>(errors.getErrorCount() + 2);


        if (includeGlobalErrors) {
            final List<ObjectError> globalErrors = errors.getGlobalErrors();
            for (final ObjectError globalError : globalErrors) {
                final String message = requestContext.getMessage(globalError, false);
                final DetailedError errorObject =
                        new DetailedError(globalError.getCode(), globalError.getArguments(), message);
                errorObjects.add(errorObject);
            }
        }

        if (includeFieldErrors) {
            final List<FieldError> fieldErrors = errors.getFieldErrors();
            for (final FieldError fieldError : fieldErrors) {
                final String message = requestContext.getMessage(fieldError, false);
                final DetailedError errorObject =
                        new DetailedError(fieldError.getField(), fieldError.getCode(), fieldError.getArguments(), message);
                errorObjects.add(errorObject);
            }
        }
View Full Code Here

         * this method performs no preprocessing on the expression!
         */

        // This method will return null if no binding is found and optional == true

        final RequestContext requestContext =
                (RequestContext) processingContext.getContext().getVariables().get(SpringContextVariableNames.SPRING_REQUEST_CONTEXT);
        if (requestContext == null) {
            return null;
        }

View Full Code Here

            mergedModel.putAll(model);
        }

        final ApplicationContext applicationContext = getApplicationContext();

        final RequestContext requestContext =
                new RequestContext(request, response, getServletContext(), mergedModel);
       
        // For compatibility with ThymeleafView
        addRequestContextAsVariable(mergedModel, SpringContextVariableNames.SPRING_REQUEST_CONTEXT, requestContext);
        // For compatibility with AbstractTemplateView
        addRequestContextAsVariable(mergedModel, AbstractTemplateView.SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE, requestContext);
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.support.RequestContext

Copyright © 2018 www.massapicom. 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.