Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

320
Vistas
Wicket ajax call from client causes error

After a time expires, my client wants us to prompt the user for a possible keepalive to the server. I put an AbstractAjaxBehavior in place, passed the URL to the client and issue the ajax request thusly:

Wicket.Ajax.ajax({u: document._sessionKeepAliveUrl});

The URL in the value there is:

./.?3-1.IBehaviorListener.0-

A breakpoint tells me the onrequest of the behavior is invoked. But then I get the following error on the client side:

Wicket.Ajax:  Wicket.Ajax.Call.failure: Error while parsing response: TypeError: Cannot read properties of null (reading 'getElementsByTagName')

So the solution mostly works. The behavior doesn't do anything with the response. What am I doing wrong. Note, this is Wicket 6 (our client doesn't want to pay for the time to upgrade since they haven't decided on our next framework).

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You need to add "wr": false to the attributes:

Wicket.Ajax.ajax({u: document._sessionKeepAliveUrl, "wr": false});

wr stands for "is Wicket Response" [1]. It tells Wicket Ajax/JS whether it should try to interpret the Ajax response or not.

By default Wicket.Ajax.get/post() deals with XML response generated by AbstractDefaultAjaxBehavior, but in your case you use its parent - AbstractAjaxBehavior, that may produce any kind of response, or even no response as in your case.

  1. https://github.com/apache/wicket/blob/3a1a614c1bce68f5eb4e62ae064b48c7bca508df/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxAttributeName.java#L69
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda