You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ca...@usitc.gov on 2007/01/16 18:16:04 UTC

FormLinkRenderer + ServiceExtensionEncoder - NPE

Tapestry 4 - Java 1.5 - Tomcat 5.5.9

Our app is using the page, direct and service ServiceEncoders for pretty
urls.

I am using the FormLinkRenderer to bypass the ~2kb url limit in IE.

I am running into an NPE on line 154 of the FormLinkRenderer.

This occurs because the link returns a null array for a parameter name,
in this case "service".  The FormLinkRenderer then attempts to call
length on the array therby commiting suicide.

This occurs because the ServiceEncoders, when moving query params to the
path, set parameterValues to null after adding them in the servlet path.
E.g. (from ServiceExtensionEncoder):

        encoding.setServletPath("/" + service + "." + _extension);
        encoding.setParameterValue(ServiceConstants.SERVICE, null);

The problem is that setting a param value to null, does not actually
remove the entry.  So the underlying map of query params still has
entries with null values.

Why keep the entries?  Does the framework require it later on?  It would
seem to be safer to add a removeParameter method to the ServiceEncoding
interface, or perhaps the QueryParameterMap should remove the entry if a
null value is passed?

Carlos

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org