You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Christoph Lassner <Ch...@esg.de> on 2006/08/28 18:22:23 UTC
Tobago and Facelets
Hi everybody!
Combining Tabago with Facelets is an intersting topic I thought and tried
to get it working. However, I still have some problems. The pages are
rendered properly in Tobago style, the tags are working. However, when I
set up navigation rules, they don't work. When I press a tobago button,
only the page will reload. Also tobago elements that require to load data
from the server (like calendar with popup) don't work, because when I click
the button to open it, only the page reloads. I really hope that someone
has got some idea how to fix that, because I'm desperately trying to fix
this.
As you will see, I just tried to use the facelets-example of the tobago
release, which didn't work any better.
My configuration:
Apache Tomcat 5.5
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Copyright 2002-2005 The Apache Software Foundation.
*
* Licensed 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.
-->
<web-app version="2.4" 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">
<display-name>Tobago Facelets Example Application</display-name>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</
listener-class>
</listener>
<listener>
<listener-class>
org.apache.myfaces.tobago.webapp.TobagoServletContextListener</
listener-class>
</listener>
<servlet>
<servlet-name>FacesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>ResourceServlet</servlet-name>
<servlet-class>org.apache.myfaces.tobago.servlet.ResourceServlet</
servlet-class>
</servlet>
<!-- servlet-mapping -->
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ResourceServlet</servlet-name>
<url-pattern>/org/apache/myfaces/tobago/renderkit/*</url-pattern>
</servlet-mapping>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app>
faces-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer
Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<!--
* Copyright 2002-2005 The Apache Software Foundation.
*
* Licensed 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.
-->
<faces-config>
<managed-bean>
<managed-bean-name>counter</managed-bean-name>
<managed-bean-class>org.apache.myfaces.tobago.example.facelets.Counter</
managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>messageBackingBean</managed-bean-name>
<managed-bean-class>
org.apache.myfaces.tobago.example.facelets.MessageBackingBean</
managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/helloWorld.xhtml</from-view-id>
<navigation-case>
<from-outcome>next</from-outcome>
<to-view-id>/helloWorldNext.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/helloWorldNext.xhtml</from-view-id>
<navigation-case>
<from-outcome>back</from-outcome>
<to-view-id>/helloWorld.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>de</supported-locale>
<supported-locale>de_DE</supported-locale>
<supported-locale>de_AT</supported-locale>
<supported-locale>de_CH</supported-locale>
</locale-config>
</application>
</faces-config>
tobago-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Copyright 2002-2005 The Apache Software Foundation.
*
* Licensed 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 tobago-config PUBLIC
"-//The Apache Software Foundation//DTD Tobago Config 1.0//EN"
"tobago-config_1_0.dtd">
<tobago-config>
<theme-config>
<default-theme>speyside</default-theme>
</theme-config>
<resource-dir>tobago-resource</resource-dir>
<resource-dir>org/apache/myfaces/tobago/renderkit</resource-dir>
</tobago-config>
helloWorld.xhtml:
<f:view xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:tc="http://myfaces.apache.org/tobago/component"
xmlns:tx="http://myfaces.apache.org/tobago/facelet-extension">
<tc:page label="Tobago Hello World Faclets">
<f:facet name="layout">
<tc:gridLayout/>
</f:facet>
<tc:out value="Hello World!"/>
<ui:debug hotkey="m"/>
<tc:button label="Weiter" action="next"/>
</tc:page>
</f:view>
helloWorldnext.xhtml exists and is ok. I use tobago release 1.0.7. Files in
my lib:
commons-annotations.jar
commons-beanutils-1.0.7.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
commons-digester-1.6.jar
commons-el-1.0.jar
commons-io-1.1.jar
commons-lang-2.1.jar
commons-logging-1.0.4.jar
el-api.jar
el-ri.jar
jsf-api.jar
jsf-facelets.jar
jsf-impl.jar
jstl-1.1.0.jar
myfaces-api-1.1.2.jar
myfaces-impl-1.1.2.jar
standard-1.1.2.jar
tobago-core-1.0.7.jar
tobago-facelets.jar
tobago-theme(s)...
Thanks A LOT in advance, hope you can help
Chris
Re: Tobago and Facelets
Posted by Christoph Lassner <Ch...@esg.de>.
Hello Bernd,
it obviously works! I couldn't yet make out any differences between your
example and mine (propably some version difference in the libs). I'll post
them here later.
Thanks for your great help!
Chris
Bernd Bohmann <be...@atanion.com> schrieb am 29.08.2006 09:49:51:
> Hello Christoph,
>
> just tried 1.0.7 and 1.0.8-SNAPSHOT. Everything work as expected.
>
> You can download the files from
>
> http://people.apache.org/~bommel/
>
> please test it.
>
> Regards
>
> Bernd
>
> Christoph Lassner wrote:
> > Hello Bernd,
> >
> > thanks for your answer! However, this doesn't change anything on my
> > problem. I tried with the myfaces and the sun impl libs only but it
didn't
> > work any better. I found just the same topic in the mailing list
archive:
> >
> > Hi all,
> >
> > i'm absolutely amazed from jsf (myfaces), tobago and xml-driven
> > interface-description with facelets.
> >
> > i'm new to all three technologies and i am getting stuck at the very
> > first beginning: Navigation Rules from Faces config don't work :-/
> >
> > I got a first site (helloWorld.xml) with one button with the action
> > "goon" that should lead to a site goon.xml (this xml file exists!).
> >
> > The button is correctly being rendered in browser by tobago, i can
click
> > it, but the site only reloads and does not display the site goon.xml.
> >
> > i will attach my files (faces-config.xml and helloWorld.xml)
> >
> > i am using resin as servlet container (3.0.19), facelets 1.0.14, tobago
> > (1.0.8)
> >
> > help is much appreciated, i would like to learn this technology :)
> >
> > thank you very much in advance
> > -- felix gonschorek
> > [...]
> >
> >
> >
> >
> > It was also you who answered :-). But Felix got the problem fixed by
> > downgrading to tobago 1.0.7:
> >
> >
> >
> >
> > Hello Bernd,
> >
> > thank you very much for your answer (and by the way: thank you for
tobago!)
> >
> > but: that was not the problem. i was using tobago 1.0.8 SNAPSHOT, looks
> > like that is not compatible to the resin servlet container, several
> > applications (including example-facelets and addressbook-tobago) did
not
> > work. the new navigation rule in example-facelets (helloWorldNext) did
> > not work and in the addressbook application i could not save anything
> > (cpu 100% for 15minutes)
> >
> > i downgraded to tobago 1.0.7 and everything works now.
> > [...]
> >
> >
> > As it seems, not for me... Could you think of any other reasons for a
bug
> > like this?
> >
> > Regards
> > Chris
> >
> >
> >
> > Bernd Bohmann <be...@atanion.com> schrieb am 28.08.2006
20:12:52:
> >
> >> Hello Christoph,
> >>
> >> you are using the myfaces jsf impl libs and the sun jsf impl libs.
> >>
> >> You should include
> >>
> >> jsf-api.jar
> >> jsf-impl.jar
> >>
> >> or
> >>
> >> myfaces-api-1.1.2.jar
> >> myfaces-impl-1.1.2.jar
> >>
> >> not both.
> >>
> >> Regards
> >>
> >>
> >> Bernd
> >>
> >
> >
Re: Tobago and Facelets
Posted by Bernd Bohmann <be...@atanion.com>.
Hello Christoph,
just tried 1.0.7 and 1.0.8-SNAPSHOT. Everything work as expected.
You can download the files from
http://people.apache.org/~bommel/
please test it.
Regards
Bernd
Christoph Lassner wrote:
> Hello Bernd,
>
> thanks for your answer! However, this doesn't change anything on my
> problem. I tried with the myfaces and the sun impl libs only but it didn't
> work any better. I found just the same topic in the mailing list archive:
>
> Hi all,
>
> i'm absolutely amazed from jsf (myfaces), tobago and xml-driven
> interface-description with facelets.
>
> i'm new to all three technologies and i am getting stuck at the very
> first beginning: Navigation Rules from Faces config don't work :-/
>
> I got a first site (helloWorld.xml) with one button with the action
> "goon" that should lead to a site goon.xml (this xml file exists!).
>
> The button is correctly being rendered in browser by tobago, i can click
> it, but the site only reloads and does not display the site goon.xml.
>
> i will attach my files (faces-config.xml and helloWorld.xml)
>
> i am using resin as servlet container (3.0.19), facelets 1.0.14, tobago
> (1.0.8)
>
> help is much appreciated, i would like to learn this technology :)
>
> thank you very much in advance
> -- felix gonschorek
> [...]
>
>
>
>
> It was also you who answered :-). But Felix got the problem fixed by
> downgrading to tobago 1.0.7:
>
>
>
>
> Hello Bernd,
>
> thank you very much for your answer (and by the way: thank you for tobago!)
>
> but: that was not the problem. i was using tobago 1.0.8 SNAPSHOT, looks
> like that is not compatible to the resin servlet container, several
> applications (including example-facelets and addressbook-tobago) did not
> work. the new navigation rule in example-facelets (helloWorldNext) did
> not work and in the addressbook application i could not save anything
> (cpu 100% for 15minutes)
>
> i downgraded to tobago 1.0.7 and everything works now.
> [...]
>
>
> As it seems, not for me... Could you think of any other reasons for a bug
> like this?
>
> Regards
> Chris
>
>
>
> Bernd Bohmann <be...@atanion.com> schrieb am 28.08.2006 20:12:52:
>
>> Hello Christoph,
>>
>> you are using the myfaces jsf impl libs and the sun jsf impl libs.
>>
>> You should include
>>
>> jsf-api.jar
>> jsf-impl.jar
>>
>> or
>>
>> myfaces-api-1.1.2.jar
>> myfaces-impl-1.1.2.jar
>>
>> not both.
>>
>> Regards
>>
>>
>> Bernd
>>
>
>
Re: Tobago and Facelets
Posted by Christoph Lassner <Ch...@esg.de>.
Hello Bernd,
thanks for your answer! However, this doesn't change anything on my
problem. I tried with the myfaces and the sun impl libs only but it didn't
work any better. I found just the same topic in the mailing list archive:
Hi all,
i'm absolutely amazed from jsf (myfaces), tobago and xml-driven
interface-description with facelets.
i'm new to all three technologies and i am getting stuck at the very
first beginning: Navigation Rules from Faces config don't work :-/
I got a first site (helloWorld.xml) with one button with the action
"goon" that should lead to a site goon.xml (this xml file exists!).
The button is correctly being rendered in browser by tobago, i can click
it, but the site only reloads and does not display the site goon.xml.
i will attach my files (faces-config.xml and helloWorld.xml)
i am using resin as servlet container (3.0.19), facelets 1.0.14, tobago
(1.0.8)
help is much appreciated, i would like to learn this technology :)
thank you very much in advance
-- felix gonschorek
[...]
It was also you who answered :-). But Felix got the problem fixed by
downgrading to tobago 1.0.7:
Hello Bernd,
thank you very much for your answer (and by the way: thank you for tobago!)
but: that was not the problem. i was using tobago 1.0.8 SNAPSHOT, looks
like that is not compatible to the resin servlet container, several
applications (including example-facelets and addressbook-tobago) did not
work. the new navigation rule in example-facelets (helloWorldNext) did
not work and in the addressbook application i could not save anything
(cpu 100% for 15minutes)
i downgraded to tobago 1.0.7 and everything works now.
[...]
As it seems, not for me... Could you think of any other reasons for a bug
like this?
Regards
Chris
Bernd Bohmann <be...@atanion.com> schrieb am 28.08.2006 20:12:52:
> Hello Christoph,
>
> you are using the myfaces jsf impl libs and the sun jsf impl libs.
>
> You should include
>
> jsf-api.jar
> jsf-impl.jar
>
> or
>
> myfaces-api-1.1.2.jar
> myfaces-impl-1.1.2.jar
>
> not both.
>
> Regards
>
>
> Bernd
>
Re: Tobago and Facelets
Posted by Bernd Bohmann <be...@atanion.com>.
Hello Christoph,
you are using the myfaces jsf impl libs and the sun jsf impl libs.
You should include
jsf-api.jar
jsf-impl.jar
or
myfaces-api-1.1.2.jar
myfaces-impl-1.1.2.jar
not both.
Regards
Bernd
Christoph Lassner wrote:
> Hi everybody!
>
> Combining Tabago with Facelets is an intersting topic I thought and tried
> to get it working. However, I still have some problems. The pages are
> rendered properly in Tobago style, the tags are working. However, when I
> set up navigation rules, they don't work. When I press a tobago button,
> only the page will reload. Also tobago elements that require to load data
> from the server (like calendar with popup) don't work, because when I click
> the button to open it, only the page reloads. I really hope that someone
> has got some idea how to fix that, because I'm desperately trying to fix
> this.
>
> As you will see, I just tried to use the facelets-example of the tobago
> release, which didn't work any better.
>
> My configuration:
> Apache Tomcat 5.5
>
> web.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
> * Copyright 2002-2005 The Apache Software Foundation.
> *
> * Licensed 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.
> -->
> <web-app version="2.4" 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">
> <display-name>Tobago Facelets Example Application</display-name>
> <context-param>
> <param-name>facelets.DEVELOPMENT</param-name>
> <param-value>true</param-value>
> </context-param>
> <context-param>
> <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
> <param-value>.xhtml</param-value>
> </context-param>
> <listener>
> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</
> listener-class>
> </listener>
> <listener>
> <listener-class>
> org.apache.myfaces.tobago.webapp.TobagoServletContextListener</
> listener-class>
> </listener>
> <servlet>
> <servlet-name>FacesServlet</servlet-name>
> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet>
> <servlet-name>ResourceServlet</servlet-name>
> <servlet-class>org.apache.myfaces.tobago.servlet.ResourceServlet</
> servlet-class>
> </servlet>
> <!-- servlet-mapping -->
> <servlet-mapping>
> <servlet-name>FacesServlet</servlet-name>
> <url-pattern>*.jsf</url-pattern>
> </servlet-mapping>
> <servlet-mapping>
> <servlet-name>ResourceServlet</servlet-name>
> <url-pattern>/org/apache/myfaces/tobago/renderkit/*</url-pattern>
> </servlet-mapping>
> <!-- The Usual Welcome File List -->
> <welcome-file-list>
> <welcome-file>index.html</welcome-file>
> </welcome-file-list>
> <login-config>
> <auth-method>BASIC</auth-method>
> </login-config>
> </web-app>
>
> faces-config.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer
> Faces Config 1.1//EN"
>
> "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
> <!--
> * Copyright 2002-2005 The Apache Software Foundation.
> *
> * Licensed 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.
> -->
> <faces-config>
> <managed-bean>
> <managed-bean-name>counter</managed-bean-name>
> <managed-bean-class>org.apache.myfaces.tobago.example.facelets.Counter</
> managed-bean-class>
> <managed-bean-scope>session</managed-bean-scope>
> </managed-bean>
> <managed-bean>
> <managed-bean-name>messageBackingBean</managed-bean-name>
> <managed-bean-class>
> org.apache.myfaces.tobago.example.facelets.MessageBackingBean</
> managed-bean-class>
> <managed-bean-scope>session</managed-bean-scope>
> </managed-bean>
> <navigation-rule>
> <from-view-id>/helloWorld.xhtml</from-view-id>
> <navigation-case>
> <from-outcome>next</from-outcome>
> <to-view-id>/helloWorldNext.xhtml</to-view-id>
> </navigation-case>
> </navigation-rule>
> <navigation-rule>
> <from-view-id>/helloWorldNext.xhtml</from-view-id>
> <navigation-case>
> <from-outcome>back</from-outcome>
> <to-view-id>/helloWorld.xhtml</to-view-id>
> </navigation-case>
> </navigation-rule>
> <application>
> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
> <locale-config>
> <default-locale>en</default-locale>
> <supported-locale>de</supported-locale>
> <supported-locale>de_DE</supported-locale>
> <supported-locale>de_AT</supported-locale>
> <supported-locale>de_CH</supported-locale>
> </locale-config>
> </application>
> </faces-config>
>
> tobago-config.xml:
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!--
> * Copyright 2002-2005 The Apache Software Foundation.
> *
> * Licensed 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 tobago-config PUBLIC
> "-//The Apache Software Foundation//DTD Tobago Config 1.0//EN"
> "tobago-config_1_0.dtd">
>
> <tobago-config>
>
> <theme-config>
> <default-theme>speyside</default-theme>
> </theme-config>
>
> <resource-dir>tobago-resource</resource-dir>
> <resource-dir>org/apache/myfaces/tobago/renderkit</resource-dir>
>
> </tobago-config>
>
> helloWorld.xhtml:
> <f:view xmlns:f="http://java.sun.com/jsf/core"
> xmlns:ui="http://java.sun.com/jsf/facelets"
> xmlns:tc="http://myfaces.apache.org/tobago/component"
> xmlns:tx="http://myfaces.apache.org/tobago/facelet-extension">
> <tc:page label="Tobago Hello World Faclets">
> <f:facet name="layout">
> <tc:gridLayout/>
> </f:facet>
>
> <tc:out value="Hello World!"/>
> <ui:debug hotkey="m"/>
> <tc:button label="Weiter" action="next"/>
> </tc:page>
> </f:view>
>
> helloWorldnext.xhtml exists and is ok. I use tobago release 1.0.7. Files in
> my lib:
> commons-annotations.jar
> commons-beanutils-1.0.7.jar
> commons-codec-1.3.jar
> commons-collections-3.1.jar
> commons-digester-1.6.jar
> commons-el-1.0.jar
> commons-io-1.1.jar
> commons-lang-2.1.jar
> commons-logging-1.0.4.jar
> el-api.jar
> el-ri.jar
> jsf-api.jar
> jsf-facelets.jar
> jsf-impl.jar
> jstl-1.1.0.jar
> myfaces-api-1.1.2.jar
> myfaces-impl-1.1.2.jar
> standard-1.1.2.jar
> tobago-core-1.0.7.jar
> tobago-facelets.jar
> tobago-theme(s)...
>
>
> Thanks A LOT in advance, hope you can help
> Chris
>
>