This content has been marked as final.
Show 2 replies
-
1. Re: Encoded Request Parameter
gavin.king Dec 12, 2006 11:38 PM (in response to chane)Um, how are you adding the parameters? What happens if you try Seam 1.1?
-
2. Re: Encoded Request Parameter
chane Dec 13, 2006 12:15 AM (in response to chane)This is the link I am using:
http://somedomain.com/action.seam?param1=v1¶m2=v2
For some reason it seams that the browser encodes the link to use "&" instead of just "&".
I figured this is probably a JSF/Tomcat issue; but it seems like for the short term I can solve it in Seam. I modified Component like this:private Object convertMultiValueRequestParameter(Map<String, String[]> requestParameters, String name, Class<?> type) { String[] array = requestParameters.get(name); if(array == null || array.length==0){ array = requestParameters.get("amp;"+name); } if (array==null || array.length==0) { return null; } else { if ( type.isArray() ) { int length = Array.getLength(array); Class<?> elementType = type.getComponentType(); Object newInstance = Array.newInstance(elementType, length); for ( int i=0; i<length; i++ ) { Object element = convertRequestParameter( (String) Array.get(array, i), elementType ); Array.set( newInstance, i, element ); } return newInstance; } else { return convertRequestParameter( array[0], type ); } } }
So when a RequestParameter is searched for, if it is not found the "amp;"+name version is looked for next. I don't like this solution; but for the short term it's gonna have to suffice. Other suggestions are always welcomed.
As for Seam 1.1, I am looking forward to using it as soon as I can; but I can't move to the new version right this instant. We are planning on moving to 1.1 in the next couple of months (maybe over xmas) when I have a chance to do some testing. I also need to look into making some of my local modifications to the 1.1 version (specifically - http://jira.jboss.org/jira/browse/JBSEAM-326). None of them are difficult, just need some time.
Thanks,
Chris....