For some reason, f:loadBundle cannot loading an EL style expression for
me ("#basePage.bundleName" is resolving to ""). If I move the bundle
definition into faces-config.xml using the new JSF 1.2 resource-bundle
support and remove all the calls to f:loadBundle in all the XHTML (or
change the f:loadBundle's to directly access "ApplicationResources" as
the bundle name instead of indirecting through the basePage backing
bean), then it "just works".
NOTE: unit tests are still hosed, so this is not yet ready for prime
time, but I guess it might be of use for someone, so here's a complete
diff of 2.0-M5 full source that works with "mvn jetty:run-war
-Dmaven.test.skip=true" (attached as jsf12-patch.txt)
Can someone out there that is more knowlegable about JSF/Facelets than I
comment on whether this is the right approach?
Thanks,
Steve
diff -uwr myproject-clean-fullsource/pom.xml myproject/pom.xml
--- myproject-clean-fullsource/pom.xml 2007-05-27 12:04:32.702750000 -0400
+++ myproject/pom.xml 2007-05-27 12:35:24.187125000 -0400
@@ -181,7 +181,7 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>1.1.5</version>
+ <version>${myfaces.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
@@ -338,18 +338,18 @@
<artifactId>commons-dbcp</artifactId>
<version>${commons.dbcp.version}</version>
</dependency>
- <dependency>
+ <!--dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>${el.version}</version>
- </dependency>
+ </dependency-->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>${javamail.version}</version>
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
+ <groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>${jsp.version}</version>
<scope>provided</scope>
@@ -807,7 +807,7 @@
<commons.dbcp.version>1.2.2</commons.dbcp.version>
<jstl.version>1.1.2</jstl.version>
<ehcache.version>1.3.0-beta2</ehcache.version>
- <myfaces.version>1.1.5</myfaces.version>
+ <myfaces.version>1.2.0-SNAPSHOT</myfaces.version>
<aspectj.version>1.5.3</aspectj.version>
<facelets.version>1.1.11</facelets.version>
<sitemesh.version>2.2.1</sitemesh.version>
@@ -815,7 +815,7 @@
<!-- Testing dependency versions -->
<jmock.version>1.1.0</jmock.version>
- <jsp.version>2.0</jsp.version>
+ <jsp.version>2.1</jsp.version>
<junit.version>3.8.2</junit.version>
<servlet.version>2.4</servlet.version>
<wiser.version>1.0.3</wiser.version>
diff -uwr
myproject-clean-fullsource/src/main/java/org/appfuse/webapp/util/FacesUtils.java
myproject/src/main/java/org/appfuse/webapp/util/FacesUtils.java
---
myproject-clean-fullsource/src/main/java/org/appfuse/webapp/util/FacesUtils.java
2007-05-27 12:04:17.062125000 -0400
+++ myproject/src/main/java/org/appfuse/webapp/util/FacesUtils.java
2007-05-27 12:12:48.093375000 -0400
@@ -118,31 +118,32 @@
msg,
msg));
}
- /**
- * Evaluate the integer value of a JSF expression.
- *
- * @param el the JSF expression
- * @return the integer value associated with the JSF expression
- */
- public static Integer evalInt(String el) {
- if (el == null) {
- return null;
- }
-
- if (UIComponentTag.isValueReference(el)) {
- Object value = getElValue(el);
-
- if (value == null) {
- return null;
- } else if (value instanceof Integer) {
- return (Integer) value;
- } else {
- return new Integer(value.toString());
- }
- } else {
- return new Integer(el);
- }
- }
+// NOT USED(?) and fails to compile with JSF1.2
+// /**
+// * Evaluate the integer value of a JSF expression.
+// *
+// * @param el the JSF expression
+// * @return the integer value associated with the JSF expression
+// */
+// public static Integer evalInt(String el) {
+// if (el == null) {
+// return null;
+// }
+//
+// if (UIComponentTag.isValueReference(el)) {
+// Object value = getElValue(el);
+//
+// if (value == null) {
+// return null;
+// } else if (value instanceof Integer) {
+// return (Integer) value;
+// } else {
+// return new Integer(value.toString());
+// }
+// } else {
+// return new Integer(el);
+// }
+// }
private static Application getApplication() {
ApplicationFactory appFactory =
diff -uwr myproject-clean-fullsource/src/main/webapp/WEB-INF/faces-config.xml
myproject/src/main/webapp/WEB-INF/faces-config.xml
--- myproject-clean-fullsource/src/main/webapp/WEB-INF/faces-config.xml
2007-05-27 12:04:17.155875000 -0400
+++ myproject/src/main/webapp/WEB-INF/faces-config.xml 2007-05-27
16:50:53.390250000 -0400
@@ -1,8 +1,12 @@
<?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>
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/
+ web-facesconfig_1_2.xsd"
+ version="1.2">
+
<application>
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
<locale-config>
@@ -21,6 +25,10 @@
<supported-locale>zh_TW</supported-locale>
</locale-config>
<message-bundle>ApplicationResources</message-bundle>
+ <resource-bundle>
+ <base-name>ApplicationResources</base-name>
+ <var>text</var>
+ </resource-bundle>
</application>
<component>
diff -uwr myproject-clean-fullsource/src/main/webapp/activeUsers.xhtml
myproject/src/main/webapp/activeUsers.xhtml
--- myproject-clean-fullsource/src/main/webapp/activeUsers.xhtml
2007-05-27 12:04:17.515250000 -0400
+++ myproject/src/main/webapp/activeUsers.xhtml 2007-05-27 16:47:32.030875000
-0400
@@ -3,7 +3,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:t="http://myfaces.apache.org/tomahawk">
<f:view>
-<f:loadBundle var="text" basename="#{basePage.bundleName}"/>
+<!--<f:loadBundle var="text" basename="#{basePage.bundleName}"/>-->
<head>
<title>#{text['activeUsers.title']}</title>
<meta name="heading" content="#{text['activeUsers.heading']}"/>
diff -uwr myproject-clean-fullsource/src/main/webapp/mainMenu.xhtml
myproject/src/main/webapp/mainMenu.xhtml
--- myproject-clean-fullsource/src/main/webapp/mainMenu.xhtml 2007-05-27
12:04:17.796500000 -0400
+++ myproject/src/main/webapp/mainMenu.xhtml 2007-05-27 16:46:28.218375000
-0400
@@ -3,7 +3,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:t="http://myfaces.apache.org/tomahawk">
<f:view>
-<f:loadBundle var="text" basename="#{basePage.bundleName}"/>
+<!--<f:loadBundle var="text" basename="ApplicationResources"/>-->
<head>
<title>#{text['mainMenu.title']}</title>
<meta name="menu" content="MainMenu"/>
diff -uwr myproject-clean-fullsource/src/main/webapp/passwordHint.xhtml
myproject/src/main/webapp/passwordHint.xhtml
--- myproject-clean-fullsource/src/main/webapp/passwordHint.xhtml
2007-05-27 12:04:17.062125000 -0400
+++ myproject/src/main/webapp/passwordHint.xhtml 2007-05-27
16:47:31.687125000 -0400
@@ -3,7 +3,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:t="http://myfaces.apache.org/tomahawk">
<f:view>
-<f:loadBundle var="text" basename="#{basePage.bundleName}"/>
+<!--<f:loadBundle var="text" basename="#{basePage.bundleName}"/>-->
<title>#{text['user.passwordHint']}</title>
<p>Looking up password hint for ${param.username}...</p>
diff -uwr myproject-clean-fullsource/src/main/webapp/selectFile.xhtml
myproject/src/main/webapp/selectFile.xhtml
--- myproject-clean-fullsource/src/main/webapp/selectFile.xhtml 2007-05-27
12:04:17.843375000 -0400
+++ myproject/src/main/webapp/selectFile.xhtml 2007-05-27 16:47:31.093375000
-0400
@@ -4,7 +4,7 @@
xmlns:v="http://corejsf.com/validator">
<f:view>
-<f:loadBundle var="text" basename="#{basePage.bundleName}"/>
+<!--<f:loadBundle var="text" basename="#{basePage.bundleName}"/>-->
<head>
<title>#{text['upload.title']}</title>
<meta name="menu" content="AdminMenu"/>
diff -uwr myproject-clean-fullsource/src/main/webapp/showFile.xhtml
myproject/src/main/webapp/showFile.xhtml
--- myproject-clean-fullsource/src/main/webapp/showFile.xhtml 2007-05-27
12:04:17.859000000 -0400
+++ myproject/src/main/webapp/showFile.xhtml 2007-05-27 16:47:31.093375000
-0400
@@ -2,7 +2,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<f:view>
-<f:loadBundle var="text" basename="#{basePage.bundleName}"/>
+<!--<f:loadBundle var="text" basename="#{basePage.bundleName}"/>-->
<head>
<title>#{text['display.title']}</title>
<meta name="heading" content="#{text['display.heading']}"/>
diff -uwr myproject-clean-fullsource/src/main/webapp/signup.xhtml
myproject/src/main/webapp/signup.xhtml
--- myproject-clean-fullsource/src/main/webapp/signup.xhtml 2007-05-27
12:04:17.718375000 -0400
+++ myproject/src/main/webapp/signup.xhtml 2007-05-27 16:47:31.093375000
-0400
@@ -4,7 +4,7 @@
xmlns:v="http://corejsf.com/validator">
<f:view>
-<f:loadBundle var="text" basename="#{signupForm.bundleName}"/>
+<!--<f:loadBundle var="text" basename="#{signupForm.bundleName}"/>-->
<head>
<title>#{text['signup.title']}</title>
<meta name="heading" content="#{text['signup.heading']}"/>
diff -uwr myproject-clean-fullsource/src/main/webapp/userForm.xhtml
myproject/src/main/webapp/userForm.xhtml
--- myproject-clean-fullsource/src/main/webapp/userForm.xhtml 2007-05-27
12:04:17.718375000 -0400
+++ myproject/src/main/webapp/userForm.xhtml 2007-05-27 16:47:29.718375000
-0400
@@ -4,7 +4,7 @@
xmlns:v="http://corejsf.com/validator">
<f:view>
-<f:loadBundle var="text" basename="#{userForm.bundleName}"/>
+<!--<f:loadBundle var="text" basename="#{userForm.bundleName}"/>-->
<head>
<title>#{text['userProfile.title']}</title>
<meta name="menu" content="UserMenu"/>
diff -uwr myproject-clean-fullsource/src/main/webapp/users.xhtml
myproject/src/main/webapp/users.xhtml
--- myproject-clean-fullsource/src/main/webapp/users.xhtml 2007-05-27
12:04:17.593375000 -0400
+++ myproject/src/main/webapp/users.xhtml 2007-05-27 16:47:34.077750000
-0400
@@ -3,7 +3,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:t="http://myfaces.apache.org/tomahawk">
<f:view>
-<f:loadBundle var="text" basename="#{userList.bundleName}"/>
+<!--<f:loadBundle var="text" basename="#{userList.bundleName}"/>-->
<head>
<title>#{text['userList.title']}</title>
<meta name="heading" content="#{text['userList.heading']}"/>
Only in myproject: velocity.log
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]