You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thomas Singer <wi...@regnis.de> on 2007/08/31 11:49:38 UTC

Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

What is the preferred way of obtaining a WebSession from a 
non-Wicket-Filter/Servlet. I've taken a look at WicketSessionFilter, but 
this one requires a filterName init parameter and seems to expect the 
session as a HttpSession parameter. But how the WebSession should come into 
the HttpSession without setting it from the wicket code?

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Johan Compagner <jc...@gmail.com>.
And if you use the WicketSessionFilter
always first TEST if the session is there so:

Session session = null
if (Session.exists())
{
 session = Session.get()
}

else you will still have the RequestCycle problem...

johan

On 8/31/07, Matej Knopp <ma...@gmail.com> wrote:
>
> You don't interact with WicketSessionFilter directly.  You just set it up,
> providing name of your WicketFilter ad argument. You need to map the
> WicketSessionFilter to same url as your non-wicket filter/servlet and make
> sure that you use a non-wicket filter WicketSessionFilter gets invoked
> first.
>
> Then in your custom filter/servlet you can obtain wicket session using
> just
> Session.get().
>
> -Matej
>
> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
> >
> > What is the preferred way of obtaining a WebSession from a
> > non-Wicket-Filter/Servlet. I've taken a look at WicketSessionFilter, but
> > this one requires a filterName init parameter and seems to expect the
> > session as a HttpSession parameter. But how the WebSession should come
> > into
> > the HttpSession without setting it from the wicket code?
> >
> > Tom
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Johan Compagner <jc...@gmail.com>.
we already have that but it is not in the filter because the filter doesn't
have anything to do with that kind of stuff
its in

WebApplication.getSessionAttributePrefix(final WebRequest request) (dont
know why it needs the request param)

and then appended with:

Session.SESSION_ATTRIBUTE_NAME

that makes the key. The problem is that in WicketSessionFilter we can't call
that WebApplication method.
maybe we can refactor it a bit to make it more clear so that WebApplication
gets a static method that
gets only the filtername

johan

On 9/1/07, Thomas Singer <wi...@regnis.de> wrote:
>
> Ah, that's the secret missing link. I then suggest to have a method
> getSessionKey(String wicketFilterName) which is used by the "normal"
> WicketFilter to read/write and the WicketSessionFilter to read the
> WebSession.
>
> Thanks, Eelco!
>
> --
> Cheers,
> Tom
>
>
> Eelco Hillenius wrote:
> >> No, my confusion is about how it comes into the HttpSession accessible
> under
> >> the attribute name which is build only in WicketSessionFilter (aren't
> the
> >> HttpSession's attributes not a simple string-to-object map so you need
> the
> >> right key to get the value?).
> >
> > That's why you need to provide the filterName argument when setting up
> > the filter. The filtername is used as the key by the actual Wicket
> > application, so if you set the filterName to the name of the filter
> > you want to get the session from, the two keys match.
> >
> > Eelco
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Thomas Singer <wi...@regnis.de>.
Ah, that's the secret missing link. I then suggest to have a method 
getSessionKey(String wicketFilterName) which is used by the "normal" 
WicketFilter to read/write and the WicketSessionFilter to read the WebSession.

Thanks, Eelco!

--
Cheers,
Tom


Eelco Hillenius wrote:
>> No, my confusion is about how it comes into the HttpSession accessible under
>> the attribute name which is build only in WicketSessionFilter (aren't the
>> HttpSession's attributes not a simple string-to-object map so you need the
>> right key to get the value?).
> 
> That's why you need to provide the filterName argument when setting up
> the filter. The filtername is used as the key by the actual Wicket
> application, so if you set the filterName to the name of the filter
> you want to get the session from, the two keys match.
> 
> Eelco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Thomas Singer <wi...@regnis.de>.
Thanks all for your help. It works now like a charm and the own filter in 
front of an regular download feels very elegant.

--
Cheers,
Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Eelco Hillenius <ee...@gmail.com>.
> No, my confusion is about how it comes into the HttpSession accessible under
> the attribute name which is build only in WicketSessionFilter (aren't the
> HttpSession's attributes not a simple string-to-object map so you need the
> right key to get the value?).

That's why you need to provide the filterName argument when setting up
the filter. The filtername is used as the key by the actual Wicket
application, so if you set the filterName to the name of the filter
you want to get the session from, the two keys match.

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Thomas Singer <wi...@regnis.de>.
Hi Johan,

