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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to