You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Tsui, Alban" <Al...@COGNOS.com> on 2003/03/10 13:25:20 UTC
request bug in cocoon?
Hi
I am trouble using Request in my xsp when I do
request.getParameterValues("xxx") when "xxx" doesn't exist on my url.
In theory, if it is not there this should return null but I got a
nullPointerException. After looking at the codes... I found the following:
public String[] getParameterValues(String name) {
String[] values = this.req.getParameterValues(name);
if (this.form_encoding == null) {
return values;
}
String[] decoded_values = new String[values.length];
for (int i = 0; i < values.length; ++i) {
decoded_values[i] = decode(values[i]);
}
return decoded_values;
}
Since I have set the encoding (via an action), the logic in the above
funciton will fall in the line
String[] decoded_values = new String[values.length];
But what happens if values is null from the first line
String[] values = this.req.getParameterValues(name);
surely values.length will fail straight away!
What should I do about this?
Cheers
Alban
This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org