RE: [Actionframework-users] parameter passing bug
Status: Inactive
Brought to you by:
ptoman
|
From: Petr T. <Pet...@pi...> - 2003-04-16 11:40:51
|
> When I use long as variable type, then:
> a) When I supply both variables in URL: /test/2?b=3D9 ... it works fin=
e.
> (<in-var> not activated)
> b) When I only supply variable a in the URL: /test/2 .... I get
> org.actionframework.ConversionException: No type handler for conversion
> from 'java.lang.Integer' to 'long'
This problem is caused by evaluation of <in/out-var>s. AS uses
internally Velocity/WebMacro as engine for expressions and
conditions. Until this is rewritten (scheduled for AS 0.96),
there is a workaround: define a type handler for these cases,
something like:
<type-handlers>
<type-handler source-type=3D"java.lang.Integer"=20
target-type=3D"long" class=3D"Dummy"/>
</type-handlers>
public class Dummy implements SimpleTypeHandler {
public Object convert(Context context, Object o) {return o;}
}
It would be necessary to add all combinations of THs for
conversions from wrapper classes to primitive types, like:=20
Integer -> long, Short -> int, Short -> long etc., which
could be done for AS 0.94.1 :)
Petr
[ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=3D22957959 ]
|