> Do you think that the WicketSessionFilter CREATES a WicketSession object for
> you?

No, my confusion is about how it comes into the HttpSession accessible under 
the attribute name which is build only in WicketSessionFilter (aren't the 
HttpSession's attributes not a simple string-to-object map so you need the 
right key to get the value?).

Tom


Johan Compagner wrote:
> Reading your mails i think you are a bit confused.
> to make it clear to me what you think WicketSessionFilter does
> Do you think that the WicketSessionFilter CREATES a WicketSession object for
> you?
> 
> If you think that then that is what the big confusion is all about in this
> thread.
> The only thing the filter does is getting an existing  wicket session that
> is stored in the http session
> and setting it for you in the the thread local so that you can access it
> from a none wicket thing.
> 
> Ofcourse you need to first hit something in wicket itself. So that the
> wicket filter/servlet request
> did make one. Else it will always be empty.
> 
> johan
> 
> 
> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>> OK, let's look at the sources of WicketSessionFilter. According to my
>> understanding:
>>
>> init() method:
>> - the "filterName" init parameter (which is stored as a member, but should
>>    in a local variable) defines the sessionKey
>>
>> doFilter() method:
>> - first the httpSession will be fetched if available
>> - out of the httpSession the (wicket-)session is fetched as attribute
>> using
>>    the sessionKey
>> - only if this one is found, it will be set to Session.set()
>>
>> This creates following question for me:
>> - Where the httpSession attribute with the sessionKey is set?
>> - Is there a working example available where WicketSessionFilter is used?
>>
>> Tom
>>
>>
>> Johan Compagner wrote:
>>> again look at the source :)
>>>
>>> Session.get() will create a WicketSession object. (Session.findOrCreate
>> ())
>>> And if you then make a statefull page that has to be stored in the
>> session,
>>> the session will also be stored. (Session.bind())
>>>
>>> johan
>>>
>>>
>>> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>>>> Did you read my first mail in this thread? How does the WebSession
>>>> reference
>>>> comes into the HttpSession? That's what I don't understand for now.
>>>>
>>>> Tom
>>>>
>>>>
>>>> Johan Compagner wrote:
>>>>> look at the source :)
>>>>>
>>>>> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>>>>>> Matej and Johan, thanks for your feed-back. I've tried to avoid the
>>>>>> WicketSessionFilter and make everything work from our code. Just
>>>> curious:
>>>>>> is
>>>>>> the WicketSessionFilter handled something special by Wicket? Or how
>>>> does
>>>>>> it
>>>>>> get the WebSession reference?
>>>>>>
>>>>>> Tom
>>>>>>
>>>>>>
>>>>>> Matej Knopp wrote:
>>>>>>> You don't interact with WicketSessionFilter directly.  You just set
>> it
>>>>>> up,
>>>>>>> providing name of your WicketFilter ad argument. You need to map the
>>>>>>> WicketSessionFilter to same url as your non-wicket filter/servlet
>> and
>>>>>> make
>>>>>>> sure that you use a non-wicket filter WicketSessionFilter gets
>> invoked
>>>>>>> first.
>>>>>>>
>>>>>>> Then in your custom filter/servlet you can obtain wicket session
>> using
>>>>>> just
>>>>>>> Session.get().
>>>>>>>
>>>>>>> -Matej
>>>>>>>
>>>>>>> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>>>>>>>> What is the preferred way of obtaining a WebSession from a
>>>>>>>> non-Wicket-Filter/Servlet. I've taken a look at
>> WicketSessionFilter,
>>>>>> but
>>>>>>>> this one requires a filterName init parameter and seems to expect
>> the
>>>>>>>> session as a HttpSession parameter. But how the WebSession should
>>>> come
>>>>>>>> into
>>>>>>>> the HttpSession without setting it from the wicket code?
>>>>>>>>
>>>>>>>> Tom
>>>>>>>>
>>>>>>>>
>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>
>>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Johan Compagner <jc...@gmail.com>.
Reading your mails i think you are a bit confused.
to make it clear to me what you think WicketSessionFilter does
Do you think that the WicketSessionFilter CREATES a WicketSession object for
you?

If you think that then that is what the big confusion is all about in this
thread.
The only thing the filter does is getting an existing  wicket session that
is stored in the http session
and setting it for you in the the thread local so that you can access it
from a none wicket thing.

Ofcourse you need to first hit something in wicket itself. So that the
wicket filter/servlet request
did make one. Else it will always be empty.

johan


On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>
> OK, let's look at the sources of WicketSessionFilter. According to my
> understanding:
>
> init() method:
> - the "filterName" init parameter (which is stored as a member, but should
>    in a local variable) defines the sessionKey
>
> doFilter() method:
> - first the httpSession will be fetched if available
> - out of the httpSession the (wicket-)session is fetched as attribute
> using
>    the sessionKey
> - only if this one is found, it will be set to Session.set()
>
> This creates following question for me:
> - Where the httpSession attribute with the sessionKey is set?
> - Is there a working example available where WicketSessionFilter is used?
>
> Tom
>
>
> Johan Compagner wrote:
> > again look at the source :)
> >
> > Session.get() will create a WicketSession object. (Session.findOrCreate
> ())
> > And if you then make a statefull page that has to be stored in the
> session,
> > the session will also be stored. (Session.bind())
> >
> > johan
> >
> >
> > On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
> >> Did you read my first mail in this thread? How does the WebSession
> >> reference
> >> comes into the HttpSession? That's what I don't understand for now.
> >>
> >> Tom
> >>
> >>
> >> Johan Compagner wrote:
> >>> look at the source :)
> >>>
> >>> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
> >>>> Matej and Johan, thanks for your feed-back. I've tried to avoid the
> >>>> WicketSessionFilter and make everything work from our code. Just
> >> curious:
> >>>> is
> >>>> the WicketSessionFilter handled something special by Wicket? Or how
> >> does
> >>>> it
> >>>> get the WebSession reference?
> >>>>
> >>>> Tom
> >>>>
> >>>>
> >>>> Matej Knopp wrote:
> >>>>> You don't interact with WicketSessionFilter directly.  You just set
> it
> >>>> up,
> >>>>> providing name of your WicketFilter ad argument. You need to map the
> >>>>> WicketSessionFilter to same url as your non-wicket filter/servlet
> and
> >>>> make
> >>>>> sure that you use a non-wicket filter WicketSessionFilter gets
> invoked
> >>>>> first.
> >>>>>
> >>>>> Then in your custom filter/servlet you can obtain wicket session
> using
> >>>> just
> >>>>> Session.get().
> >>>>>
> >>>>> -Matej
> >>>>>
> >>>>> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
> >>>>>> What is the preferred way of obtaining a WebSession from a
> >>>>>> non-Wicket-Filter/Servlet. I've taken a look at
> WicketSessionFilter,
> >>>> but
> >>>>>> this one requires a filterName init parameter and seems to expect
> the
> >>>>>> session as a HttpSession parameter. But how the WebSession should
> >> come
> >>>>>> into
> >>>>>> the HttpSession without setting it from the wicket code?
> >>>>>>
> >>>>>> Tom
> >>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>>>
> >>>>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>
> >>>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Thomas Singer <wi...@regnis.de>.
Thanks, I will take a look at the example.

Tom


Eelco Hillenius wrote:
>> This creates following question for me:
>> - Where the httpSession attribute with the sessionKey is set?
> 
> Using the default session store implementations, this is done in
> HttpSessionStore#setAttribute. SecondLevelCacheSessionStore (the
> default for Wicket 1.3) extends HttpSessionStore (the default for
> Wicket 1.2), and uses that as well.
> 
>> - Is there a working example available where WicketSessionFilter is used?
> 
> Yes, since this week. Look at wicket-examples. It's not in the index,
> but you can find back in web.xml, and the example is briefly explained
> in WicketSessionFilter's javadoc.
> 
> Eelco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Eelco Hillenius <ee...@gmail.com>.
> This creates following question for me:
> - Where the httpSession attribute with the sessionKey is set?

Using the default session store implementations, this is done in
HttpSessionStore#setAttribute. SecondLevelCacheSessionStore (the
default for Wicket 1.3) extends HttpSessionStore (the default for
Wicket 1.2), and uses that as well.

> - Is there a working example available where WicketSessionFilter is used?

Yes, since this week. Look at wicket-examples. It's not in the index,
but you can find back in web.xml, and the example is briefly explained
in WicketSessionFilter's javadoc.

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Thomas Singer <wi...@regnis.de>.
OK, let's look at the sources of WicketSessionFilter. According to my 
understanding:

