WicketSessionFilter and empty HttpSession

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

WicketSessionFilter and empty HttpSession

Altuğ Bilgin Altıntaş
Hi all ;


I am working on WicketSessionFilter for a while and i have problem about
accessing Wicket Session in my Servlet.

My question is :

In WicketSessionFilter.java (core class in wicket.1.3.6.jar)   at doFilter()
method

HttpSession httpSession = httpServletRequest.getSession(false);

above code returns the session.  But when my servlet post a request then
above code returns NULL . It  can not get the standard session object when a
simple servlet post a request.

Any idea why a servlet http post cause null http session in
WicketSessionFilter.java ?

Thanks.

Altug.



--
Altuğ.
Reply | Threaded
Open this post in threaded view
|

Re: WicketSessionFilter and empty HttpSession

Igor Vaynberg-2
that means session has not yet been created. you should use
Session.exists() to test for this.

-igor

On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaş<[hidden email]> wrote:

> Hi all ;
>
>
> I am working on WicketSessionFilter for a while and i have problem about
> accessing Wicket Session in my Servlet.
>
> My question is :
>
> In WicketSessionFilter.java (core class in wicket.1.3.6.jar)   at doFilter()
> method
>
> HttpSession httpSession = httpServletRequest.getSession(false);
>
> above code returns the session.  But when my servlet post a request then
> above code returns NULL . It  can not get the standard session object when a
> simple servlet post a request.
>
> Any idea why a servlet http post cause null http session in
> WicketSessionFilter.java ?
>
> Thanks.
>
> Altug.
>
>
>
> --
> Altuğ.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: WicketSessionFilter and empty HttpSession

Altuğ Bilgin Altıntaş
It is impossible, I can get Session Id but then when I call servlet ' s
doPost() method , WicketSessionFilter  can not find the HttpSession.

I mean :

HttpSession httpSession = httpServletRequest.getSession(false); //
WicketSessionFilter.java in wicket.1.3.6.jar

returns NULL.

so that my servlet throws Exception because

Session wicketSession = Session.get();

throws "java.lang.IllegalStateException: you can only locate or create
sessions in the context of a request cycle"


Thanks.


2009/7/27 Igor Vaynberg <[hidden email]>

> that means session has not yet been created. you should use
> Session.exists() to test for this.
>
> -igor
>
> On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaş<[hidden email]>
> wrote:
> > Hi all ;
> >
> >
> > I am working on WicketSessionFilter for a while and i have problem about
> > accessing Wicket Session in my Servlet.
> >
> > My question is :
> >
> > In WicketSessionFilter.java (core class in wicket.1.3.6.jar)   at
> doFilter()
> > method
> >
> > HttpSession httpSession = httpServletRequest.getSession(false);
> >
> > above code returns the session.  But when my servlet post a request then
> > above code returns NULL . It  can not get the standard session object
> when a
> > simple servlet post a request.
> >
> > Any idea why a servlet http post cause null http session in
> > WicketSessionFilter.java ?
> >
> > Thanks.
> >
> > Altug.
> >
> >
> >
> > --
> > Altuğ.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Altuğ.
Reply | Threaded
Open this post in threaded view
|

Re: WicketSessionFilter and empty HttpSession

Igor Vaynberg-2
thats why i said use Session.exists() to check first, and only call
Session.get() if Session.exists() returned true.

-igor

On Mon, Jul 27, 2009 at 9:45 AM, Altuğ B. Altıntaş<[hidden email]> wrote:

> It is impossible, I can get Session Id but then when I call servlet ' s
> doPost() method , WicketSessionFilter  can not find the HttpSession.
>
> I mean :
>
> HttpSession httpSession = httpServletRequest.getSession(false); //
> WicketSessionFilter.java in wicket.1.3.6.jar
>
> returns NULL.
>
> so that my servlet throws Exception because
>
> Session wicketSession = Session.get();
>
> throws "java.lang.IllegalStateException: you can only locate or create
> sessions in the context of a request cycle"
>
>
> Thanks.
>
>
> 2009/7/27 Igor Vaynberg <[hidden email]>
>
>> that means session has not yet been created. you should use
>> Session.exists() to test for this.
>>
>> -igor
>>
>> On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaş<[hidden email]>
>> wrote:
>> > Hi all ;
>> >
>> >
>> > I am working on WicketSessionFilter for a while and i have problem about
>> > accessing Wicket Session in my Servlet.
>> >
>> > My question is :
>> >
>> > In WicketSessionFilter.java (core class in wicket.1.3.6.jar)   at
>> doFilter()
>> > method
>> >
>> > HttpSession httpSession = httpServletRequest.getSession(false);
>> >
>> > above code returns the session.  But when my servlet post a request then
>> > above code returns NULL . It  can not get the standard session object
>> when a
>> > simple servlet post a request.
>> >
>> > Any idea why a servlet http post cause null http session in
>> > WicketSessionFilter.java ?
>> >
>> > Thanks.
>> >
>> > Altug.
>> >
>> >
>> >
>> > --
>> > Altuğ.
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> --
> Altuğ.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: WicketSessionFilter and empty HttpSession

