You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by QiuyunZhong <qi...@hotmail.com> on 2006/07/27 17:28:39 UTC

which class does externalcontext.getResponse() return

Hey,guys.A couple of days before, we move our myfaces to
1.1.4-snapshot.Anything works fine except our pahselistener which extends
PhashListener.Does it return different type object in different phase or
just the same type object or anything more complicated then that.
In fact ,It throws classcastexception when i cast the respone to
org.apache.myfaces.webapp.util.ExtensionsResponseWrapper,in myfaces-1.1,it
works fine.Then i cast the response to
org.apache.myfaces.webapp.filter.ExtensionsResponseWrapper,it seems
ok.However,sometimes it will still throw classcastexception.Then i traces on
it,I found it returns org.apache.catalina.connector.ResponseFacade in every
phase.Things likes so tricky that i'm already confuzed.
If there is any one encounter that problem when update myfaces from 1.1 to
1.1.4?
Any advice will be welcome.
Thanks:)
-- 
View this message in context: http://www.nabble.com/which-class-does-externalcontext.getResponse%28%29-return-tf2010296.html#a5523351
Sent from the MyFaces - Users forum at Nabble.com.


Re: which class does externalcontext.getResponse() return

Posted by QiuyunZhong <qi...@hotmail.com>.
 Matthias ,Thank you for your reply.
 yes, myfaces 1.1.4 is much stable.And we didn't face any more question
except some warning and this classcastexception.
Our server container is jboss4.0,and i traced the returned response,it's
instance of ResponseFacade.If we convert the response to
org.apache.myfaces.webapp.filter.ExtensionsResponseWrapper ,it throws a
classcastexception:

00:04:27,468 ERROR [PhaseListenerManager] Exception in PhaseListener
RENDER_RESPONSE(6) afterPhase
java.lang.ClassCastException
	at
base.presentation.common.ShowPhaseListener.afterPhase(ShowPhaseListener.java:56)
	at
org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
	at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:150)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:181)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
	at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
	at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
	at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
	at java.lang.Thread.run(Thread.java:534)
I think the wrapper should wrap the responsefacade,right?
Or will there any problem with my myfaces 1.1.4 version?
Thank you in advance!Any one knows anything,feel free to discuss,it is my
urgent issue.Thank you again.
-- 
View this message in context: http://www.nabble.com/which-class-does-externalcontext.getResponse%28%29-return-tf2010296.html#a5555794
Sent from the MyFaces - Users forum at Nabble.com.


Re: which class does externalcontext.getResponse() return

Posted by Matthias Wessendorf <ma...@apache.org>.
extCtx.getResponse() returns the "underlaying" response clazz. in
tomcat that is the ResponseFacade. However,
org.apache.myfaces.webapp.filter.ExtensionsResponseWrapper is the
clazz you should go with.

Since the 1.1.4 snapshot is much more stable as you 1.1.3 release
there are not that much issue... expect, we changed the handling of
<commandLinks>

the will be no (by default) dummy form. so simply wrapp the
commandLinks and sortable tables (for instane) in a <form>.

See also
http://wiki.apache.org/myfaces/Upgrading_to_Tomahawk_1.1.3

On 7/27/06, QiuyunZhong <qi...@hotmail.com> wrote:
>
> Hey,guys.A couple of days before, we move our myfaces to
> 1.1.4-snapshot.Anything works fine except our pahselistener which extends
> PhashListener.Does it return different type object in different phase or
> just the same type object or anything more complicated then that.
> In fact ,It throws classcastexception when i cast the respone to
> org.apache.myfaces.webapp.util.ExtensionsResponseWrapper,in myfaces-1.1,it
> works fine.Then i cast the response to
> org.apache.myfaces.webapp.filter.ExtensionsResponseWrapper,it seems
> ok.However,sometimes it will still throw classcastexception.Then i traces on
> it,I found it returns org.apache.catalina.connector.ResponseFacade in every
> phase.Things likes so tricky that i'm already confuzed.
> If there is any one encounter that problem when update myfaces from 1.1 to
> 1.1.4?
> Any advice will be welcome.
> Thanks:)
> --
> View this message in context: http://www.nabble.com/which-class-does-externalcontext.getResponse%28%29-return-tf2010296.html#a5523351
> Sent from the MyFaces - Users forum at Nabble.com.
>
>


-- 
Matthias Wessendorf

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com