Uploaded image for project: 'Stripes'
  1. STS-913

Weblogic-hack doesn't use the chosen encoding

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Release 1.5.7
    • Fix Version/s: None
    • Component/s: Tag Library
    • Labels:
    • Environment:
      Windows 7 Pro
      Weblogic 10.3.6.0
      Tested from Eclipse Kepler

      Description

      I have chosen the iso-8859-1 encoding in my web.xml:

      <init-param>
        <param-name>LocalePicker.Locales</param-name>
        <param-value>en:iso-8859-1</param-value>
      </init-param>
      

      I would expect this to apply throughout the whole system (or at least the Stripes-part of it) but the Weblogic-hack added in 1.5.7 (due to STS-823 Resolved and STS-834 Resolved ) always defaults to UTF8.

      This is probably because the StripesFilter only applies to the REQUEST dispatcher type but the Weblogic-hack is only used in INCLUDE's. This code-snippet was found in net.sourceforge.stripes.tag.layout.LayoutContext:

      final HttpServletResponse response = new HttpServletResponseWrapper(
                      (HttpServletResponse) pageContext.getResponse()) {
                  @Override
                  public String getCharacterEncoding() {
                      return os.getCharset();
                  }
      
                  @Override
                  public void setCharacterEncoding(String charset) {
                      os.setCharset(charset);
                  }
      
                  @Override
                  public ServletOutputStream getOutputStream() throws IOException {
                      return os;
                  }
      
                  @Override
                  public PrintWriter getWriter() throws IOException {
                      return writer;
                  }
              };
      
              pageContext.getRequest().getRequestDispatcher(relativeUrlPath)
                      .include(pageContext.getRequest(), response);
      

      setCharacterEncoding is invoked on the ServletResponse in the StripesFilter, but since the filter is only used one time per request it makes no difference.

      The Stripes.war contains a simple application where bug can be reproduced. Beware that it's the same war-file as STS-912 Open so don't push the button or you will get stucked

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              skovenborg skovenborg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: