[jboss-user] [JBoss Seam] - Re: Accessing Servlet Response from within Seam component
stan.silvert@jboss.com
do-not-reply at jboss.com
Tue Nov 7 15:56:46 EST 2006
"ngeadah" wrote : Is there any way to access the HttpServletResponse within a Seam component? I ask since I need a component that handles downloading files; this needs to set the mime type, the header and the outpustream. I'd hate to develop a servlet just for this since I'd really like to use injection and the persistence context as part of this component.
|
| Any thoughts?
Avoid using the HttpServletResponse directly if you can. Use the ExternalContext instead. This should do it:
@In (value="#{facesContext.externalContext}")
private ExternalContext extCtx;
.....
.....
.....
extCtx.setResponseCharacterEncoding("encoding");
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983915#3983915
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983915
More information about the jboss-user
mailing list