You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Rogerio Pereira <ro...@gmail.com> on 2006/07/29 01:17:28 UTC

Advice about StreamingAddResouce changes

Hi guys,

Basically to get StreamingAddResouce working on all ExternalContext
implementations we need change:

WritablePositionedInfo.writePositionedInfo(HttpServletResponse response,
ResponseWriter writer)
StreamablePositionedInfo.writePositionedInfo(HttpServletResponse response,
PrintWriter writer)

to

WritablePositionedInfo.writePositionedInfo(ExternalContext context,
ResponseWriter writer)
StreamablePositionedInfo.writePositionedInfo(ExternalContext context,
PrintWriter writer)

the first scenario only works on ServletContext, but if we want make some
components avaliable on others contexts we need give External context as
parameter since this will contain an Context Response implementation, this
will make StreamingAddResouce more generic instead of something Servlet
centric.

In the most circunstances the only thing called from context response is
encodeURL method, but the correct is
FacesContext.getCurrentInstance().getExternalContext().encodeResourceURL(String
url);

For PortletContexts this will only works on Portlet portals that uses
ServletFilters (Jetspeed, Liferay).

Any comments?

-- 
Yours truly (Atenciosamente),

Rogério