[jboss-user] [JBoss Seam] - Re: Accessing Servlet Response from within Seam component

stan.silvert@jboss.com do-not-reply at jboss.com
Fri Nov 10 11:29:11 EST 2006


"ngeadah" wrote : Is that not a JSF 1.2 method?  I certainly don't see that method in javax.faces.context.ExternalContext...
  | 
  | http://myfaces.apache.org/api/apidocs/index.html
  | 
  | Any other thoughts?

Sorry.  Yes, I was looking at the 1.2 javadoc.  So for JSF 1.1 you would need to use the HttpServletResponse directly.  My answer to your original question still applies.  But the code looks like this instead:

@In (value="#{facesContext.externalContext}")
  | private ExternalContext extCtx;
  | .....
  | .....
  | .....
  | HttpServletResponse response = (HttpServletResponse)extCtx.getResponse();
  | response.setChcaracterEncoding("myencoding");


The main problem with this code is that it will break in a portlet environment.

Stan

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984971#3984971

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984971



More information about the jboss-user mailing list