You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Felix Gonschorek <fe...@gg-media.biz> on 2006/05/19 16:05:00 UTC

[MyFaces+Tobago+Facelets] Navigation Rules don't work. Beginner needs help

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

-----------> STDOUT <-----

[16:02:20.375] WebApp[http://localhost:8080/jsf] starting
[16:02:22.203] Resin started in 11688ms
[16:02:29.781] No state saving method defined, assuming default server 
state saving
[16:02:30.281] Added Library from: 
jar:file:/C:/workspace/jsf/WEB-INF/lib/jsf-fa
celets-1.0.14.jar!/META-INF/jsf-html.taglib.xml
[16:02:30.296] Added Library from: 
jar:file:/C:/workspace/jsf/WEB-INF/lib/tobago
-facelets-1.0.8-SNAPSHOT.jar!/META-INF/tobago.taglib.xml
[16:02:30.343] Added Library from: 
jar:file:/C:/workspace/jsf/WEB-INF/lib/jsf-fa
celets-1.0.14.jar!/META-INF/jsf-ui.taglib.xml
[16:02:30.359] Added Library from: 
jar:file:/C:/workspace/jsf/WEB-INF/lib/tobago
-facelets-1.0.8-SNAPSHOT.jar!/META-INF/tobago-extension.taglib.xml
[16:02:30.421] Added Library from: 
jar:file:/C:/workspace/jsf/WEB-INF/lib/jsf-fa
celets-1.0.14.jar!/META-INF/jsf-core.taglib.xml
[16:02:30.453] Added Library from: 
jar:file:/C:/workspace/jsf/WEB-INF/lib/jsf-fa
celets-1.0.14.jar!/META-INF/jstl-core.taglib.xml
[16:02:30.468] Added Library from: 
jar:file:/C:/workspace/jsf/WEB-INF/lib/jsf-fa
celets-1.0.14.jar!/META-INF/jstl-fn.taglib.xml
[16:02:30.656] /helloWorld.xml @9,0 label="MYCREON TOBAGE IMPL. TEST :)" 
Propert y 'label' is not on type: org.apache.myfaces.tobago.component.UIPage
[16:02:30.703] /helloWorld.xml @11,0 label="Go on" Property 'label' is 
not on type: org.apache.myfaces.tobago.component.UICommand
[16:02:31.140] ResourceServlet: init

<---------- STDOUT ------------->

clicking my button produces no debug output-....


here is my helloWorld.xml:
------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<tobago xmlns:f="http://java.sun.com/jsf/core"
		xmlns:tc="http://myfaces.apache.org/tobago/component"
		xmlns:ui="http://java.sun.com/jsf/facelets"
       	xmlns:tx="http://myfaces.apache.org/tobago/facelet-extension">

  <f:view>
   <tc:page label="MYCREON TOBAGE IMPL. TEST :)">
    <ui:debug hotkey="m"/>
    <tc:button label="Go on" action="goon" />
   </tc:page>
  </f:view>

</tobago>
------------------------------------------------------------
facex-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">
-->
<faces-config>

	<application>
		<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
	 
<action-listener>org.apache.myfaces.tobago.application.ActionListenerImpl</action-listener>
		<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>

	<navigation-rule>
		<navigation-case>
			<from-outcome>goon</from-outcome>
			<to-view-id>/goon.xml</to-view-id>
		</navigation-case>
	</navigation-rule>

</faces-config>

------------------------------------------------------------
and web.xml:
------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<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">

	<display-name>Blank Tobago 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>.xml</param-value>
	</context-param>

	<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>

	<listener>
	 
<listener-class>org.apache.myfaces.tobago.webapp.TobagoServletContextListener</listener-class>
	</listener>
	
	<filter>
		<filter-name>multipartFormdataFilter</filter-name>
	 
<filter-class>org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataFilter</filter-class>
	</filter>
	
	<filter-mapping>
		<filter-name>multipartFormdataFilter</filter-name>
		<url-pattern>*.jsf</url-pattern>
	</filter-mapping>

</web-app>

------------------------------------------------------------




Re: [MyFaces+Tobago+Facelets] Navigation Rules don't work. Beginner needs help

Posted by Bernd Bohmann <be...@atanion.com>.
Hello Felix,

my first answer was wrong. Answering to fast :-)
Should be .xml

