1 2 3 Previous Next 34 Replies Latest reply on Mar 17, 2011 1:29 PM by rshan.bob.shanahan.alascorp.com Go to original post
      • 30. Re: Large file download

        I have tried to implement Stuart's downloadfilter solution. It works quite well, I can now download large files. However there are some sideeffects: textfields doesn't handle danish national characters correctly.

        It looks like

        @Filter(around = {"org.jboss.seam.web.ajax4jsfFilter" })

        make some interference with UTF-8 encoding of the request, even though the filter just pass the reguest unaltered further down in the filter chain. Does anyone have an idea why ?

        • 31. Re: Large file download

          An update on this filterbehaviour:
          It seems that it is accessing the request parameter in the filter that causes the encoding sideeffect. I have started a new thread on the topic:

          • 32. Re: Large file download

            Hi all,

            I don't know if it can be useful but i use this trick to evict Ajax4jsf filter by getting effective ServletResponse from the Ajax4jsf Servlet Response Wrapper :

            HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
            if (response instanceof HttpServletResponseWrapper) {
                 LOGGER.debug("Response [{}] is an instance of HttpServletResponseWrapper -> get the wrapped response from it.", response);
                 response = (HttpServletResponse) ((HttpServletResponseWrapper) response).getResponse();
                 LOGGER.debug("Response (wrapped) is : [{}].", response);

            And it seems to work fine (tested with richfaces 3.3.1 without Seam), i think this is a simple solution but this solution may not work with future version.

            Hope it helps.

            • 33. Re: Large file download

              Hi all,

              what I did, is:

              HttpServletResponse response = (HttpServletResponse) externalContext.getResponse();
              try {
                   while (true) {
                        response = (HttpServletResponse) PropertyUtils.getProperty(response, "response");
              } catch (NoSuchMethodException e1) {
                   // nothing to do
                   // we are at org.apache.catalina.connector.ResponseFacade

              So far it seams to work, well.



              • 34. Re: Large file download

                The filter works for me, except that I get No active application context error when attempting to retrieve entityManager. I configured web:context-filter but didn't help.

                How can I access the app context?


                1 2 3 Previous Next