[jboss-cvs] jboss-seam/src/main/org/jboss/seam/contexts ...
Gavin King
gavin.king at jboss.com
Fri Nov 3 21:08:10 EST 2006
User: gavin
Date: 06/11/03 21:08:10
Modified: src/main/org/jboss/seam/contexts PageContext.java
Log:
fix JBSEAM-447
Revision Changes Path
1.11 +18 -5 jboss-seam/src/main/org/jboss/seam/contexts/PageContext.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PageContext.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/PageContext.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- PageContext.java 25 Oct 2006 15:14:35 -0000 1.10
+++ PageContext.java 4 Nov 2006 02:08:10 -0000 1.11
@@ -6,9 +6,12 @@
*/
package org.jboss.seam.contexts;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
@@ -31,7 +34,7 @@
* returns values from the page that was the source of the request.
*
* @author Gavin King
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
*/
public class PageContext implements Context {
@@ -51,13 +54,13 @@
private String getKey(String name)
{
- return /*getPrefix() +*/ name;
+ return getPrefix() + name;
}
- /*private String getPrefix()
+ private String getPrefix()
{
return ScopeType.PAGE.getPrefix() + '$';
- }*/
+ }
public Object get(String name)
{
@@ -96,7 +99,17 @@
}
public String[] getNames() {
- return getCurrentReadableMap().keySet().toArray( new String[]{} );
+ Set<String> keys = getCurrentReadableMap().keySet();
+ List<String> names = new ArrayList<String>( keys.size() );
+ String prefix = getPrefix();
+ for (String key: keys)
+ {
+ if ( key.startsWith(prefix) )
+ {
+ names.add( key.substring( prefix.length() ) );
+ }
+ }
+ return names.toArray( new String[ names.size() ] );
}
@Override
More information about the jboss-cvs-commits
mailing list