This is a known issue already logged in Jira, (MYFACES-123). Matthias, Manfred, and myself have been trying to figure out the best way to fix it.
Actually, I like your solution. I'll look at it further. Thanks for the input. Stan Silvert JBoss, Inc. [EMAIL PROTECTED] callto://stansilvert > -----Original Message----- > From: B�hringer Jochen [mailto:[EMAIL PROTECTED] > Sent: Monday, March 14, 2005 6:24 AM > To: [email protected] > Subject: Problem with portlet integration (ClassCastException) > > Hi, > > I tried to run my JSF Application as a portlet (using the latest myfaces > version built directly from CVS yesterday). But I got a ClassCastException > in UIComponentTag.setupResponseWriter() > > In this line: ServletRequest request = > (ServletRequest)facesContext.getExternalContext().getRequest(); > > Because getRequest does not return a ServletRequest in a portlet > environment. The request variable is used in the next line to determine > the contentType and characterEncoding for the response writer. > > So I deleted the line above and determined the characterEncoding and > contentType using the pageContext instance variable. > > _writer = renderKit.createResponseWriter(new > _PageContextOutWriter(pageContext), > pageContext.getRequest().getContentType(), > pageContext.getRequest().getCharacterEncoding()); > > > Now it works. But this was the first time I looked into the myfaces > sources. So I'm not sure if this might have any side effects. > > Should I open a bug on this? > > Thx > Jochen