Altuğ Bilgin Altıntaş
OK.

Problem occurs because of swfupload - swfupload.org/

swfupload is a flash based file upload tool and it doesn't send cookie
information in the http header so i can't access Wicket Session.

I am sending Session Id in URL when posting via swfupload; Is there any way
to access Session object assume that you know session Id ?

Thanks.





2009/7/27 Igor Vaynberg <[hidden email]>

> thats why i said use Session.exists() to check first, and only call
> Session.get() if Session.exists() returned true.
>
> -igor
>
> On Mon, Jul 27, 2009 at 9:45 AM, Altuğ B. Altıntaş<[hidden email]>
> wrote:
> > It is impossible, I can get Session Id but then when I call servlet ' s
> > doPost() method , WicketSessionFilter  can not find the HttpSession.
> >
> > I mean :
> >
> > HttpSession httpSession = httpServletRequest.getSession(false); //
> > WicketSessionFilter.java in wicket.1.3.6.jar
> >
> > returns NULL.
> >
> > so that my servlet throws Exception because
> >
> > Session wicketSession = Session.get();
> >
> > throws "java.lang.IllegalStateException: you can only locate or create
> > sessions in the context of a request cycle"
> >
> >
> > Thanks.
> >
> >
> > 2009/7/27 Igor Vaynberg <[hidden email]>
> >
> >> that means session has not yet been created. you should use
> >> Session.exists() to test for this.
> >>
> >> -igor
> >>
> >> On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaş<[hidden email]>
> >> wrote:
> >> > Hi all ;
> >> >
> >> >
> >> > I am working on WicketSessionFilter for a while and i have problem
> about
> >> > accessing Wicket Session in my Servlet.
> >> >
> >> > My question is :
> >> >
> >> > In WicketSessionFilter.java (core class in wicket.1.3.6.jar)   at
> >> doFilter()
> >> > method
> >> >
> >> > HttpSession httpSession = httpServletRequest.getSession(false);
> >> >
> >> > above code returns the session.  But when my servlet post a request
> then
> >> > above code returns NULL . It  can not get the standard session object
> >> when a
> >> > simple servlet post a request.
> >> >
> >> > Any idea why a servlet http post cause null http session in
> >> > WicketSessionFilter.java ?
> >> >
> >> > Thanks.
> >> >
> >> > Altug.
> >> >
> >> >
> >> >
> >> > --
> >> > Altuğ.
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
> >
> > --
> > Altuğ.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Altuğ.
Reply | Threaded
Open this post in threaded view
|

Re: WicketSessionFilter and empty HttpSession

Igor Vaynberg-2
no, there is not afaik. what you need to do is pass it in the url just
like the servlet container would

/context;JSESSIONID=xxxxx?foo=bar

-igor

On Mon, Jul 27, 2009 at 11:09 AM, Altuğ B. Altıntaş<[hidden email]> wrote:

> OK.
>
> Problem occurs because of swfupload - swfupload.org/
>
> swfupload is a flash based file upload tool and it doesn't send cookie
> information in the http header so i can't access Wicket Session.
>
> I am sending Session Id in URL when posting via swfupload; Is there any way
> to access Session object assume that you know session Id ?
>
> Thanks.
>
>
>
>
>
> 2009/7/27 Igor Vaynberg <[hidden email]>
>
>> thats why i said use Session.exists() to check first, and only call
>> Session.get() if Session.exists() returned true.
>>
>> -igor
>>
>> On Mon, Jul 27, 2009 at 9:45 AM, Altuğ B. Altıntaş<[hidden email]>
>> wrote:
>> > It is impossible, I can get Session Id but then when I call servlet ' s
>> > doPost() method , WicketSessionFilter  can not find the HttpSession.
>> >
>> > I mean :
>> >
>> > HttpSession httpSession = httpServletRequest.getSession(false); //
>> > WicketSessionFilter.java in wicket.1.3.6.jar
>> >
>> > returns NULL.
>> >
>> > so that my servlet throws Exception because
>> >
>> > Session wicketSession = Session.get();
>> >
>> > throws "java.lang.IllegalStateException: you can only locate or create
>> > sessions in the context of a request cycle"
>> >
>> >
>> > Thanks.
>> >
>> >
>> > 2009/7/27 Igor Vaynberg <[hidden email]>
>> >
>> >> that means session has not yet been created. you should use
>> >> Session.exists() to test for this.
>> >>
>> >> -igor
>> >>
>> >> On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaş<[hidden email]>
>> >> wrote:
>> >> > Hi all ;
>> >> >
>> >> >
>> >> > I am working on WicketSessionFilter for a while and i have problem
>> about
>> >> > accessing Wicket Session in my Servlet.
>> >> >
>> >> > My question is :
>> >> >
>> >> > In WicketSessionFilter.java (core class in wicket.1.3.6.jar)   at
>> >> doFilter()
>> >> > method
>> >> >
>> >> > HttpSession httpSession = httpServletRequest.getSession(false);
>> >> >
>> >> > above code returns the session.  But when my servlet post a request
>> then
>> >> > above code returns NULL . It  can not get the standard session object
>> >> when a
>> >> > simple servlet post a request.
>> >> >
>> >> > Any idea why a servlet http post cause null http session in
>> >> > WicketSessionFilter.java ?
>> >> >
>> >> > Thanks.
>> >> >
>> >> > Altug.
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Altuğ.
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [hidden email]
>> >> For additional commands, e-mail: [hidden email]
>> >>
>> >>
>> >
>> >
>> > --
>> > Altuğ.
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> --
> Altuğ.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: WicketSessionFilter and empty HttpSession

