[Actionframework-users] parameter passing bug
Status: Inactive
Brought to you by:
ptoman
|
From: Jakub C. <bla...@cb...> - 2003-04-14 11:41:56
|
Hello!
I think there is a bug in parameter passing routines. I found it when I
tried to use both regexp parameters and ordinary URL parameters together
(IMHO this is very useful combination..).
Let's define an action:
<action name="/test/$a" method="test(Integer a,Integer b)">
<input-variable name="b" value="0" if="!$b"/>
</action>
And let's define trivial method 'test' in component:
public void test(Integer a, Integer b) {
System.out.println("Variable a:" + a + " Variable b:" + b);
}
Let's try it!
GET /test/5
output: Variable a:5 Variable b:0 FINE
GET /test/5?b=17
output:Variable a:5 Variable b:null BAD!!! variable b is discarded
-------------------------------------------------------------------------
Let's comment out the "input variable" tag:
<action name="/test/$a" method="test(Integer a,Integer b)" />
Let's try again:
GET /test/5
output: org.actionframework.MissingParameterException FINE
GET /test/5?b=17
output:Variable a:5 Variable b:17 FINE
-------------------------------------------------------------------------
So what's the result? It seems to me that <input-variable> evaluation breaks
something...
-------------------------------------------------------------------------
One more strange thing: If I change variable types in previous example to
long from Integer, I get:
org.actionframework.ConversionException: No type handler for conversion
from 'java.lang.Integer' to 'long'
when <input-variable> tag is used. When I comment it out, type conversion
works fine.
I think these bugs really are worth fixing, because these features seem
extremely useful for me. I use regex variables for pages, which I want to be
perfectly 'googleable' - like "/view/article/17". For admin pages, which are
not intended for the public I use normal "?foo=bar" variables, so I don't
have to define so many actions.
Greetings from Prague!
Jakub Cerny
|