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 ?
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:
http://seamframework.org/Community/AccessingRequestParameterInSeamFilterChangesEncoding
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.
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.
Cheers,
Dušan
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?
Thanks.