Package org.springframework.web.servlet.support

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


    Map model = new HashMap();
    model.put(BindingResult.MODEL_KEY_PREFIX + COMMAND_NAME, errors);

    // replace the request context with one containing the errors
    MockPageContext pageContext = getPageContext();
    RequestContext context = new RequestContext((HttpServletRequest) pageContext.getRequest(), model);
    pageContext.setAttribute(RequestContextAwareTag.REQUEST_CONTEXT_PAGE_ATTRIBUTE, context);
  }
View Full Code Here


   * @see net.sf.jasperreports.engine.JRParameter#REPORT_LOCALE
   * @see net.sf.jasperreports.engine.JRParameter#REPORT_RESOURCE_BUNDLE
   * @see org.springframework.web.servlet.support.JstlUtils#exposeLocalizationContext
   */
  protected void exposeLocalizationContext(Map<String, Object> model, HttpServletRequest request) {
    RequestContext rc = new RequestContext(request, getServletContext());
    model.put(JRParameter.REPORT_LOCALE, rc.getLocale());
    JasperReport report = getReport();
    if (report == null || report.getResourceBundle() == null) {
      model.put(JRParameter.REPORT_RESOURCE_BUNDLE,
          new MessageSourceResourceBundle(rc.getMessageSource(), rc.getLocale()));
    }
  }
View Full Code Here

      throw new ServletException("Tiles container is not initialized. " +
          "Have you added a TilesConfigurer to your web application context?");
    }

    exposeModelAsRequestAttributes(model, request);
    JstlUtils.exposeLocalizationContext(new RequestContext(request, servletContext));

    if (!response.isCommitted()) {
      // Tiles is going to use a forward, but some web containers (e.g. OC4J 10.1.3)
      // do not properly expose the Servlet 2.4 forward request attributes... However,
      // must not do this on Servlet 2.5 or above, mainly for GlassFish compatibility.
View Full Code Here

   * @see org.springframework.web.servlet.support.RequestContext
   */
  protected RequestContext createRequestContext(
      HttpServletRequest request, HttpServletResponse response, Map<String, Object> model) {

    return new RequestContext(request, response, getServletContext(), model);
  }
View Full Code Here

  protected void exposeHelpers(HttpServletRequest request) throws Exception {
    if (this.messageSource != null) {
      JstlUtils.exposeLocalizationContext(request, this.messageSource);
    }
    else {
      JstlUtils.exposeLocalizationContext(new RequestContext(request, getServletContext()));
    }
  }
View Full Code Here

            "Cannot expose bind macro helper '" + SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE +
            "' because of an existing model object of the same name");
      }
      // Expose RequestContext instance for Spring macros.
      model.put(SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE,
          new RequestContext(request, response, getServletContext(), model));
    }

    applyContentType(response);

    renderMergedTemplateModel(model, request, response);
View Full Code Here

   * @return the RequestContext instance
   * @see #setRequestContextAttribute
   * @see org.springframework.web.servlet.support.RequestContext
   */
  protected RequestContext createRequestContext(HttpServletRequest request, Map model) {
    return new RequestContext(request, getServletContext(), model);
  }
View Full Code Here

   * @see net.sf.jasperreports.engine.JRParameter#REPORT_LOCALE
   * @see net.sf.jasperreports.engine.JRParameter#REPORT_RESOURCE_BUNDLE
   * @see org.springframework.web.servlet.support.JstlUtils#exposeLocalizationContext
   */
  protected void exposeLocalizationContext(Map model, HttpServletRequest request) {
    RequestContext rc = new RequestContext(request, getServletContext());
    model.put(JRParameter.REPORT_LOCALE, rc.getLocale());
    JasperReport report = getReport();
    if (report == null || report.getResourceBundle() == null) {
      model.put(JRParameter.REPORT_RESOURCE_BUNDLE,
          new MessageSourceResourceBundle(rc.getMessageSource(), rc.getLocale()));
    }
  }
View Full Code Here

   * @see net.sf.jasperreports.engine.JRParameter#REPORT_LOCALE
   * @see net.sf.jasperreports.engine.JRParameter#REPORT_RESOURCE_BUNDLE
   * @see org.springframework.web.servlet.support.JstlUtils#exposeLocalizationContext
   */
  protected void exposeLocalizationContext(Map<String, Object> model, HttpServletRequest request) {
    RequestContext rc = new RequestContext(request, getServletContext());
    model.put(JRParameter.REPORT_LOCALE, rc.getLocale());
    JasperReport report = getReport();
    if (report == null || report.getResourceBundle() == null) {
      model.put(JRParameter.REPORT_RESOURCE_BUNDLE,
          new MessageSourceResourceBundle(rc.getMessageSource(), rc.getLocale()));
    }
  }
View Full Code Here

    public int doStartTag() throws JspException {
       
        try {
            this.requestContext =  
                new RequestContext((HttpServletRequest) this.pageContext.getRequest());
        }
        catch (RuntimeException ex) {
            throw ex;
        }
        catch (Exception ex) {
View Full Code Here

TOP

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

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.