Re: [Simpleweb-Support] Problem with session and generics
Brought to you by:
niallg
|
From: Toby <tob...@gm...> - 2011-11-04 11:24:10
|
It looks like the Session implements Map but uses a Lease object which uses
the generic type for its key. So I understand this to mean that in
Session<T>, the T refers to the Key of the underlying map and Objects are
stored as values.
Not sure if that's right, I just skimmed the source. If I'm wrong, someone
will correct me, I'm sure.
Cheers
On 3 November 2011 20:06, frank maltman <fra...@go...>wrote:
> Hello.
>
> Sessions seem slightly underdocumented. I'm trying to store
> the value '23' under the key 'state' for a given session:
>
> import org.simpleframework.http.session.Session;
>
> public final class test
> {
> public static void setLoggedIn(final Session<?> session)
> {
> session.put("state", 23);
> }
> }
>
> "Type safety: The method put(Object, Object) belongs to the raw type
> Map. References to generic type Map<K,V> should be parameterized"
>
> I'm not sure what the error message is trying to tell me. What is the
> type parameter on Session supposed to be?
>
> fm
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Simpleweb-Support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simpleweb-support
>
|