[jboss-user] [JBoss Seam] - Page events produce 'No active event context' exception
evanzeng
do-not-reply at jboss.com
Thu Aug 17 06:45:23 EDT 2006
I want to use the following 'index.html' and 'pages.xml' to redirect to a page 'home.xhtml' which again redirect to a customized homepage.
index.html:
| <html>
| <head>
| <meta http-equiv="Refresh" content="0; URL=default.jsf">
| </head>
| </html>
|
pages.xml:
| <pages>
| <page view-id="/default.xhtml" action="#{homepage.redirect}" />
| </pages>
|
home.xhtml:
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <html xmlns="http://www.w3.org/1999/xhtml">
| <head>
| <meta http-equiv="Refresh" content="0; URL=#{homepage.homepage}" />
| </head>
| </html>
|
The 'homepage' component is defined like the following:
| @Name("homepage")
| @Stateful
| public class HomepageBean implements Homepage {
|
| private String homepage;
|
| @In
| private GlobalSettings globalSettings;
|
| public String redirect() {
| HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance()
| .getExternalContext().getRequest();
|
| if (request.getRemoteUser() == null) {
| homepage = globalSettings.getSiteHomepage();
| return "homepage";
| }
|
| ......
|
| }
|
| public String getHomepage() {
| return homepage;
| }
|
| }
|
And in my faces-config.xml there is a navigation rule:
| <navigation-case>
| <from-outcome>homepage</from-outcome>
| <to-view-id>/home.xhtml</to-view-id>
| <redirect />
| </navigation-case>
|
Everything works fine but the Concole produes the following exception:
| 17:54:54,071 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) afterPhase
| java.lang.IllegalStateException: No active event context
| at org.jboss.seam.core.Manager.instance(Manager.java:320)
| at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:97)
| 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:138)
| 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:144)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at com.eesys.eworks.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at com.eesys.eworks.filter.ActionFilter.doFilter(ActionFilter.java:91)
| 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:96)
| 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.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| 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:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| 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:595)
|
Who kindly can tell me why ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965692#3965692
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965692
More information about the jboss-user
mailing list