| Issue 183: | LimitActionFactoryImpl attempts to decode parameters that have already been decoded | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Here is the code from LimitActionFactoryImpl:
for (Object param : parameters.keySet()) {
String parameter = (String) param;
if (parameter.startsWith(prefixId + Action.FILTER.toParam())) {
String value = LimitUtils.getValue(parameters.get(parameter));
try {
value = decode(value, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
if (StringUtils.isNotBlank(value)) {
String property = StringUtils.substringAfter(parameter,
prefixId + Action.FILTER.toParam());
Filter filter = new Filter(property, value);
filterSet.addFilter(filter);
}
}
}
I entered a value like this into the filter: %-26-% (for a "LIKE" query)
I got this exception:
[3/4/09 10:00:08:906 EST] 0000003a WebApp E [Servlet
Error]-[JMesaSupportServlet]: java.lang.IllegalArgumentException:
URLDecoder: Incomplete trailing escape (%) pattern
at java.net.URLDecoder.decode(URLDecoder.java:180)
at
org.jmesa.limit.LimitActionFactoryImpl.getFilterSet(LimitActionFactoryImpl.java:92)
at org.jmesa.limit.LimitFactoryImpl.createLimit(LimitFactoryImpl.java:120)
at org.jmesa.facade.TableFacadeImpl.getLimit(TableFacadeImpl.java:182)
Is there a reason why LimitActionFactory is trying to decode the parameters
there, when they should have already been decoded by the app server? If
so, can we just catch the IllegalArgumentException and drive on with the
raw value if this case occurs?
Or am I doing something wrong?
Thanks.
Mar 4, 2009
Project Member
#1
jeff.johnston.mn@gmail.com
Mar 9, 2009
If you get the chance to test this out I could do another release within a couple weeks.
Status:
Accepted
Mar 9, 2009
Reply, ok, I'll give it a shot. Sorry I didn't reply the first time, been a little busy.
Mar 9, 2009
I totally understand. I am investigating converting over our Oracle database to MySQL so I am just updating JMesa as I have needs or get patches...
Mar 11, 2009
Just tested this by commenting out the try/catch block show above, and it seems to work fine.
Mar 11, 2009
The change makes sense to me as well. I will take out those lines of code and update trunk tonight. I will also be doing another release within a week. Thanks for testing it out!
Mar 11, 2009
The change is on the trunk now...it will be released in the next few days.
Apr 5, 2009
Part of the 2.4.2 release.
Status:
Done
|