init() method:
- the "filterName" init parameter (which is stored as a member, but should
   in a local variable) defines the sessionKey

doFilter() method:
- first the httpSession will be fetched if available
- out of the httpSession the (wicket-)session is fetched as attribute using
   the sessionKey
- only if this one is found, it will be set to Session.set()

This creates following question for me:
- Where the httpSession attribute with the sessionKey is set?
- Is there a working example available where WicketSessionFilter is used?

Tom


Johan Compagner wrote:
> again look at the source :)
> 
> Session.get() will create a WicketSession object. (Session.findOrCreate())
> And if you then make a statefull page that has to be stored in the session,
> the session will also be stored. (Session.bind())
> 
> johan
> 
> 
> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>> Did you read my first mail in this thread? How does the WebSession
>> reference
>> comes into the HttpSession? That's what I don't understand for now.
>>
>> Tom
>>
>>
>> Johan Compagner wrote:
>>> look at the source :)
>>>
>>> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>>>> Matej and Johan, thanks for your feed-back. I've tried to avoid the
>>>> WicketSessionFilter and make everything work from our code. Just
>> curious:
>>>> is
>>>> the WicketSessionFilter handled something special by Wicket? Or how
>> does
>>>> it
>>>> get the WebSession reference?
>>>>
>>>> Tom
>>>>
>>>>
>>>> Matej Knopp wrote:
>>>>> You don't interact with WicketSessionFilter directly.  You just set it
>>>> up,
>>>>> providing name of your WicketFilter ad argument. You need to map the
>>>>> WicketSessionFilter to same url as your non-wicket filter/servlet and
>>>> make
>>>>> sure that you use a non-wicket filter WicketSessionFilter gets invoked
>>>>> first.
>>>>>
>>>>> Then in your custom filter/servlet you can obtain wicket session using
>>>> just
>>>>> Session.get().
>>>>>
>>>>> -Matej
>>>>>
>>>>> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>>>>>> What is the preferred way of obtaining a WebSession from a
>>>>>> non-Wicket-Filter/Servlet. I've taken a look at WicketSessionFilter,
>>>> but
>>>>>> this one requires a filterName init parameter and seems to expect the
>>>>>> session as a HttpSession parameter. But how the WebSession should
>> come
>>>>>> into
>>>>>> the HttpSession without setting it from the wicket code?
>>>>>>
>>>>>> Tom
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Johan Compagner <jc...@gmail.com>.
again look at the source :)

Session.get() will create a WicketSession object. (Session.findOrCreate())
And if you then make a statefull page that has to be stored in the session,
the session will also be stored. (Session.bind())

johan


On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>
> Did you read my first mail in this thread? How does the WebSession
> reference
> comes into the HttpSession? That's what I don't understand for now.
>
> Tom
>
>
> Johan Compagner wrote:
> > look at the source :)
> >
> > On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
> >> Matej and Johan, thanks for your feed-back. I've tried to avoid the
> >> WicketSessionFilter and make everything work from our code. Just
> curious:
> >> is
> >> the WicketSessionFilter handled something special by Wicket? Or how
> does
> >> it
> >> get the WebSession reference?
> >>
> >> Tom
> >>
> >>
> >> Matej Knopp wrote:
> >>> You don't interact with WicketSessionFilter directly.  You just set it
> >> up,
> >>> providing name of your WicketFilter ad argument. You need to map the
> >>> WicketSessionFilter to same url as your non-wicket filter/servlet and
> >> make
> >>> sure that you use a non-wicket filter WicketSessionFilter gets invoked
> >>> first.
> >>>
> >>> Then in your custom filter/servlet you can obtain wicket session using
> >> just
> >>> Session.get().
> >>>
> >>> -Matej
> >>>
> >>> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
> >>>> What is the preferred way of obtaining a WebSession from a
> >>>> non-Wicket-Filter/Servlet. I've taken a look at WicketSessionFilter,
> >> but
> >>>> this one requires a filterName init parameter and seems to expect the
> >>>> session as a HttpSession parameter. But how the WebSession should
> come
> >>>> into
> >>>> the HttpSession without setting it from the wicket code?
> >>>>
> >>>> Tom
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>
> >>>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Thomas Singer <wi...@regnis.de>.
Did you read my first mail in this thread? How does the WebSession reference 
comes into the HttpSession? That's what I don't understand for now.

Tom


