[jboss-user] [JBoss Seam] - @In with primitives

docjava do-not-reply at jboss.com
Wed Mar 7 05:51:44 EST 2007


My Task is to keep a few Parameters of a Conversational Bean as defaults in the Session scope.

My first try is:

    @In(required = false, scope = ScopeType.SESSION)
    @Out(scope = ScopeType.SESSION)
    private int documentListPageSize=0;

which gives me an exception in 
sun.reflect.UnsafeIntegerFieldAccessorImpl.set due to trying to set an int to null.

My question is: why does seem try to inject this at all, where the corresponding Object in the Session Scope cannot be found ?

To work around this, i tried to add a @Factory method returning some default. Did´t help at all.

What is the best practice for this usage pattern ?

(I´m using 1.1.7 on JBossAS 4.0.5)

Thanks, Uwe

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025733#4025733

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025733

More information about the jboss-user mailing list