You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by hok <iv...@gmail.com> on 2011/06/03 13:24:35 UTC

Re: WicketSessionFilter and ignorePaths in WicketFilter

Hello,
after some investigation I reached to the following:
when a wicket session is created it is added as attribute to the
HttpSession:
HttpSessionStore.bind(), and inside it

setAttribute(request, getSessionAttribute(), newSession);

If we assume that inside web.xml the WicketFilter name is "WICKET_FILTER",
the getSessionAttribute() method returns "sessionWICKET_FILTER". Then,
inside 
setAttribute(request, getSessionAttribute(), newSession);
the attribute name, by which the wicket session will be stored in the
HttpSession is formed as
String attributeName = getSessionAttributePrefix(request) + name;, where
name is "sessionWICKET_FILTER" and getSessionAttributePrefix(request)
returns "wicket:WICKET_FILTER:"
As a result of all this the wicket session is stored in HttpSession with
attribute named 
"wicket:WICKET_FILTER:sessionWICKET_FILTER"

On the other hand when the WicketSessionFilter is asked for the session, it
forms it's own attribute value of the stored session:
Inside WicketSessionFilter.getSession() (line 208):
sessionKey = application.getSessionAttributePrefix(null, filterName) +
Session.SESSION_ATTRIBUTE_NAME;, where
application.getSessionAttributePrefix(null, filterName) returns
"wicket:WICKET_FILTER:" and Session.SESSION_ATTRIBUTE_NAME is "session". As
a result WicketSessionFilter tries to get the session with attribute named
"wicket:WICKET_FILTER:session"

The attribute names from HttpSessionStore
("wicket:WICKET_FILTER:sessionWICKET_FILTER") and
WicketSessionFilter("wicket:WICKET_FILTER:session") are different and the
session cannot be retrieved.




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/WicketSessionFilter-and-ignorePaths-in-WicketFilter-tp3570291p3570577.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: WicketSessionFilter and ignorePaths in WicketFilter

Posted by hok <iv...@gmail.com>.
Yes, it's wicket 1.5
https://issues.apache.org/jira/browse/WICKET-3769
https://issues.apache.org/jira/browse/WICKET-3769 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/WicketSessionFilter-and-ignorePaths-in-WicketFilter-tp3570291p3570704.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: WicketSessionFilter and ignorePaths in WicketFilter

Posted by Martin Grigorov <mg...@apache.org>.
Is this Wicket 1.5 ?
Create a quickstart and attach it to Jira.

On Fri, Jun 3, 2011 at 2:24 PM, hok <iv...@gmail.com> wrote:
> Hello,
> after some investigation I reached to the following:
> when a wicket session is created it is added as attribute to the
> HttpSession:
> HttpSessionStore.bind(), and inside it
>
> setAttribute(request, getSessionAttribute(), newSession);
>
> If we assume that inside web.xml the WicketFilter name is "WICKET_FILTER",
> the getSessionAttribute() method returns "sessionWICKET_FILTER". Then,
> inside
> setAttribute(request, getSessionAttribute(), newSession);
> the attribute name, by which the wicket session will be stored in the
> HttpSession is formed as
> String attributeName = getSessionAttributePrefix(request) + name;, where
> name is "sessionWICKET_FILTER" and getSessionAttributePrefix(request)
> returns "wicket:WICKET_FILTER:"
> As a result of all this the wicket session is stored in HttpSession with
> attribute named
> "wicket:WICKET_FILTER:sessionWICKET_FILTER"
>
> On the other hand when the WicketSessionFilter is asked for the session, it
> forms it's own attribute value of the stored session:
> Inside WicketSessionFilter.getSession() (line 208):
> sessionKey = application.getSessionAttributePrefix(null, filterName) +
> Session.SESSION_ATTRIBUTE_NAME;, where
> application.getSessionAttributePrefix(null, filterName) returns
> "wicket:WICKET_FILTER:" and Session.SESSION_ATTRIBUTE_NAME is "session". As
> a result WicketSessionFilter tries to get the session with attribute named
> "wicket:WICKET_FILTER:session"
>
> The attribute names from HttpSessionStore
> ("wicket:WICKET_FILTER:sessionWICKET_FILTER") and
> WicketSessionFilter("wicket:WICKET_FILTER:session") are different and the
> session cannot be retrieved.
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/WicketSessionFilter-and-ignorePaths-in-WicketFilter-tp3570291p3570577.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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