Johan Compagner wrote:
> look at the source :)
> 
> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>> Matej and Johan, thanks for your feed-back. I've tried to avoid the
>> WicketSessionFilter and make everything work from our code. Just curious:
>> is
>> the WicketSessionFilter handled something special by Wicket? Or how does
>> it
>> get the WebSession reference?
>>
>> Tom
>>
>>
>> Matej Knopp wrote:
>>> You don't interact with WicketSessionFilter directly.  You just set it
>> up,
>>> providing name of your WicketFilter ad argument. You need to map the
>>> WicketSessionFilter to same url as your non-wicket filter/servlet and
>> make
>>> sure that you use a non-wicket filter WicketSessionFilter gets invoked
>>> first.
>>>
>>> Then in your custom filter/servlet you can obtain wicket session using
>> just
>>> Session.get().
>>>
>>> -Matej
>>>
>>> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>>>> What is the preferred way of obtaining a WebSession from a
>>>> non-Wicket-Filter/Servlet. I've taken a look at WicketSessionFilter,
>> but
>>>> this one requires a filterName init parameter and seems to expect the
>>>> session as a HttpSession parameter. But how the WebSession should come
>>>> into
>>>> the HttpSession without setting it from the wicket code?
>>>>
>>>> Tom
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Johan Compagner <jc...@gmail.com>.
look at the source :)

On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>
> Matej and Johan, thanks for your feed-back. I've tried to avoid the
> WicketSessionFilter and make everything work from our code. Just curious:
> is
> the WicketSessionFilter handled something special by Wicket? Or how does
> it
> get the WebSession reference?
>
> Tom
>
>
> Matej Knopp wrote:
> > You don't interact with WicketSessionFilter directly.  You just set it
> up,
> > providing name of your WicketFilter ad argument. You need to map the
> > WicketSessionFilter to same url as your non-wicket filter/servlet and
> make
> > sure that you use a non-wicket filter WicketSessionFilter gets invoked
> > first.
> >
> > Then in your custom filter/servlet you can obtain wicket session using
> just
> > Session.get().
> >
> > -Matej
> >
> > On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
> >> What is the preferred way of obtaining a WebSession from a
> >> non-Wicket-Filter/Servlet. I've taken a look at WicketSessionFilter,
> but
> >> this one requires a filterName init parameter and seems to expect the
> >> session as a HttpSession parameter. But how the WebSession should come
> >> into
> >> the HttpSession without setting it from the wicket code?
> >>
> >> Tom
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Thomas Singer <wi...@regnis.de>.
Matej and Johan, thanks for your feed-back. I've tried to avoid the 
WicketSessionFilter and make everything work from our code. Just curious: is 
the WicketSessionFilter handled something special by Wicket? Or how does it 
get the WebSession reference?

Tom


Matej Knopp wrote:
> You don't interact with WicketSessionFilter directly.  You just set it up,
> providing name of your WicketFilter ad argument. You need to map the
> WicketSessionFilter to same url as your non-wicket filter/servlet and make
> sure that you use a non-wicket filter WicketSessionFilter gets invoked
> first.
> 
> Then in your custom filter/servlet you can obtain wicket session using just
> Session.get().
> 
> -Matej
> 
> On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>> What is the preferred way of obtaining a WebSession from a
>> non-Wicket-Filter/Servlet. I've taken a look at WicketSessionFilter, but
>> this one requires a filterName init parameter and seems to expect the
>> session as a HttpSession parameter. But how the WebSession should come
>> into
>> the HttpSession without setting it from the wicket code?
>>
>> Tom
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.get() from non-Wicket-Filter/Servlet and the RequestCycle

Posted by Matej Knopp <ma...@gmail.com>.
You don't interact with WicketSessionFilter directly.  You just set it up,
providing name of your WicketFilter ad argument. You need to map the
WicketSessionFilter to same url as your non-wicket filter/servlet and make
sure that you use a non-wicket filter WicketSessionFilter gets invoked
first.

Then in your custom filter/servlet you can obtain wicket session using just
Session.get().

-Matej

On 8/31/07, Thomas Singer <wi...@regnis.de> wrote:
>
> What is the preferred way of obtaining a WebSession from a
> non-Wicket-Filter/Servlet. I've taken a look at WicketSessionFilter, but
> this one requires a filterName init parameter and seems to expect the
> session as a HttpSession parameter. But how the WebSession should come
> into
> the HttpSession without setting it from the wicket code?
>
> Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>