The problem with the password attribute should fixed by 
http://issues.apache.org/jira/browse/TOBAGO-75

I tested tobago with resin 3.0.19
I found only one problem:
resin doesn't support registering contextlistener in jar files.

Can you send me more details about your environment.

Regards

Bernd

Felix Gonschorek wrote:
> 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. well, not 
> everything:
> 
> the navigation rules work only if i point to the xml files, not to the 
> jsf extension:
> 
>     <navigation-rule>
>          <from-view-id>/login.xml</from-view-id>
>         <navigation-case>
>             <from-outcome>success</from-outcome>
>             <to-view-id>/overview.xml</to-view-id>
>         </navigation-case>
>     </navigation-rule>
>     
>     <navigation-rule>
>         <navigation-case>
>             <from-outcome>logout</from-outcome>
>             <to-view-id>/login.jsf</to-view-id>
>         </navigation-case>
>     </navigation-rule>
> 
> and i have 2 more problems:
> 
> if want to build a login form with username & password.
> 
> <tc:in id="password" value="${user.password}" label="Password" 
> password="true" required="true" />
> 
> 
> but password="true" does not work, the password is rendered readeable. 
> it works if i have a method in a managed bean
> 
> public boolean getBooleanTest()
> {
>     return true;
> }   
> 
> and use an EL expression:
> 
> password="${user.booleanTest}"
> 
> -> the password is echoed with *****
> 
> 
> and one more thing: i have problems with the facet <tc:gridLayout and 
> the rows and columns descriptions: is there any detailed documentation 
> or explicit examples for this?
> 
> thank you very much!
> 
> -- felix gonschorek
> 
> Bernd Bohmann schrieb:
>> the navigation rule should point to /goon.jsf.
>>
>> The DEFAULT_SUFFIX is .xml
>> this means goon.jsf whould point to goon.xml.
> 

-- 
Dipl.-Ing. Bernd Bohmann - Atanion GmbH - Software Development
Bismarckstr. 13, 26122 Oldenburg, http://www.atanion.com
phone: +49 441 4082312, mobile: +49 173 8839471, fax: +49 441 4082333

Re: [MyFaces+Tobago+Facelets] Navigation Rules don't work. Beginner needs help

Posted by Felix Gonschorek <fe...@gg-media.biz>.
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. well, not everything:

the navigation rules work only if i point to the xml files, not to the 
jsf extension:

	<navigation-rule>
  		<from-view-id>/login.xml</from-view-id>
		<navigation-case>
			<from-outcome>success</from-outcome>
			<to-view-id>/overview.xml</to-view-id>
		</navigation-case>
	</navigation-rule>
	
	<navigation-rule>
		<navigation-case>
			<from-outcome>logout</from-outcome>
			<to-view-id>/login.jsf</to-view-id>
		</navigation-case>
	</navigation-rule>

and i have 2 more problems:

if want to build a login form with username & password.

<tc:in id="password" value="${user.password}" label="Password" 
password="true" required="true" />


but password="true" does not work, the password is rendered readeable. 
it works if i have a method in a managed bean

public boolean getBooleanTest()
{
	return true;
}	

and use an EL expression:

password="${user.booleanTest}"

-> the password is echoed with *****


and one more thing: i have problems with the facet <tc:gridLayout and 
the rows and columns descriptions: is there any detailed documentation 
or explicit examples for this?

thank you very much!

-- felix gonschorek

Bernd Bohmann schrieb:
> the navigation rule should point to /goon.jsf.
> 
> The DEFAULT_SUFFIX is .xml
> this means goon.jsf whould point to goon.xml.

Re: [MyFaces+Tobago+Facelets] Navigation Rules don't work. Beginner needs help

Posted by Bernd Bohmann <be...@atanion.com>.
Hello Felix,

the navigation rule should point to /goon.jsf.

The DEFAULT_SUFFIX is .xml
this means goon.jsf whould point to goon.xml.

You can look at the facelets example demo in

http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/facelets/

Regards

Bernd

