You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by vov <vo...@mail.ru> on 2011/04/29 16:52:01 UTC

Nothing happens on AJAX call after session timeout

This issue same with
http://apache-wicket.1842946.n4.nabble.com/Session-timeout-AJAX-enabled-controls-td1893184.html
but there is no response to the last comment

After session expire nothing happend for user if he click to AJAX link - but
PageExpiredException needs.
In 'wicket ajax debug' window fallowing error displayed:

ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could not
find root <ajax-response> element

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3483872.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: Nothing happens on AJAX call after session timeout

Posted by vov <vo...@mail.ru>.
JSP used only for Tomcat FORM
authentication(http://onjava.com/onjava/2002/06/12/form.html)

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3512818.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: Nothing happens on AJAX call after session timeout

Posted by Martin Grigorov <mg...@apache.org>.
There is some JSP involved in this app. I give up.

On Fri, May 6, 2011 at 4:19 PM, vov <vo...@mail.ru> wrote:
> http://apache-wicket.1842946.n4.nabble.com/file/n3502992/Test.rar Test.rar
>
> Please, see attached. It's test eclipse project for this case.
> It's based on the Tomcat FORM authentication(imho this is a cause for AJAX
> strange behavior)
> Make sure that for testing you will need append user in your
> tomcat-users.xml
> <tomcat-users>
>  <role rolename="user"/>
>  <user password="1" roles="user" username="user"/>
> </tomcat-users>
>
> After session expired ajax link does not work.
> For testing will be easy remove session cookies after authentication.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3502992.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


Re: Nothing happens on AJAX call after session timeout

Posted by vov <vo...@mail.ru>.
http://apache-wicket.1842946.n4.nabble.com/file/n3502992/Test.rar Test.rar 

Please, see attached. It's test eclipse project for this case.
It's based on the Tomcat FORM authentication(imho this is a cause for AJAX
strange behavior)
Make sure that for testing you will need append user in your
tomcat-users.xml
<tomcat-users>
  <role rolename="user"/>
  <user password="1" roles="user" username="user"/>
</tomcat-users>

After session expired ajax link does not work.
For testing will be easy remove session cookies after authentication.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3502992.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: Nothing happens on AJAX call after session timeout

Posted by Martin Grigorov <mg...@apache.org>.
Please create a demo application and attach it to a ticket

On Thu, May 5, 2011 at 8:42 AM, vov <vo...@mail.ru> wrote:
> Do not work with Wicket 1.4.17.
> Can anybody post comment to last comment to
> http://apache-wicket.1842946.n4.nabble.com/Session-timeout-AJAX-enabled-controls-td1893184.html
> ?
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3497673.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


Re: Nothing happens on AJAX call after session timeout

Posted by vov <vo...@mail.ru>.
Do not work with Wicket 1.4.17.
Can anybody post comment to last comment to
http://apache-wicket.1842946.n4.nabble.com/Session-timeout-AJAX-enabled-controls-td1893184.html
?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3497673.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: Nothing happens on AJAX call after session timeout

Posted by Martin Grigorov <mg...@apache.org>.
try with latest versions of Wicket (1.4.17 or 1.5-RC3)

On Fri, Apr 29, 2011 at 5:52 PM, vov <vo...@mail.ru> wrote:
> This issue same with
> http://apache-wicket.1842946.n4.nabble.com/Session-timeout-AJAX-enabled-controls-td1893184.html
> but there is no response to the last comment
>
> After session expire nothing happend for user if he click to AJAX link - but
> PageExpiredException needs.
> In 'wicket ajax debug' window fallowing error displayed:
>
> ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could not
> find root <ajax-response> element
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3483872.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


Re: Nothing happens on AJAX call after session timeout

Posted by vov <vo...@mail.ru>.
And new question occur - how can I close all modal windows before redirecting
to HomePage. Or how to redirect to Home Page my main window but not a modal?


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3520243.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: Nothing happens on AJAX call after session timeout

Posted by vov <vo...@mail.ru>.
I found the solutions but I do not know that it fully safely.
variable wicketGlobalFailureHandler is used in wicket-ajax.js for
registration of failure handlers.

I added this code to my BaseWebPage class which superclass for all my pages:

add(new AbstractBehavior()
    {
      @Override
      public void renderHead(IHeaderResponse response)
      {
        super.renderHead(response);
        response.renderOnDomReadyJavascript( //
            "wicketGlobalFailureHandler = function(){window.location = '"
                +
RequestUtils.toAbsolutePath(urlFor(Application.get().getHomePage(),
null).toString()) + "'}");
      }
    });

Can anyone confirm that I will not have side effects?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3520170.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: Nothing happens on AJAX call after session timeout

Posted by vov <vo...@mail.ru>.
Thanks for your reply
Yes, I tried to use the filters but to no avail.
http://apache-wicket.1842946.n4.nabble.com/file/n3519427/request.png
request.png  this is data from 'Tamper Data' plugin for FireFox(action
clicking to link after session expired). May be it can help.





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3519427.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: Nothing happens on AJAX call after session timeout

Posted by Gabriel Landon <gl...@piti.pf>.
I've tried to use a filter without success because as explained 
http://www.mail-archive.com/users@tomcat.apache.org/msg75996.html here  :
Valves are called before filters, and Tomcat's authentication and
authorization are implemented as Valves. I don't believe you can have your
filter run before the auth Valve.


So in the request there is no "Wicket-Ajax" in the header when the session
is timeout to know if it's an ajax request.




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3519167.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: Nothing happens on AJAX call after session timeout

Posted by Gabriel Landon <gl...@piti.pf>.
Maybe you could try this to get the header :
http://download.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getHeader%28java.lang.String%29

And this for filter :
http://www.oracle.com/technetwork/java/filters-137243.html

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3515432.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: Nothing happens on AJAX call after session timeout

Posted by vov <vo...@mail.ru>.
Sorry for my may be stupid question but - how can I print the header?


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3514154.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: Nothing happens on AJAX call after session timeout

Posted by Martin Grigorov <mg...@apache.org>.
print the headers and look for 'Wicket-Ajax'
If there is such then create a XML like:
<ajax-response><redirect>[HERE THE URL YOU WANT TO REDIRECT
TO]</redirect></ajax-response>
and write this to the servlet response

On Wed, May 11, 2011 at 8:38 AM, vov <vo...@mail.ru> wrote:
> Can anyone give an example?
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3513980.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


Re: Nothing happens on AJAX call after session timeout

Posted by vov <vo...@mail.ru>.
Can anyone give an example?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3513980.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: Nothing happens on AJAX call after session timeout

Posted by Gabriel Landon <gl...@piti.pf>.
As explain in the post
http://apache-wicket.1842946.n4.nabble.com/Session-timeout-AJAX-enabled-controls-td1893184.html,
that's is because when you use container (Tomcat) authentification, the
login page is return in the ajax response when your session has expired.

Have you tried the workaround Igor gave :
in your servlet filter you will have to check for Wicket-Ajax header
and if it is present return a properly formatted ajax-response that
contains javascript to redirect to your login page.




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nothing-happens-on-AJAX-call-after-session-timeout-tp3483872p3513018.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