| Author |
Message |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 01/12/2006 04:02:13
|
msanders
Joined: 21/11/2006 00:00:00
Messages: 14
Offline
|
Hi,
Could anyone explain why the h:commandButton in the following example doesn't work, now that I've integrated ICEfaces?
It all worked before I used the context menu "ICEfaces Integration > Enable ICEfaces...".
The managed bean called "simple" just returns "success". The action listener in the same bean is correctly called.
I'm running: Tomcat 5.5.20, BEA Workshop for JSF 3.2.1, ICEfaces workshop integration 1.5.1, Sun JSF RI 1.1, Internet Explorer 6.0.
- Mark
The faces-config.xml is as follows:
Code:
<?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>
<message-bundle>resources.application</message-bundle>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
</application>
<managed-bean>
<managed-bean-name>simple</managed-bean-name>
<managed-bean-class>com.nr.Simple</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/welcome.jspx</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/success.jspx</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
| Filename |
web.xml |
Download
|
| Description |
web.xml |
| Filesize |
4 Kbytes
|
| Downloaded: |
256 time(s) |
| Filename |
welcome.jspx |
Download
|
| Description |
Basic JSP document with a command button, converted to use ice:outputDeclaration because jsp:out is ignored. |
| Filesize |
923 bytes
|
| Downloaded: |
296 time(s) |
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 01/12/2006 12:48:33
|
liming.wu
Joined: 26/10/2004 00:00:00
Messages: 403
Offline
|
msanders,
1. in welcome.jspx, values taken from resource bundle should be value="#{bundle['welcomeTitle']}" instead of value="#{bundle.welcomeTitle}"
2. You have mentioned that you use Sun RI 1.1 but your web.xml shows you use MyFaces
Regards
Liming
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 04/12/2006 04:02:36
|
msanders
Joined: 21/11/2006 00:00:00
Messages: 14
Offline
|
Thanks for your reply.
liming_w wrote:
1. in welcome.jspx, values taken from resource bundle should be value="#{bundle['welcomeTitle']}" instead of value="#{bundle.welcomeTitle}"
These are equivalent ways to reference the entries in a map (or other indexed property): if the key is a string without a '.' in it (e.g. 'welcomeTitle') you can access the value with the '.' operator.
Here's a reference for this part of the JSP 2.0 expression language:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html#wp84857
Changing all these to the form you suggest doesn't make a difference.
liming_w wrote:
2. You have mentioned that you use Sun RI 1.1 but your web.xml shows you use MyFaces
My mistake. Here is the web.xml:
| Filename |
web.xml |
Download
|
| Description |
|
| Filesize |
4 Kbytes
|
| Downloaded: |
237 time(s) |
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 04/12/2006 16:49:58
|
liming.wu
Joined: 26/10/2004 00:00:00
Messages: 403
Offline
|
Sorry. I missed that there is no "." in your property name.
Based on your files you posted, I can run it on tomcat 5.5.20 without problem using workshop with icefaces capabilities added.
I attached war file here. Note faces-config has been slightly changed and dependent jar files are not included.
| Filename |
bundle.war |
Download
|
| Description |
|
| Filesize |
61 Kbytes
|
| Downloaded: |
252 time(s) |
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 05/12/2006 03:04:56
|
msanders
Joined: 21/11/2006 00:00:00
Messages: 14
Offline
|
Hi Liming, and thank you for your reply,
liming_w wrote:
Note faces-config has been slightly changed
Interesting. The changes you made to the faces-config.xml fixes the application, and clicking on the submit commandButton moves to the second page.
The changes are as follows:
Old Code:
<navigation-rule>
<from-view-id>/welcome.jspx</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/success.jspx</to-view-id>
</navigation-case>
</navigation-rule>
New Code:
<navigation-rule>
<from-view-id>/welcome.iface</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/success.iface</to-view-id>
</navigation-case>
</navigation-rule>
However, the old code, referencing the underlying jspx document, works fine using the MyFaces implementation.
Also, BEA Workshop for JSF is now complaining that it doesn't know about the navigation rules for the application. Specifically, BEA Workshop is warning that The navigation outcome "success" returned from the "submit" action is not valid from this page.
Actually, the following works as well:
Code:
<navigation-rule>
<from-view-id>/welcome.iface</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/success.jspx</to-view-id>
</navigation-case>
</navigation-rule>
- Mark
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 05/12/2006 03:09:26
|
msanders
Joined: 21/11/2006 00:00:00
Messages: 14
Offline
|
Hi,
The following works with both the Sun RI and MyFaces, and also stops BEA Workshop complaining about missing navigation rules:
Code:
<navigation-rule>
<from-view-id>/pages/welcome.*</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/pages/success.jspx</to-view-id>
</navigation-case>
</navigation-rule>
I'm going to investigate a bit further, and have a look at the JSF specs. I don't think I understand the definition of a "view identifier".
- Mark
|
|
|
 |
|
|