Altuğ Bilgin Altıntaş
Thanks Igor.

2009/7/27 Igor Vaynberg <[hidden email]>

> no, there is not afaik. what you need to do is pass it in the url just
> like the servlet container would
>
> /context;JSESSIONID=xxxxx?foo=bar
>
> -igor
>
> On Mon, Jul 27, 2009 at 11:09 AM, Altuğ B. Altıntaş<[hidden email]>
> wrote:
> > OK.
> >
> > Problem occurs because of swfupload - swfupload.org/
> >
> > swfupload is a flash based file upload tool and it doesn't send cookie
> > information in the http header so i can't access Wicket Session.
> >
> > I am sending Session Id in URL when posting via swfupload; Is there any
> way
> > to access Session object assume that you know session Id ?
> >
> > Thanks.
> >
> >
> >
> >
> >
> > 2009/7/27 Igor Vaynberg <[hidden email]>
> >
> >> thats why i said use Session.exists() to check first, and only call
> >> Session.get() if Session.exists() returned true.
> >>
> >> -igor
> >>
> >> On Mon, Jul 27, 2009 at 9:45 AM, Altuğ B. Altıntaş<[hidden email]>
> >> wrote:
> >> > It is impossible, I can get Session Id but then when I call servlet '
> s
> >> > doPost() method , WicketSessionFilter  can not find the HttpSession.
> >> >
> >> > I mean :
> >> >
> >> > HttpSession httpSession = httpServletRequest.getSession(false); //
> >> > WicketSessionFilter.java in wicket.1.3.6.jar
> >> >
> >> > returns NULL.
> >> >
> >> > so that my servlet throws Exception because
> >> >
> >> > Session wicketSession = Session.get();
> >> >
> >> > throws "java.lang.IllegalStateException: you can only locate or create
> >> > sessions in the context of a request cycle"
> >> >
> >> >
> >> > Thanks.
> >> >
> >> >
> >> > 2009/7/27 Igor Vaynberg <[hidden email]>
> >> >
> >> >> that means session has not yet been created. you should use
> >> >> Session.exists() to test for this.
> >> >>
> >> >> -igor
> >> >>
> >> >> On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaş<[hidden email]>
> >> >> wrote:
> >> >> > Hi all ;
> >> >> >
> >> >> >
> >> >> > I am working on WicketSessionFilter for a while and i have problem
> >> about
> >> >> > accessing Wicket Session in my Servlet.
> >> >> >
> >> >> > My question is :
> >> >> >
> >> >> > In WicketSessionFilter.java (core class in wicket.1.3.6.jar)   at
> >> >> doFilter()
> >> >> > method
> >> >> >
> >> >> > HttpSession httpSession = httpServletRequest.getSession(false);
> >> >> >
> >> >> > above code returns the session.  But when my servlet post a request
> >> then
> >> >> > above code returns NULL . It  can not get the standard session
> object
> >> >> when a
> >> >> > simple servlet post a request.
> >> >> >
> >> >> > Any idea why a servlet http post cause null http session in
> >> >> > WicketSessionFilter.java ?
> >> >> >
> >> >> > Thanks.
> >> >> >
> >> >> > Altug.
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Altuğ.
> >> >> >
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: [hidden email]
> >> >> For additional commands, e-mail: [hidden email]
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > Altuğ.
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
> >
> > --
> > Altuğ.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Altuğ.
Reply | Threaded
Open this post in threaded view
|

Re: WicketSessionFilter and empty HttpSession

Zilvinas Vilutis
In reply to this post by Igor Vaynberg-2
CONTENTS DELETED
The author has deleted this message.