Felix Gonschorek wrote:
> 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
> 
> -----------> STDOUT <-----
> 
> [16:02:20.375] WebApp[http://localhost:8080/jsf] starting
> [16:02:22.203] Resin started in 11688ms
> [16:02:29.781] No state saving method defined, assuming default server 
> state saving
> [16:02:30.281] Added Library from: 
> jar:file:/C:/workspace/jsf/WEB-INF/lib/jsf-fa
> celets-1.0.14.jar!/META-INF/jsf-html.taglib.xml
> [16:02:30.296] Added Library from: 
> jar:file:/C:/workspace/jsf/WEB-INF/lib/tobago
> -facelets-1.0.8-SNAPSHOT.jar!/META-INF/tobago.taglib.xml
> [16:02:30.343] Added Library from: 
> jar:file:/C:/workspace/jsf/WEB-INF/lib/jsf-fa
> celets-1.0.14.jar!/META-INF/jsf-ui.taglib.xml
> [16:02:30.359] Added Library from: 
> jar:file:/C:/workspace/jsf/WEB-INF/lib/tobago
> -facelets-1.0.8-SNAPSHOT.jar!/META-INF/tobago-extension.taglib.xml
> [16:02:30.421] Added Library from: 
> jar:file:/C:/workspace/jsf/WEB-INF/lib/jsf-fa
> celets-1.0.14.jar!/META-INF/jsf-core.taglib.xml
> [16:02:30.453] Added Library from: 
> jar:file:/C:/workspace/jsf/WEB-INF/lib/jsf-fa
> celets-1.0.14.jar!/META-INF/jstl-core.taglib.xml
> [16:02:30.468] Added Library from: 
> jar:file:/C:/workspace/jsf/WEB-INF/lib/jsf-fa
> celets-1.0.14.jar!/META-INF/jstl-fn.taglib.xml
> [16:02:30.656] /helloWorld.xml @9,0 label="MYCREON TOBAGE IMPL. TEST :)" 
> Propert y 'label' is not on type: 
> org.apache.myfaces.tobago.component.UIPage
> [16:02:30.703] /helloWorld.xml @11,0 label="Go on" Property 'label' is 
> not on type: org.apache.myfaces.tobago.component.UICommand
> [16:02:31.140] ResourceServlet: init
> 
> <---------- STDOUT ------------->
> 
> clicking my button produces no debug output-....
> 
> 
> here is my helloWorld.xml:
> ------------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <tobago xmlns:f="http://java.sun.com/jsf/core"
>         xmlns:tc="http://myfaces.apache.org/tobago/component"
>         xmlns:ui="http://java.sun.com/jsf/facelets"
>           xmlns:tx="http://myfaces.apache.org/tobago/facelet-extension">
> 
>  <f:view>
>   <tc:page label="MYCREON TOBAGE IMPL. TEST :)">
>    <ui:debug hotkey="m"/>
>    <tc:button label="Go on" action="goon" />
>   </tc:page>
>  </f:view>
> 
> </tobago>
> ------------------------------------------------------------
> facex-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">
> -->
> <faces-config>
> 
>     <application>
>         <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
>      
> <action-listener>org.apache.myfaces.tobago.application.ActionListenerImpl</action-listener> 
> 
>         <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>
> 
>     <navigation-rule>
>         <navigation-case>
>             <from-outcome>goon</from-outcome>
>             <to-view-id>/goon.xml</to-view-id>
>         </navigation-case>
>     </navigation-rule>
> 
> </faces-config>
> 
> ------------------------------------------------------------
> and web.xml:
> ------------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <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">
> 
>     <display-name>Blank Tobago 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>.xml</param-value>
>     </context-param>
> 
>     <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>
> 
>     <listener>
>      
> <listener-class>org.apache.myfaces.tobago.webapp.TobagoServletContextListener</listener-class> 
> 
>     </listener>
>     
>     <filter>
>         <filter-name>multipartFormdataFilter</filter-name>
>      
> <filter-class>org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataFilter</filter-class> 
> 
>     </filter>
>     
>     <filter-mapping>
>         <filter-name>multipartFormdataFilter</filter-name>
>         <url-pattern>*.jsf</url-pattern>
>     </filter-mapping>
> 
> </web-app>
> 
> ------------------------------------------------------------
> 
> 
> 
> 

-- 
Dipl.-Ing. Bernd Bohmann - Atanion GmbH - Software Development
Bismarckstr. 13, 26122 Oldenburg, http://www.atanion.com
phone: +49 441 4082312, mobile: +49 173 8839471, fax: +49 441 4082333