Hi,
I'm trying to get Trinidad running, so I used trinidad-blank and adapted
the web.xml and faces-config.xml a little bit as well as the directory
hierarchy.
When I do not put
<default-render-kit-id>
org.apache.myfaces.trinidad.core
</default-render-kit-id>
into the faces-config.xml, the backing-bean is being accessed, but the
Trinidad rendering context cannot be found (which is exactly what one
would expect in this case). When I put these lines into my
faces-config.xml I get an interesting side-effect. My log files say
about it (I'm using Glassfish):
<<<<< snip >>>>>
[#|2007-09-18T10:39:54.406+0200|WARNING|sun-appserver9.1|org.apache.myfaces.trinidad.context.RenderingContext|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=e8b8cae1-1aae-4bd6-ab5c-fc298c8cffd7;|Trying
to attach RenderingContext to a thread that already had one.|#]
[#|2007-09-18T10:39:54.406+0200|WARNING|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.renderkit|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=e8b8cae1-1aae-4bd6-ab5c-fc298c8cffd7;|Unable
to find component with ID login in view.|#]
[#|2007-09-18T10:39:54.421+0200|WARNING|sun-appserver9.1|org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderKit|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=e8b8cae1-1aae-4bd6-ab5c-fc298c8cffd7;|No
RenderingContext available|#]
<<<<< snap >>>>>
What happens is that the JSF navigation rules do not work any more with
that. I guess it is because the pages are kind of doubly-rendered. If I
enter the URL directly into my browser, the Trinidad-components are
being displayed.
Looking for this error ("Trying to attach RenderingContext to a thread
that already had one.") I have found some issues when these messages
were caused by bugs
(http://www.mail-archive.com/[EMAIL PROTECTED]/msg02096.html)
and legacy libraries
(http://www.nabble.com/-Trinidad--RenderingContext-Error-when-STATE_SAVING_METHODis-%22client%22-t3920348.html),
but nothing which helps my issue.
If anybody has any idea how to get rid of this problem, please let me
know. I attached my web.xml and my faces-config.xml here because my
guess is that there is somewhere an error in these files. I am using the
following libraries:
commons-beanutils-1.6.1.jar
commons-codec-1.2.jar
commons-collections-3.0.jar
commons-digester-1.5.jar
commons-el.jar
commons-fileupload-1.0.jar
commons-lang-2.1.jar
commons-logging.jar
jstl.jar
myfaces-api.jar
myfaces-impl.jar
sandbox.jar
tomahawk.jar
trinidad-api-1.2.2.jar
trinidad-impl-1.2.2.jar
Please write any mail on this to my personal email address as well as to
the list, since I did not get any subscription confirmation yet.
Regards,
Björn
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd" >
<faces-config>
<application>
<!-- Use the Trinidad RenderKit -->
<default-render-kit-id>
org.apache.myfaces.trinidad.core
</default-render-kit-id>
</application>
<!-- Login Screen naviation rules -->
<navigation-rule>
<description>Das Login</description>
<from-view-id>/pages/login.jsp</from-view-id>
<navigation-case>
<from-outcome>internal</from-outcome>
<to-view-id>/pages/internal/offers.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>external</from-outcome>
<to-view-id>/pages/external/offers.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>failure</from-outcome>
<to-view-id>/pages/login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<!-- Entries for the navigation bar. -->
<navigation-rule>
<description>
Navigationsregeln für Navigationskomponente.
Geht immer direkt zur Seite.
</description>
<from-view-id>/pages/internal/*</from-view-id>
<navigation-case>
<from-outcome>go_offers_overview</from-outcome>
<to-view-id>/pages/internal/offers.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>go_portfolio_config</from-outcome>
<to-view-id>/pages/internal/portfolio.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>
Navigationsregeln für Navigationskomponente.
Geht immer direkt zur Seite.
</description>
<from-view-id>/pages/external/*</from-view-id>
<navigation-case>
<from-outcome>go_offers_overview</from-outcome>
<to-view-id>/pages/external/offers.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>go_devices_overview</from-outcome>
<to-view-id>/pages/external/devices.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<!-- Global preferences object that proxies to others -->
<managed-bean>
<managed-bean-name>helloWorldBacking</managed-bean-name>
<managed-bean-class>
org.apache.myfaces.trinidad.blank.HelloWorldBacking
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<!-- Handler -->
<managed-bean>
<managed-bean-name>offersHandler</managed-bean-name>
<managed-bean-class>
de.ist.essft.handler.OffersHandler
</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>loginHandler</managed-bean-name>
<managed-bean-class>
de.ist.essft.handler.LoginHandler
</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>deviceHandler</managed-bean-name>
<managed-bean-class>
de.ist.essft.handler.DeviceHandler
</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>portfolioProcessHandler</managed-bean-name>
<managed-bean-class>
de.ist.essft.handler.PortfolioProcessHandler
</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<!-- navigation rules for index.jspx -->
<navigation-rule>
<from-view-id>/page1.jspx</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/page2.jspx</to-view-id>
</navigation-case>
</navigation-rule>
<!-- navigation rules for page2.jspx -->
<navigation-rule>
<from-view-id>/page2.jspx</from-view-id>
<navigation-case>
<from-outcome>back</from-outcome>
<to-view-id>/page1.jspx</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config><?xml version="1.0"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<listener>
<listener-class>
org.apache.myfaces.webapp.StartupServletContextListener
</listener-class>
</listener>
<filter>
<filter-name>trinidad</filter-name>
<filter-class>
org.apache.myfaces.trinidad.webapp.TrinidadFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>trinidad</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<filter>
<filter-name>MyFacesExtensionsFilter</filter-name>
<filter-class>
org.apache.myfaces.component.html.util.ExtensionsFilter
</filter-class>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>1m</param-value>
</init-param>
</filter>
<!-- Commented out Myfaces Filtering to make trinidad work -->
<!-- <filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
</filter-mapping>
-->
<!-- Faces Servlet Mappings -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!--
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
-->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
</web-app>