Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

319
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda