dev@javaserverfaces.java.net

[REVIEW] Backport of issues 67, 119, 146, 150, 175, 184

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Sat, 05 Nov 2005 16:28:44 -0800

Backport of issues:
- https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=67
- https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=119
- https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=146
- https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=150
- https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=175
- https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=184

to JSF_1_1_ROLLING branch


SECTION: Modified Files
----------------------------
M jsf-api/src/javax/faces/convert/NumberConverter.java
- for issue 150

M jsf-ri/src/com/sun/faces/context/ExternalContextImpl.java
- for issue 146

M jsf-ri/build-tests.xml
M jsf-ri/src/com/sun/faces/context/FacesContextImpl.java
M jsf-ri/test/com/sun/faces/application/TestViewHandlerImpl.java
M jsf-ri/test/com/sun/faces/lifecycle/TestProcessEvents.java
M jsf-ri/test/com/sun/faces/lifecycle/TestSaveStateInPage.java
- for issue 175

A jsf-ri/src/javax/faces/Messages_en.properties
- for issue 119

M jsf-ri/src/com/sun/faces/standard-html-renderkit-impl.xml
M jsf-ri/src/com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java
M jsf-ri/src/com/sun/faces/renderkit/html_basic/LinkRenderer.java
M jsf-ri/src/com/sun/faces/renderkit/html_basic/OutputLinkRenderer.java
M jsf-ri/test/com/sun/faces/renderkit/html_basic/TestRenderers_1.java
M jsf-ri/test/com/sun/faces/renderkit/html_basic/TestRenderers_2.java
- for issue 184

M jsf-ri/build.xml
M jsf-ri/src/com/sun/faces/application/ApplicationAssociate.java
M jsf-ri/src/com/sun/faces/application/ApplicationImpl.java
M jsf-ri/src/com/sun/faces/config/ManagedBeanFactory.java
M jsf-ri/src/com/sun/faces/taglib/html_basic/HtmlBasicValidator.java
M jsf-ri/src/com/sun/faces/taglib/jsf_core/ViewTag.java
M jsf-ri/src/com/sun/faces/util/Util.java
M jsf-ri/src/javax/faces/Messages.properties
M jsf-ri/src/javax/faces/Messages_de.properties
M jsf-ri/src/javax/faces/Messages_es.properties
M jsf-ri/src/javax/faces/Messages_fr.properties
M jsf-ri/src/javax/faces/Messages_it.properties
M jsf-ri/src/javax/faces/Messages_ja.properties
M jsf-ri/src/javax/faces/Messages_ko.properties
M jsf-ri/src/javax/faces/Messages_sv.properties
M jsf-ri/src/javax/faces/Messages_zh_CN.properties
M jsf-ri/src/javax/faces/Messages_zh_TW.properties
M jsf-ri/test/com/sun/faces/util/TestUtil_messages.java
M jsf-tools/src/com/sun/faces/config/rules/ManagedBeanRule.java
M jsf-tools/src/com/sun/faces/config/rules/ManagedPropertyRule.java
A jsf-tools/src/com/sun/faces/resources/JsfToolsMessages.properties
A jsf-tools/src/com/sun/faces/resources/JsfToolsMessages_de.properties
A jsf-tools/src/com/sun/faces/resources/JsfToolsMessages_es.properties
A jsf-tools/src/com/sun/faces/resources/JsfToolsMessages_fr.properties
A jsf-tools/src/com/sun/faces/util/ToolsUtil.java
- for issue 167


SECTION: Diffs
----------------------------
Index: jsf-api/src/javax/faces/convert/NumberConverter.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-api/src/javax/faces/convert/NumberConverter.java,v
retrieving revision 1.19
diff -u -r1.19 NumberConverter.java
--- jsf-api/src/javax/faces/convert/NumberConverter.java 26 Feb 2004
20:30:50 -0000 1.19
+++ jsf-api/src/javax/faces/convert/NumberConverter.java 6 Nov 2005
00:19:58 -0000
@@ -452,16 +452,20 @@

// Create and configure the parser to be used
NumberFormat parser = getNumberFormat(locale);
+ if (((pattern != null) && !pattern.equals(""))
+ || "currency".equals(type)) {
+ configureCurrency(parser);
+ }
parser.setParseIntegerOnly(isIntegerOnly());

// Perform the requested parsing
return (parser.parse(value));

- } catch (ConverterException e) {
- throw e;
- } catch (ParseException e) {
+ } catch (ConverterException ce) {
+ throw ce;
+ } catch (Exception e) {
// PENDING(craigmcc) - i18n
- throw new ConverterException("Error parsing '" + value + "'");
+ throw new ConverterException(e.getCause());
}


Index: jsf-ri/build-tests.xml
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/build-tests.xml,v
retrieving revision 1.204
diff -u -r1.204 build-tests.xml
--- jsf-ri/build-tests.xml 16 Jun 2004 19:48:03 -0000 1.204
+++ jsf-ri/build-tests.xml 6 Nov 2005 00:20:03 -0000
@@ -342,7 +342,10 @@
<test todir="${test.results.dir}"
name="com.sun.faces.lifecycle.TestProcessEvents"/>
<test todir="${test.results.dir}"
name="com.sun.faces.lifecycle.TestProcessValidationsPhase"/>
<test todir="${test.results.dir}"
name="com.sun.faces.lifecycle.TestRenderResponsePhase"/>
- <test todir="${test.results.dir}"
name="com.sun.faces.lifecycle.TestRestoreViewPhase"/>
+ <!-- Commented out. This test relies heavily on a bug in
FacesContext.setViewRoot()
+ that allowed one to pass a null value in. This test case needs to be
revisited.
+ <test todir="${test.results.dir}"
name="com.sun.faces.lifecycle.TestRestoreViewPhase"/> -->
+
<test todir="${test.results.dir}"
name="com.sun.faces.lifecycle.TestUpdateModelValuesPhase"/>
<test todir="${test.results.dir}"
name="com.sun.faces.renderkit.html_basic.TestComponentType"/>
<test todir="${test.results.dir}"
name="com.sun.faces.renderkit.html_basic.TestHtmlResponseWriter"/>
Index: jsf-ri/build.xml
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/build.xml,v
retrieving revision 1.165
diff -u -r1.165 build.xml
--- jsf-ri/build.xml 17 Aug 2004 20:10:11 -0000 1.165
+++ jsf-ri/build.xml 6 Nov 2005 00:20:03 -0000
@@ -247,6 +247,7 @@
<fileset dir="${jsf-tools.dir}/src">
<include name="com/sun/faces/config/beans/*.java"/>
<include name="com/sun/faces/config/rules/*.java"/>
+ <include name="com/sun/faces/util/*.java"/>
</fileset>

<!-- Copy the generated tag classes and TLD -->
@@ -380,6 +381,7 @@

<copy todir="${build.classes}">
<fileset dir="${source.home}" includes="**/*.properties"/>
+ <fileset dir="${jsf-tools.dir}/src" includes="**/*.properties"/>
</copy>
<copy todir="${build.classes}">
<fileset dir="${source.home}" includes="**/*.xml"/>
Index: jsf-ri/src/com/sun/faces/standard-html-renderkit-impl.xml
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/standard-html-renderkit-impl.xml,v
retrieving revision 1.9
diff -u -r1.9 standard-html-renderkit-impl.xml
--- jsf-ri/src/com/sun/faces/standard-html-renderkit-impl.xml 4 Feb 2004
23:40:46 -0000 1.9
+++ jsf-ri/src/com/sun/faces/standard-html-renderkit-impl.xml 6 Nov 2005
00:20:03 -0000
@@ -15,7 +15,7 @@
<!ENTITY message-message-renderer-class
'com.sun.faces.renderkit.html_basic.MessageRenderer'>
<!ENTITY messages-messages-renderer-class
'com.sun.faces.renderkit.html_basic.MessagesRenderer'>
<!ENTITY output-label-renderer-class
'com.sun.faces.renderkit.html_basic.LabelRenderer'>
-<!ENTITY output-link-renderer-class
'com.sun.faces.renderkit.html_basic.LinkRenderer'>
+<!ENTITY output-link-renderer-class
'com.sun.faces.renderkit.html_basic.OutputLinkRenderer'>
<!ENTITY output-format-renderer-class
'com.sun.faces.renderkit.html_basic.OutputMessageRenderer'>
<!ENTITY output-text-renderer-class
'com.sun.faces.renderkit.html_basic.TextRenderer'>
<!ENTITY panel-grid-renderer-class
'com.sun.faces.renderkit.html_basic.GridRenderer'>
Index: jsf-ri/src/com/sun/faces/application/ApplicationAssociate.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/ApplicationAssociate.java,v
retrieving revision 1.3.26.1
diff -u -r1.3.26.1 ApplicationAssociate.java
--- jsf-ri/src/com/sun/faces/application/ApplicationAssociate.java 3 Feb
2005 18:13:39 -0000 1.3.26.1
+++ jsf-ri/src/com/sun/faces/application/ApplicationAssociate.java 6 Nov
2005 00:20:03 -0000
@@ -44,9 +44,7 @@

public class ApplicationAssociate extends Object {

- protected static Log log = LogFactory.getLog(ApplicationImpl.class);
-
- private ApplicationImpl app = null;
+ protected static Log log = LogFactory.getLog(ApplicationImpl.class);

//
// This map stores "managed bean name" | "managed bean factory"
@@ -93,8 +91,8 @@
*/
private InstancePool expressionInfoInstancePool;

- public ApplicationAssociate(ApplicationImpl appImpl) {
- app = appImpl;
+ public ApplicationAssociate() {
+
ExternalContext externalContext = null;
if (null == (externalContext =
ConfigureListener.getExternalContextDuringInitialize())) {
@@ -254,8 +252,7 @@
Object bean = null;
//add bean to appropriate scope
String scope = managedBean.getScope();
- //scope cannot be null
- Util.doAssert(null != scope);
+
if (log.isTraceEnabled()) {
log.trace("Storing " + managedBeanName + " in scope " + scope);
}
Index: jsf-ri/src/com/sun/faces/application/ApplicationImpl.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/ApplicationImpl.java,v
retrieving revision 1.52
diff -u -r1.52 ApplicationImpl.java
--- jsf-ri/src/com/sun/faces/application/ApplicationImpl.java 15 Jul
2004 18:08:31 -0000 1.52
+++ jsf-ri/src/com/sun/faces/application/ApplicationImpl.java 6 Nov 2005
00:20:03 -0000
@@ -92,7 +92,7 @@
*/
public ApplicationImpl() {
super();
- associate = new ApplicationAssociate(this);
+ associate = new ApplicationAssociate();
valueBindingMap = new HashMap();
componentMap = new HashMap();
converterIdMap = new HashMap();
Index: jsf-ri/src/com/sun/faces/config/ManagedBeanFactory.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/config/Attic/ManagedBeanFactory.java,v
retrieving revision 1.25
diff -u -r1.25 ManagedBeanFactory.java
--- jsf-ri/src/com/sun/faces/config/ManagedBeanFactory.java 2 Aug 2004
20:21:07 -0000 1.25
+++ jsf-ri/src/com/sun/faces/config/ManagedBeanFactory.java 6 Nov 2005
00:20:04 -0000
@@ -646,12 +646,11 @@
// the property has to be either a List or Array
if (!getterIsArray) {
if (null != propertyType &&
- !java.util.List.class.isAssignableFrom(propertyType)) {
- Object[] obj = new Object[1];
- obj[0] = propertyName;
+ !java.util.List.class.isAssignableFrom(propertyType)) {
throw new FacesException(Util.getExceptionMessageString(
- Util.CANT_INSTANTIATE_CLASS_ERROR_MESSAGE_ID,
- obj));
+ Util.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY_ID,
+ new Object[] { propertyName,
+ managedBean.getManagedBeanName() }));
}
}

@@ -672,12 +671,12 @@
} else {
// if what it returned was not a List
if (!(result instanceof List)) {
- // throw an exception
- Object[] obj = new Object[1];
- obj[0] = propertyName;
+ // throw an exception
throw new FacesException(
Util.getExceptionMessageString(
- Util.CANT_INSTANTIATE_CLASS_ERROR_MESSAGE_ID, obj));
+ Util.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST_ID,
+ new Object[] { propertyName,
+ managedBean.getManagedBeanName() }));
}
valuesForBean = (List) result;
}
@@ -779,17 +778,17 @@
}

if (null != propertyType &&
- !java.util.Map.class.isAssignableFrom(propertyType)) {
- Object[] obj = new Object[1];
- obj[0] = propertyName;
+ !java.util.Map.class.isAssignableFrom(propertyType)) {
throw new FacesException(Util.getExceptionMessageString(
- Util.CANT_INSTANTIATE_CLASS_ERROR_MESSAGE_ID,
- obj));
+ Util.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY_ID,
+ new Object[] { propertyName,
+ managedBean.getManagedBeanName() }));
}


if (getterIsNull) {
- result = new java.util.HashMap();
+ result = new java.util.HashMap(
+ property.getMapEntries().getMapEntries().length);
}

// at this point result contains the existing entries from the
@@ -839,8 +838,7 @@
if (null != value && null != valueType) {
if (valueType == Boolean.TYPE ||
valueType == java.lang.Boolean.class) {
- value = value.toString().toLowerCase().equals("true")
- ? Boolean.TRUE : Boolean.FALSE;
+ value = Boolean.valueOf(value.toString().toLowerCase());
} else if (valueType == Byte.TYPE ||
valueType == java.lang.Byte.class) {
value = new Byte(value.toString());
@@ -863,12 +861,15 @@
valueType == java.lang.Long.class) {
value = new Long(value.toString());
} else if (valueType == String.class) {
- } else if (!valueType.isAssignableFrom(value.getClass())) {
- Object[] obj = new Object[1];
- obj[0] = value.toString();
+ } else if (!valueType.isAssignableFrom(value.getClass())) {
throw new FacesException(Util.getExceptionMessageString(
- Util.CANT_INSTANTIATE_CLASS_ERROR_MESSAGE_ID,
- obj));
+ Util.MANAGED_BEAN_TYPE_CONVERSION_ERROR_ID,
+ new Object[] {
+ value.toString(),
+ value.getClass(),
+ valueType,
+ managedBean.getManagedBeanName()
+ }));

}
}
Index: jsf-ri/src/com/sun/faces/context/ExternalContextImpl.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/context/ExternalContextImpl.java,v
retrieving revision 1.26
diff -u -r1.26 ExternalContextImpl.java
--- jsf-ri/src/com/sun/faces/context/ExternalContextImpl.java 31 Mar
2004 18:48:27 -0000 1.26
+++ jsf-ri/src/com/sun/faces/context/ExternalContextImpl.java 6 Nov 2005
00:20:04 -0000
@@ -318,6 +318,10 @@
public void dispatch(String requestURI) throws IOException, FacesException {
RequestDispatcher requestDispatcher = request.getRequestDispatcher(
requestURI);
+ if (requestDispatcher == null) {
+ ((HttpServletResponse) response).sendError(
+ HttpServletResponse.SC_NOT_FOUND);
+ }
try {
requestDispatcher.forward(this.request, this.response);
} catch (IOException ioe) {
Index: jsf-ri/src/com/sun/faces/context/FacesContextImpl.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/context/FacesContextImpl.java,v
retrieving revision 1.66
diff -u -r1.66 FacesContextImpl.java
--- jsf-ri/src/com/sun/faces/context/FacesContextImpl.java 31 Mar 2004
18:48:27 -0000 1.66
+++ jsf-ri/src/com/sun/faces/context/FacesContextImpl.java 6 Nov 2005
00:20:04 -0000
@@ -250,6 +250,13 @@

public void setViewRoot(UIViewRoot root) {
assertNotReleased();
+
+ if (root == null) {
+ throw new NullPointerException
+ (Util.getExceptionMessageString(
+ Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
+ }
+
if (viewRoot != root) {
facesEvents = null;
}
Index:
jsf-ri/src/com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java,v
retrieving revision 1.22.26.1
diff -u -r1.22.26.1 CommandLinkRenderer.java
---
jsf-ri/src/com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java
29 Aug 2005 22:49:33 -0000 1.22.26.1
+++
jsf-ri/src/com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java 6
Nov 2005 00:20:05 -0000
@@ -11,16 +11,11 @@

package com.sun.faces.renderkit.html_basic;

-import com.sun.faces.util.Util;
-import com.sun.faces.RIConstants;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import javax.faces.component.NamingContainer;
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.component.UIForm;
import javax.faces.component.UIViewRoot;
-import javax.faces.component.NamingContainer;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.event.ActionEvent;
@@ -29,12 +24,17 @@
import java.util.Iterator;
import java.util.Map;

+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.sun.faces.util.Util;
+
/**
* <B>CommandLinkRenderer</B> is a class that renders the current value of
* <code>UICommand<code> as a HyperLink that acts like a Button.
*/

-public class CommandLinkRenderer extends HtmlBasicRenderer {
+public class CommandLinkRenderer extends LinkRenderer {

//
// Protected Constants
@@ -222,13 +222,8 @@

sb.append("; return false;");
writer.writeAttribute("onclick", sb.toString(), "onclick");
-
- //handle css style class
- String styleClass = (String)
- command.getAttributes().get("styleClass");
- if (styleClass != null) {
- writer.writeAttribute("class", styleClass, "styleClass");
- }
+
+ writeCommonLinkAttributes(writer, command);

// render the current value as link text.
String label = null;
Index: jsf-ri/src/com/sun/faces/renderkit/html_basic/LinkRenderer.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/LinkRenderer.java,v
retrieving revision 1.10
diff -u -r1.10 LinkRenderer.java
--- jsf-ri/src/com/sun/faces/renderkit/html_basic/LinkRenderer.java 31
Mar 2004 18:48:37 -0000 1.10
+++ jsf-ri/src/com/sun/faces/renderkit/html_basic/LinkRenderer.java 6
Nov 2005 00:20:05 -0000
@@ -11,12 +11,8 @@

package com.sun.faces.renderkit.html_basic;

-import com.sun.faces.util.Util;
-
-import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIOutput;
-import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;

import java.io.IOException;

@@ -26,103 +22,30 @@
* OutputLinkRenderer.
*/

-public class LinkRenderer extends HtmlBasicRenderer {
-
- //
- // Protected Constants
- //
- // Separator character
- private final char QUOTE = '\"';
-
-
- //
- // Class Variables
- //
-
- //
- // Instance Variables
- //
-
- // Attribute Instance Variables
-
-
- // Relationship Instance Variables
-
- protected CommandLinkRenderer commandLinkRenderer = null;
-
- protected OutputLinkRenderer outputLinkRenderer = null;
-
- //
- // Constructors and Initializers
- //
-
- public LinkRenderer() {
- commandLinkRenderer = new CommandLinkRenderer();
- outputLinkRenderer = new OutputLinkRenderer();
- }
-
- //
- // Class methods
- //
-
- //
- // General Methods
- //
-
- //
- // Methods From Renderer
- //
-
- public boolean getRendersChildren() {
- return true;
- }
+public abstract class LinkRenderer extends HtmlBasicRenderer {

-
- public void decode(FacesContext context, UIComponent component) {
- if (context == null || component == null) {
- throw new NullPointerException(Util.getExceptionMessageString(
- Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
- }
-
- if (component instanceof UICommand) {
- commandLinkRenderer.decode(context, component);
- } else if (component instanceof UIOutput) {
- outputLinkRenderer.decode(context, component);
+
+ // ------------------------------------------------------- Protected
Methods
+
+ protected void writeCommonLinkAttributes(ResponseWriter writer,
+ UIComponent component)
+ throws IOException {
+
+ // render type attribute that is common only to link renderers
+ String type = (String) component.getAttributes().get("type");
+
+ if (type != null) {
+ writer.writeAttribute("type", type, "type");
+ }
+
+ // handle styleClass
+ String styleClass = (String)
+ component.getAttributes().get("styleClass");
+ if (styleClass != null) {
+ writer.writeAttribute("class", styleClass, "styleClass");
}
- return;
}

-
- public void encodeBegin(FacesContext context, UIComponent component)
- throws IOException {
- if (context == null || component == null) {
- throw new NullPointerException(
- Util.getExceptionMessageString(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
- }
-
- if (component instanceof UICommand) {
- commandLinkRenderer.encodeBegin(context, component);
- } else if (component instanceof UIOutput) {
- outputLinkRenderer.encodeBegin(context, component);
- }
- return;
- }
-
-
- public void encodeEnd(FacesContext context, UIComponent component)
- throws IOException {
- if (context == null || component == null) {
- throw new NullPointerException(
- Util.getExceptionMessageString(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
- }
-
- if (component instanceof UICommand) {
- commandLinkRenderer.encodeEnd(context, component);
- } else if (component instanceof UIOutput) {
- outputLinkRenderer.encodeEnd(context, component);
- }
-
- return;
- }
+

} // end of class LinkRenderer
Index: jsf-ri/src/com/sun/faces/renderkit/html_basic/OutputLinkRenderer.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/OutputLinkRenderer.java,v
retrieving revision 1.15
diff -u -r1.15 OutputLinkRenderer.java
---
jsf-ri/src/com/sun/faces/renderkit/html_basic/OutputLinkRenderer.java 31
Mar 2004 18:48:38 -0000 1.15
+++
jsf-ri/src/com/sun/faces/renderkit/html_basic/OutputLinkRenderer.java 6
Nov 2005 00:20:05 -0000
@@ -32,7 +32,7 @@
* @version $Id: OutputLinkRenderer.java,v 1.15 2004/03/31 18:48:38
eburns Exp $
*/

-public class OutputLinkRenderer extends HtmlBasicRenderer {
+public class OutputLinkRenderer extends LinkRenderer {

//
// Protected Constants
@@ -165,12 +165,7 @@
Util.renderPassThruAttributes(writer, component);
Util.renderBooleanPassThruAttributes(writer, component);

- //handle css style class
- String styleClass = (String)
- output.getAttributes().get("styleClass");
- if (styleClass != null) {
- writer.writeAttribute("class", styleClass, "styleClass");
- }
+ writeCommonLinkAttributes(writer, component);
writer.flush();

}
Index: jsf-ri/src/com/sun/faces/taglib/html_basic/HtmlBasicValidator.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/taglib/html_basic/HtmlBasicValidator.java,v
retrieving revision 1.10
diff -u -r1.10 HtmlBasicValidator.java
--- jsf-ri/src/com/sun/faces/taglib/html_basic/HtmlBasicValidator.java
26 Jul 2004 21:12:44 -0000 1.10
+++ jsf-ri/src/com/sun/faces/taglib/html_basic/HtmlBasicValidator.java 6
Nov 2005 00:20:05 -0000
@@ -71,9 +71,7 @@
}


- protected String getFailureMessage(String prefix, String uri) {
- // we should only get called if this Validator failed
- Util.doAssert(failed);
+ protected String getFailureMessage(String prefix, String uri) {

StringBuffer result = new StringBuffer();
if (commandTagParser.hasFailed()) {
Index: jsf-ri/src/com/sun/faces/taglib/jsf_core/ViewTag.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/taglib/jsf_core/ViewTag.java,v
retrieving revision 1.26
diff -u -r1.26 ViewTag.java
--- jsf-ri/src/com/sun/faces/taglib/jsf_core/ViewTag.java 5 Aug 2004
20:02:19 -0000 1.26
+++ jsf-ri/src/com/sun/faces/taglib/jsf_core/ViewTag.java 6 Nov 2005
00:20:05 -0000
@@ -237,8 +237,7 @@
/**
* This should never get called for PageTag.
*/
- public String getComponentType() {
- Util.doAssert(false);
+ public String getComponentType() {
throw new IllegalStateException();
}

@@ -295,8 +294,8 @@
* two-letter (lower-case) language code (as defined by
* ISO-639), and may contain a two-letter (upper-case)
* country code (as defined by ISO-3166). Language and
- * country codes must be separated by hyphen (�-�) or
- * underscore (�_�)."
+ * country codes must be separated by hyphen (???-???) or
+ * underscore (???_???)."
* @return Locale instance cosntructed from the expression.
*/
protected Locale getLocaleFromString(String localeExpr) {
Index: jsf-ri/src/com/sun/faces/util/Util.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/util/Util.java,v
retrieving revision 1.143.6.1
diff -u -r1.143.6.1 Util.java
--- jsf-ri/src/com/sun/faces/util/Util.java 1 Feb 2005 22:43:54 -0000
1.143.6.1
+++ jsf-ri/src/com/sun/faces/util/Util.java 6 Nov 2005 00:20:05 -0000
@@ -291,6 +291,18 @@

public static final String NO_DTD_FOUND_ERROR_ID =
"com.sun.faces.NO_DTD_FOUND_ERROR";
+
+ public static final String
MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY_ID =
+ "com.sun.faces.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY";
+
+ public static final String MANAGED_BEAN_EXISTING_VALUE_NOT_LIST_ID =
+ "com.sun.faces.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST";
+
+ public static final String MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY_ID =
+ "com.sun.faces.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY";
+
+ public static final String MANAGED_BEAN_TYPE_CONVERSION_ERROR_ID =
+ "com.sun.faces.MANAGED_BEAN_TYPE_CONVERSION_ERROR";


// README - make sure to add the message identifier constant
Index: jsf-ri/src/javax/faces/Messages.properties
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/javax/faces/Messages.properties,v
retrieving revision 1.17
diff -u -r1.17 Messages.properties
--- jsf-ri/src/javax/faces/Messages.properties 26 Jul 2004 21:12:45
-0000 1.17
+++ jsf-ri/src/javax/faces/Messages.properties 6 Nov 2005 00:20:05 -0000
@@ -105,6 +105,13 @@
com.sun.faces.INVALID_SCOPE_LIFESPAN=The scope of the referenced object:
''{0}'' is shorter than the referring object
com.sun.faces.LIFECYCLE_ID_ALREADY_ADDED=LifecycleId already added for
id: ''{0}''.
com.sun.faces.LIFECYCLE_ID_NOT_FOUND=LifecycleId not found for id ''{0}''.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY=Unable to set
target property ''{0}'' in managed bean ''{1}''. The property must
accept either List or Array instances.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY=Unable to set target
property ''{0}'' in managed bean ''{1}''. The property must accept Map
instances.
+com.sun.faces.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST=Unable to set target
property ''{0}'' in managed bean ''{1}''. The target property returned
an existing value that was not an instance of List.
+com.sun.faces.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with list entries, but has illegally defined a value and/or map
entries.
+com.sun.faces.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with map entries, but has illegally defined a value as well.
+com.sun.faces.MANAGED_BEAN_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a property
containing no list or map entires, nor any value elements.
+com.sun.faces.MANAGED_BEAN_TYPE_CONVERSION_ERROR=Error performing
conversion of value ''{0}'' of type ''{1}'' to type ''{2}'' for managed
bean ''{3}''.
com.sun.faces.MAXIMUM_EVENTS_REACHED=Maximum number of events ''{0}''
reached.
com.sun.faces.MISSING_CLASS_ERROR=Missing Class: Can''t load class ''{0}''.
com.sun.faces.MISSING_RESOURCE_ERROR=Missing Resource: Can''t get
ResourceBundle.
Index: jsf-ri/src/javax/faces/Messages_de.properties
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/javax/faces/Messages_de.properties,v
retrieving revision 1.16.14.1
diff -u -r1.16.14.1 Messages_de.properties
--- jsf-ri/src/javax/faces/Messages_de.properties 17 Oct 2005 22:18:15
-0000 1.16.14.1
+++ jsf-ri/src/javax/faces/Messages_de.properties 6 Nov 2005 00:20:05 -0000
@@ -153,6 +153,13 @@
com.sun.faces.LIFECYCLE_ID_ALREADY_ADDED=LifecycleID wurde bereits zu
folgender ID hinzugef\u00fcgt: ''{0}''.
#EN: LifecycleId not found for id ''{0}''.
com.sun.faces.LIFECYCLE_ID_NOT_FOUND=LifecycleID f\u00fcr ID ''{0}''
nicht gefunden.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY=Unable to set
target property ''{0}'' in managed bean ''{1}''. The property must
accept either List or Array instances.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY=Unable to set target
property ''{0}'' in managed bean ''{1}''. The property must accept Map
instances.
+com.sun.faces.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST=Unable to set target
property ''{0}'' in managed bean ''{1}''. The target property returned
an existing value that was not an instance of List.
+com.sun.faces.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with list entries, but has illegally defined a value and/or map
entries.
+com.sun.faces.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with map entries, but has illegally defined a value as well.
+com.sun.faces.MANAGED_BEAN_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a property
containing no list or map entires, nor any value elements.
+com.sun.faces.MANAGED_BEAN_TYPE_CONVERSION_ERROR=Error performing
conversion of value ''{0}'' of type ''{1}'' to type ''{2}'' for managed
bean ''{3}''.
#EN: Maximum number of events ''{0}'' reached.
com.sun.faces.MAXIMUM_EVENTS_REACHED=Maximale Anzahl an Ereignissen
''{0}'' erreicht.
#EN: Missing Class: Can''t load class ''{0}''.
Index: jsf-ri/src/javax/faces/Messages_es.properties
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/javax/faces/Messages_es.properties,v
retrieving revision 1.16.14.1
diff -u -r1.16.14.1 Messages_es.properties
--- jsf-ri/src/javax/faces/Messages_es.properties 17 Oct 2005 22:18:15
-0000 1.16.14.1
+++ jsf-ri/src/javax/faces/Messages_es.properties 6 Nov 2005 00:20:05 -0000
@@ -153,6 +153,13 @@
com.sun.faces.LIFECYCLE_ID_ALREADY_ADDED=LifecycleId ya se ha agregado
para el Id.: ''{0}''.
#EN: LifecycleId not found for id ''{0}''.
com.sun.faces.LIFECYCLE_ID_NOT_FOUND=LifecycleId no se encuentra para el
Id. ''{0}''.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY=Unable to set
target property ''{0}'' in managed bean ''{1}''. The property must
accept either List or Array instances.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY=Unable to set target
property ''{0}'' in managed bean ''{1}''. The property must accept Map
instances.
+com.sun.faces.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST=Unable to set target
property ''{0}'' in managed bean ''{1}''. The target property returned
an existing value that was not an instance of List.
+com.sun.faces.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with list entries, but has illegally defined a value and/or map
entries.
+com.sun.faces.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with map entries, but has illegally defined a value as well.
+com.sun.faces.MANAGED_BEAN_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a property
containing no list or map entires, nor any value elements.
+com.sun.faces.MANAGED_BEAN_TYPE_CONVERSION_ERROR=Error performing
conversion of value ''{0}'' of type ''{1}'' to type ''{2}'' for managed
bean ''{3}''.
#EN: Maximum number of events ''{0}'' reached.
com.sun.faces.MAXIMUM_EVENTS_REACHED=Se ha alcanzado el n\u00famero
m\u00e1ximo de eventos ''{0}''.
#EN: Missing Class: Can''t load class ''{0}''.
Index: jsf-ri/src/javax/faces/Messages_fr.properties
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/javax/faces/Messages_fr.properties,v
retrieving revision 1.15.14.1
diff -u -r1.15.14.1 Messages_fr.properties
--- jsf-ri/src/javax/faces/Messages_fr.properties 17 Oct 2005 22:18:15
-0000 1.15.14.1
+++ jsf-ri/src/javax/faces/Messages_fr.properties 6 Nov 2005 00:20:05 -0000
@@ -153,6 +153,13 @@
com.sun.faces.LIFECYCLE_ID_ALREADY_ADDED=LifecycleId d\u00e9j\u00e0
ajout\u00e9 pour l''id : ''{0}''.
#EN: LifecycleId not found for id ''{0}''.
com.sun.faces.LIFECYCLE_ID_NOT_FOUND=LifecycleId introuvable pour l''id
''{0}''.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY=Unable to set
target property ''{0}'' in managed bean ''{1}''. The property must
accept either List or Array instances.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY=Unable to set target
property ''{0}'' in managed bean ''{1}''. The property must accept Map
instances.
+com.sun.faces.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST=Unable to set target
property ''{0}'' in managed bean ''{1}''. The target property returned
an existing value that was not an instance of List.
+com.sun.faces.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with list entries, but has illegally defined a value and/or map
entries.
+com.sun.faces.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with map entries, but has illegally defined a value as well.
+com.sun.faces.MANAGED_BEAN_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a property
containing no list or map entires, nor any value elements.
+com.sun.faces.MANAGED_BEAN_TYPE_CONVERSION_ERROR=Error performing
conversion of value ''{0}'' of type ''{1}'' to type ''{2}'' for managed
bean ''{3}''.
#EN: Maximum number of events ''{0}'' reached.
com.sun.faces.MAXIMUM_EVENTS_REACHED=Nombre maximal
d''\u00e9v\u00e9nements ''{0}'' atteint.
#EN: Missing Class: Can''t load class ''{0}''.
Index: jsf-ri/src/javax/faces/Messages_it.properties
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/javax/faces/Attic/Messages_it.properties,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 Messages_it.properties
--- jsf-ri/src/javax/faces/Messages_it.properties 17 Oct 2005 22:18:16
-0000 1.1.2.1
+++ jsf-ri/src/javax/faces/Messages_it.properties 6 Nov 2005 00:20:05 -0000
@@ -153,6 +153,13 @@
com.sun.faces.LIFECYCLE_ID_ALREADY_ADDED=LifecycleId gi\u00e0 aggiunto
per l''id: ''{0}''.
#EN: LifecycleId not found for id ''{0}''.
com.sun.faces.LIFECYCLE_ID_NOT_FOUND=LifecycleId non trovato per l''id
''{0}''.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY=Unable to set
target property ''{0}'' in managed bean ''{1}''. The property must
accept either List or Array instances.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY=Unable to set target
property ''{0}'' in managed bean ''{1}''. The property must accept Map
instances.
+com.sun.faces.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST=Unable to set target
property ''{0}'' in managed bean ''{1}''. The target property returned
an existing value that was not an instance of List.
+com.sun.faces.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with list entries, but has illegally defined a value and/or map
entries.
+com.sun.faces.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with map entries, but has illegally defined a value as well.
+com.sun.faces.MANAGED_BEAN_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a property
containing no list or map entires, nor any value elements.
+com.sun.faces.MANAGED_BEAN_TYPE_CONVERSION_ERROR=Error performing
conversion of value ''{0}'' of type ''{1}'' to type ''{2}'' for managed
bean ''{3}''.
#EN: Maximum number of events ''{0}'' reached.
com.sun.faces.MAXIMUM_EVENTS_REACHED=Raggiunto il numero massimo di
eventi ''{0}''.
#EN: Missing Class: Can''t load class ''{0}''.
Index: jsf-ri/src/javax/faces/Messages_ja.properties
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/javax/faces/Attic/Messages_ja.properties,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 Messages_ja.properties
--- jsf-ri/src/javax/faces/Messages_ja.properties 17 Oct 2005 22:18:16
-0000 1.1.2.1
+++ jsf-ri/src/javax/faces/Messages_ja.properties 6 Nov 2005 00:20:05 -0000
@@ -153,6 +153,13 @@
com.sun.faces.LIFECYCLE_ID_ALREADY_ADDED=ID: ''{0}'' \u306e LifecycleId
\u306f\u3059\u3067\u306b\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002
#EN: LifecycleId not found for id ''{0}''.
com.sun.faces.LIFECYCLE_ID_NOT_FOUND=ID ''{0}'' \u306e LifecycleId
\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY=Unable to set
target property ''{0}'' in managed bean ''{1}''. The property must
accept either List or Array instances.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY=Unable to set target
property ''{0}'' in managed bean ''{1}''. The property must accept Map
instances.
+com.sun.faces.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST=Unable to set target
property ''{0}'' in managed bean ''{1}''. The target property returned
an existing value that was not an instance of List.
+com.sun.faces.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with list entries, but has illegally defined a value and/or map
entries.
+com.sun.faces.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with map entries, but has illegally defined a value as well.
+com.sun.faces.MANAGED_BEAN_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a property
containing no list or map entires, nor any value elements.
+com.sun.faces.MANAGED_BEAN_TYPE_CONVERSION_ERROR=Error performing
conversion of value ''{0}'' of type ''{1}'' to type ''{2}'' for managed
bean ''{3}''.
#EN: Maximum number of events ''{0}'' reached.
com.sun.faces.MAXIMUM_EVENTS_REACHED=\u30a4\u30d9\u30f3\u30c8 ''{0}''
\u306e\u6700\u5927\u6570\u306b\u9054\u3057\u307e\u3057\u305f\u3002
#EN: Missing Class: Can''t load class ''{0}''.
Index: jsf-ri/src/javax/faces/Messages_ko.properties
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/javax/faces/Attic/Messages_ko.properties,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 Messages_ko.properties
--- jsf-ri/src/javax/faces/Messages_ko.properties 17 Oct 2005 22:18:17
-0000 1.1.2.1
+++ jsf-ri/src/javax/faces/Messages_ko.properties 6 Nov 2005 00:20:05 -0000
@@ -153,6 +153,13 @@
com.sun.faces.LIFECYCLE_ID_ALREADY_ADDED=ID\uc5d0 \ub300\ud574
LifecycleId\uac00 \uc774\ubbf8
\ucd94\uac00\ub418\uc5c8\uc2b5\ub2c8\ub2e4: \"{0}\".
#EN: LifecycleId not found for id ''{0}''.
com.sun.faces.LIFECYCLE_ID_NOT_FOUND=ID \"{0}\"\uc5d0 \ub300\ud55c
LifecycleId\uc774 \uc5c6\uc2b5\ub2c8\ub2e4.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY=Unable to set
target property ''{0}'' in managed bean ''{1}''. The property must
accept either List or Array instances.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY=Unable to set target
property ''{0}'' in managed bean ''{1}''. The property must accept Map
instances.
+com.sun.faces.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST=Unable to set target
property ''{0}'' in managed bean ''{1}''. The target property returned
an existing value that was not an instance of List.
+com.sun.faces.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with list entries, but has illegally defined a value and/or map
entries.
+com.sun.faces.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with map entries, but has illegally defined a value as well.
+com.sun.faces.MANAGED_BEAN_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a property
containing no list or map entires, nor any value elements.
+com.sun.faces.MANAGED_BEAN_TYPE_CONVERSION_ERROR=Error performing
conversion of value ''{0}'' of type ''{1}'' to type ''{2}'' for managed
bean ''{3}''.
#EN: Maximum number of events ''{0}'' reached.
com.sun.faces.MAXIMUM_EVENTS_REACHED=\uc774\ubca4\ud2b8
\"{0}\"\uc774(\uac00) \ucd5c\ub300 \uc218\uc5d0
\ub3c4\ub2ec\ud588\uc2b5\ub2c8\ub2e4.
#EN: Missing Class: Can''t load class ''{0}''.
Index: jsf-ri/src/javax/faces/Messages_sv.properties
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/javax/faces/Attic/Messages_sv.properties,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 Messages_sv.properties
--- jsf-ri/src/javax/faces/Messages_sv.properties 17 Oct 2005 22:18:17
-0000 1.1.2.1
+++ jsf-ri/src/javax/faces/Messages_sv.properties 6 Nov 2005 00:20:05 -0000
@@ -153,6 +153,13 @@
com.sun.faces.LIFECYCLE_ID_ALREADY_ADDED=LifecycleId har redan lagts
till f\u00f6r ID:t: ''{0}''.
#EN: LifecycleId not found for id ''{0}''.
com.sun.faces.LIFECYCLE_ID_NOT_FOUND=Inget LifecycleId hittades f\u00f6r
ID:t ''{0}''.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY=Unable to set
target property ''{0}'' in managed bean ''{1}''. The property must
accept either List or Array instances.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY=Unable to set target
property ''{0}'' in managed bean ''{1}''. The property must accept Map
instances.
+com.sun.faces.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST=Unable to set target
property ''{0}'' in managed bean ''{1}''. The target property returned
an existing value that was not an instance of List.
+com.sun.faces.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with list entries, but has illegally defined a value and/or map
entries.
+com.sun.faces.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with map entries, but has illegally defined a value as well.
+com.sun.faces.MANAGED_BEAN_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a property
containing no list or map entires, nor any value elements.
+com.sun.faces.MANAGED_BEAN_TYPE_CONVERSION_ERROR=Error performing
conversion of value ''{0}'' of type ''{1}'' to type ''{2}'' for managed
bean ''{3}''.
#EN: Maximum number of events ''{0}'' reached.
com.sun.faces.MAXIMUM_EVENTS_REACHED=Det maximala antalet h\u00e4ndelser
(''{0}'') uppn\u00e5ddes.
#EN: Missing Class: Can''t load class ''{0}''.
Index: jsf-ri/src/javax/faces/Messages_zh_CN.properties
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/javax/faces/Attic/Messages_zh_CN.properties,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 Messages_zh_CN.properties
--- jsf-ri/src/javax/faces/Messages_zh_CN.properties 17 Oct 2005
22:18:18 -0000 1.1.2.1
+++ jsf-ri/src/javax/faces/Messages_zh_CN.properties 6 Nov 2005 00:20:05
-0000
@@ -153,6 +153,13 @@
com.sun.faces.LIFECYCLE_ID_ALREADY_ADDED=\u5df2\u4e3a id
\u6dfb\u52a0\u4e86 LifecycleId: \"{0}\"\u3002
#EN: LifecycleId not found for id ''{0}''.
com.sun.faces.LIFECYCLE_ID_NOT_FOUND=\u627e\u4e0d\u5230 id \"{0}\"
\u7684 LifecycleId\u3002
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY=Unable to set
target property ''{0}'' in managed bean ''{1}''. The property must
accept either List or Array instances.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY=Unable to set target
property ''{0}'' in managed bean ''{1}''. The property must accept Map
instances.
+com.sun.faces.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST=Unable to set target
property ''{0}'' in managed bean ''{1}''. The target property returned
an existing value that was not an instance of List.
+com.sun.faces.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with list entries, but has illegally defined a value and/or map
entries.
+com.sun.faces.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with map entries, but has illegally defined a value as well.
+com.sun.faces.MANAGED_BEAN_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a property
containing no list or map entires, nor any value elements.
+com.sun.faces.MANAGED_BEAN_TYPE_CONVERSION_ERROR=Error performing
conversion of value ''{0}'' of type ''{1}'' to type ''{2}'' for managed
bean ''{3}''.
#EN: Maximum number of events ''{0}'' reached.
com.sun.faces.MAXIMUM_EVENTS_REACHED=\u8fbe\u5230\u4e86\u4e8b\u4ef6
\"{0}\" \u7684\u6700\u5927\u6570\u76ee\u3002
#EN: Missing Class: Can''t load class ''{0}''.
Index: jsf-ri/src/javax/faces/Messages_zh_TW.properties
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/javax/faces/Attic/Messages_zh_TW.properties,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 Messages_zh_TW.properties
--- jsf-ri/src/javax/faces/Messages_zh_TW.properties 17 Oct 2005
22:18:19 -0000 1.1.2.1
+++ jsf-ri/src/javax/faces/Messages_zh_TW.properties 6 Nov 2005 00:20:05
-0000
@@ -153,6 +153,13 @@
com.sun.faces.LIFECYCLE_ID_ALREADY_ADDED=\u5df2\u70ba
id:\u300c{0}\u300d\u589e\u52a0 LifecycleId\u3002
#EN: LifecycleId not found for id ''{0}''.
com.sun.faces.LIFECYCLE_ID_NOT_FOUND=\u627e\u4e0d\u5230
id\u300c{0}\u300d\u7684 LifecycleId\u3002
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY=Unable to set
target property ''{0}'' in managed bean ''{1}''. The property must
accept either List or Array instances.
+com.sun.faces.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY=Unable to set target
property ''{0}'' in managed bean ''{1}''. The property must accept Map
instances.
+com.sun.faces.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST=Unable to set target
property ''{0}'' in managed bean ''{1}''. The target property returned
an existing value that was not an instance of List.
+com.sun.faces.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with list entries, but has illegally defined a value and/or map
entries.
+com.sun.faces.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a managed
property with map entries, but has illegally defined a value as well.
+com.sun.faces.MANAGED_BEAN_PROPERTY_CONFIG_ERROR=Incorrect
configuration for managed bean ''{0}''. Managed bean contains a property
containing no list or map entires, nor any value elements.
+com.sun.faces.MANAGED_BEAN_TYPE_CONVERSION_ERROR=Error performing
conversion of value ''{0}'' of type ''{1}'' to type ''{2}'' for managed
bean ''{3}''.
#EN: Maximum number of events ''{0}'' reached.
com.sun.faces.MAXIMUM_EVENTS_REACHED=\u5df2\u9054\u5230\u4e8b\u4ef6\u7684\u6700\u5927\u6578\u76ee\u300c{0}\u300d\u3002
#EN: Missing Class: Can''t load class ''{0}''.
Index: jsf-ri/test/com/sun/faces/application/TestViewHandlerImpl.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/application/TestViewHandlerImpl.java,v
retrieving revision 1.21.26.1
diff -u -r1.21.26.1 TestViewHandlerImpl.java
--- jsf-ri/test/com/sun/faces/application/TestViewHandlerImpl.java 29
Aug 2005 22:49:37 -0000 1.21.26.1
+++ jsf-ri/test/com/sun/faces/application/TestViewHandlerImpl.java 6 Nov
2005 00:20:06 -0000
@@ -385,8 +385,7 @@
public void testTransient() {

// precreate tree and set it in session and make sure the tree is
- // restored from session.
- getFacesContext().setViewRoot(null);
+ // restored from session.
UIViewRoot root =
Util.getViewHandler(getFacesContext()).createView(getFacesContext(), null);
root.setViewId(TEST_URI);

Index: jsf-ri/test/com/sun/faces/lifecycle/TestProcessEvents.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/lifecycle/TestProcessEvents.java,v
retrieving revision 1.18
diff -u -r1.18 TestProcessEvents.java
--- jsf-ri/test/com/sun/faces/lifecycle/TestProcessEvents.java 7 Apr
2004 17:52:53 -0000 1.18
+++ jsf-ri/test/com/sun/faces/lifecycle/TestProcessEvents.java 6 Nov
2005 00:20:07 -0000
@@ -90,8 +90,7 @@
}


- public void tearDown() {
- getFacesContext().setViewRoot(null);
+ public void tearDown() {
super.tearDown();
}

Index: jsf-ri/test/com/sun/faces/lifecycle/TestSaveStateInPage.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/lifecycle/TestSaveStateInPage.java,v
retrieving revision 1.28
diff -u -r1.28 TestSaveStateInPage.java
--- jsf-ri/test/com/sun/faces/lifecycle/TestSaveStateInPage.java 7 Apr
2004 17:52:56 -0000 1.28
+++ jsf-ri/test/com/sun/faces/lifecycle/TestSaveStateInPage.java 6 Nov
2005 00:20:07 -0000
@@ -126,8 +126,7 @@
// PENDING (visvan) add test case to make sure no state is saved when
// root is marked transient.
// precreate tree and set it in session and make sure the tree is
- // restored from session.
- getFacesContext().setViewRoot(null);
+ // restored from session.
UIViewRoot root =
Util.getViewHandler(getFacesContext()).createView(getFacesContext(), null);
root.setViewId(TEST_URI);

Index: jsf-ri/test/com/sun/faces/renderkit/html_basic/TestRenderers_1.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/renderkit/html_basic/TestRenderers_1.java,v
retrieving revision 1.61
diff -u -r1.61 TestRenderers_1.java
--- jsf-ri/test/com/sun/faces/renderkit/html_basic/TestRenderers_1.java
20 Jul 2004 21:54:50 -0000 1.61
+++ jsf-ri/test/com/sun/faces/renderkit/html_basic/TestRenderers_1.java
6 Nov 2005 00:20:07 -0000
@@ -187,7 +187,7 @@
// Provide attributes for all possible lookups
// make sure that valueRef is returned and no others.
System.out.println("Testing Link Renderer...");
- LinkRenderer linkRenderer = new LinkRenderer();
+ LinkRenderer linkRenderer = new OutputLinkRenderer();
UIOutput uiOutput = new UIOutput();
UIOutput output = new UIOutput();
uiOutput.setId("labelLink1");
@@ -313,7 +313,7 @@
// Provide attributes for all possible lookups
// make sure that valueRef is returned and no others.
System.out.println("Testing Link Renderer...");
- LinkRenderer linkRenderer = new LinkRenderer();
+ LinkRenderer linkRenderer = new CommandLinkRenderer();
UICommand uiCommand = new UICommand();
UIOutput output = new UIOutput();
UIForm form = new UIForm();
Index: jsf-ri/test/com/sun/faces/renderkit/html_basic/TestRenderers_2.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/renderkit/html_basic/TestRenderers_2.java,v
retrieving revision 1.84.26.1
diff -u -r1.84.26.1 TestRenderers_2.java
--- jsf-ri/test/com/sun/faces/renderkit/html_basic/TestRenderers_2.java
26 Oct 2005 19:36:54 -0000 1.84.26.1
+++ jsf-ri/test/com/sun/faces/renderkit/html_basic/TestRenderers_2.java
6 Nov 2005 00:20:07 -0000
@@ -298,7 +298,7 @@
command.setRendererType("Link");
root.getChildren().add(command);

- LinkRenderer hyperlinkRenderer = new LinkRenderer();
+ LinkRenderer hyperlinkRenderer = new CommandLinkRenderer();

System.out.println(" Testing decode method...");
hyperlinkRenderer.decode(getFacesContext(), command);
Index: jsf-ri/test/com/sun/faces/util/TestUtil_messages.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/util/TestUtil_messages.java,v
retrieving revision 1.35
diff -u -r1.35 TestUtil_messages.java
--- jsf-ri/test/com/sun/faces/util/TestUtil_messages.java 26 Jul 2004
21:12:46 -0000 1.35
+++ jsf-ri/test/com/sun/faces/util/TestUtil_messages.java 6 Nov 2005
00:20:07 -0000
@@ -111,7 +111,23 @@
{Util.ASSERTION_FAILED_ID, "0"},
{Util.OBJECT_CREATION_ERROR_ID, "0"},
{Util.CYCLIC_REFERENCE_ERROR_ID, "1"},
- {Util.NO_DTD_FOUND_ERROR_ID, "2"}
+ {Util.NO_DTD_FOUND_ERROR_ID, "2"},
+ {Util.MANAGED_BEAN_CANNOT_SET_LIST_ARRAY_PROPERTY_ID, "2"},
+ {Util.MANAGED_BEAN_EXISTING_VALUE_NOT_LIST_ID, "2"},
+ {Util.MANAGED_BEAN_CANNOT_SET_MAP_PROPERTY_ID, "2"},
+ {Util.MANAGED_BEAN_TYPE_CONVERSION_ERROR_ID, "4"},
+ };
+
+ private String[][] toolsMessageInfo = {
+ {ToolsUtil.MANAGED_BEAN_AS_LIST_CONFIG_ERROR_ID, "1"},
+ {ToolsUtil.MANAGED_BEAN_AS_MAP_CONFIG_ERROR_ID, "1"},
+ {ToolsUtil.MANAGED_BEAN_NO_MANAGED_BEAN_CLASS_ID, "1"},
+ {ToolsUtil.MANAGED_BEAN_NO_MANAGED_BEAN_NAME_ID, "2"},
+ {ToolsUtil.MANAGED_BEAN_NO_MANAGED_BEAN_SCOPE_ID, "1"},
+ {ToolsUtil.MANAGED_BEAN_INVALID_SCOPE_ID, "2"},
+ {ToolsUtil.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR_ID, "2"},
+ {ToolsUtil.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR_ID, "2"},
+ {ToolsUtil.MANAGED_BEAN_PROPERTY_CONFIG_ERROR_ID, "2"},
};

// Attribute Instance Variables
@@ -178,11 +194,43 @@
verifyParamsInMessages(messageInfo);
}

+ public void testVerifyToolsMessages() {
+ System.out.println("Verifying ToolsUtil messages");
+ verifyParamsInToolsMessages(toolsMessageInfo);
+ }
+
+ private void verifyParamsInToolsMessages(String[][] messageInfo) {
+ int numParams = 0;
+
+ for (int i = 0; i < messageInfo.length; i++) {
+ System.out.println("Testing message: " + messageInfo[i][0]);
+ try {
+ numParams = Integer.parseInt(messageInfo[i][1]);
+ } catch (NumberFormatException e) {
+ System.out.println("Invalid param number specifier!");
+ assertTrue(false);
+ }
+ if (numParams == 0) {
+ String message = ToolsUtil.getMessage(messageInfo[i][0]);
+ assertTrue(message != null);
+ } else if (numParams > 0) {
+ Object[] params = generateParams(numParams);
+ String message = ToolsUtil.getMessage(messageInfo[i][0],
+ params);
+ assertTrue(message != null);
+ for (int j = 0; j < params.length; j++) {
+ assertTrue(message.indexOf((String) params[j]) != -1);
+ }
+ }
+ }
+ }
+

private void verifyParamsInMessages(String[][] messageInfo) {
int numParams = 0;

for (int i = 0; i < messageInfo.length; i++) {
+ System.out.println("Testing message: " + messageInfo[i][0]);
try {
numParams = Integer.parseInt(messageInfo[i][1]);
} catch (NumberFormatException e) {
Index: jsf-tools/src/com/sun/faces/config/rules/ManagedBeanRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/ManagedBeanRule.java,v
retrieving revision 1.3
diff -u -r1.3 ManagedBeanRule.java
--- jsf-tools/src/com/sun/faces/config/rules/ManagedBeanRule.java 4 Feb
2004 23:46:22 -0000 1.3
+++ jsf-tools/src/com/sun/faces/config/rules/ManagedBeanRule.java 6 Nov
2005 00:20:08 -0000
@@ -10,10 +10,15 @@
package com.sun.faces.config.rules;


+import java.util.Arrays;
+
import org.apache.commons.digester.Rule;
import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
import com.sun.faces.config.beans.FacesConfigBean;
import com.sun.faces.config.beans.ManagedBeanBean;
+import com.sun.faces.util.ToolsUtil;


/**
@@ -26,6 +31,14 @@
private static final String CLASS_NAME =
"com.sun.faces.config.beans.ManagedBeanBean";

+ private static final String[] SCOPES = {
+ "none", "application", "session", "request"
+ };
+
+ static {
+ Arrays.sort(SCOPES);
+ }
+

// ------------------------------------------------------------ Rule Methods

@@ -104,6 +117,9 @@
throw new IllegalStateException("Popped object is not a " +
CLASS_NAME + " instance");
}
+
+ validate(top);
+
FacesConfigBean fcb = (FacesConfigBean) digester.peek();
ManagedBeanBean old = fcb.getManagedBean(top.getManagedBeanName());
if (old == null) {
@@ -173,6 +189,75 @@
MapEntriesRule.mergeMapEntries(top, old);

}
+
+ // --------------------------------------------------------- Private
Methods
+
+ /**
+ * <p>Provides simple sanity checks.</p>
+ *
+ * @param bean the <code>ManagedBeanBean</code> instance to validate
+ */
+ private void validate(ManagedBeanBean bean) {
+
+ String val = bean.getManagedBeanName();
+ if (val == null || val.length() == 0) {
+ Locator locator = digester.getDocumentLocator();
+ String documentName = "UNKNOWN";
+ String lineNumber = "UNKNWOWN";
+
+ if (locator != null) {
+ documentName = locator.getSystemId();
+ lineNumber = Integer.toString(locator.getLineNumber());
+ }
+
+ throw new IllegalStateException(ToolsUtil.getMessage(
+ ToolsUtil.MANAGED_BEAN_NO_MANAGED_BEAN_NAME_ID,
+ new Object[]{documentName, lineNumber}));
+ }
+
+ val = bean.getManagedBeanClass();
+ if (val == null || val.length() == 0) {
+ throw new IllegalStateException(ToolsUtil.getMessage(
+ ToolsUtil.MANAGED_BEAN_NO_MANAGED_BEAN_CLASS_ID,
+ new Object[]{bean.getManagedBeanName()}));
+ }
+
+ val = bean.getManagedBeanScope();
+ if (val == null || val.length() == 0) {
+ throw new IllegalStateException(ToolsUtil.getMessage(
+ ToolsUtil.MANAGED_BEAN_NO_MANAGED_BEAN_SCOPE_ID,
+ new Object[]{bean.getManagedBeanName()}));
+ }
+
+ if (Arrays.binarySearch(SCOPES, val) < 0) {
+ throw new IllegalStateException(ToolsUtil.getMessage(
+ ToolsUtil.MANAGED_BEAN_INVALID_SCOPE_ID,
+ new Object[]{val, bean.getManagedBeanName()}));
+ }
+
+ // - if the managed bean is itself a List, make sure it has no
+ // map entries or managed properties
+ // - if the managed bean is itself a Map, make sure it has no
+ // managed properties
+ if (bean.getListEntries() != null) {
+ if (bean.getMapEntries() != null ||
+ bean.getManagedProperties().length != 0) {
+ throw new IllegalStateException(
+ ToolsUtil.getMessage(
+ ToolsUtil.MANAGED_BEAN_AS_LIST_CONFIG_ERROR_ID,
+ new Object[]{bean.getManagedBeanName()}));
+ }
+ } else if (bean.getMapEntries() != null) {
+ if (bean.getManagedProperties().length != 0) {
+ throw new IllegalStateException(
+ ToolsUtil.getMessage(
+ ToolsUtil.MANAGED_BEAN_AS_MAP_CONFIG_ERROR_ID,
+ new Object[]{bean.getManagedBeanName()}));
+ }
+ }
+
+ } // END validate
+


}
Index: jsf-tools/src/com/sun/faces/config/rules/ManagedPropertyRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/ManagedPropertyRule.java,v
retrieving revision 1.3
diff -u -r1.3 ManagedPropertyRule.java
--- jsf-tools/src/com/sun/faces/config/rules/ManagedPropertyRule.java 4
Feb 2004 23:46:22 -0000 1.3
+++ jsf-tools/src/com/sun/faces/config/rules/ManagedPropertyRule.java 6
Nov 2005 00:20:08 -0000
@@ -14,6 +14,7 @@
import org.xml.sax.Attributes;
import com.sun.faces.config.beans.ManagedPropertyBean;
import com.sun.faces.config.beans.ManagedBeanBean;
+import com.sun.faces.util.ToolsUtil;


/**
@@ -105,6 +106,9 @@
CLASS_NAME + " instance");
}
ManagedBeanBean mbb = (ManagedBeanBean) digester.peek();
+
+ validate(mbb.getManagedBeanName(), top);
+
ManagedPropertyBean old =
mbb.getManagedProperty(top.getPropertyName());
if (old == null) {
@@ -195,6 +199,64 @@
}

}
+
+
+
+ // --------------------------------------------------------- Private
Methods
+
+ private void validate(String managedBeanName,
+ ManagedPropertyBean property) {
+
+ String managedPropertyName = property.getPropertyName();
+ if (managedPropertyName == null || managedPropertyName.length() == 0) {
+ throw new IllegalStateException(
+ ToolsUtil.getMessage(
+ ToolsUtil.MANAGED_BEAN_NO_MANAGED_PROPERTY_NAME_ID,
+ new Object[] { managedBeanName } ));
+ }
+
+ // managed-property instances that have list-entries must
+ // not have value or map-entries. It is a configuration
+ // error if they do.
+ if (property.getListEntries() != null) {
+ if (property.getMapEntries() != null ||
+ property.getValue() != null || property.isNullValue()) {
+
+ throw new IllegalStateException (
+ ToolsUtil.getMessage(
+ ToolsUtil.MANAGED_BEAN_LIST_PROPERTY_CONFIG_ERROR_ID,
+ new Object[] { managedBeanName,
+ managedPropertyName }));
+ }
+ }
+
+ // managed-property instances that have map-entries, must
+ // not have value or list-entries. It is a configuration
+ // error if they do.
+ if (property.getMapEntries() != null) {
+ if (property.getValue() != null || property.isNullValue()) {
+ throw new IllegalStateException (
+ ToolsUtil.getMessage(
+ ToolsUtil.MANAGED_BEAN_MAP_PROPERTY_CONFIG_ERROR_ID,
+ new Object[] { managedBeanName,
+ managedPropertyName }));
+ }
+ }
+
+ // If the managed property has no list or map entries, nor
+ // any defined value or configured as a null value, then an error
+ // will be raised
+ if (property.getListEntries() == null &&
+ property.getMapEntries() == null &&
+ property.getValue() == null && !property.isNullValue()) {
+ throw new IllegalStateException (
+ ToolsUtil.getMessage(
+ ToolsUtil.MANAGED_BEAN_PROPERTY_CONFIG_ERROR_ID,
+ new Object[] { managedBeanName,
+ managedPropertyName }));
+ }
+
+ } // END validate


}


SECTION: New Files
----------------------------
SEE ATTACHMENTS