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

488
Visualizações
oamSubmit.js not included when f:ajax is present on a page

I am running into a weird problem when using myfaces that is driving me nuts. I tried versions 2.2.10 and 2.2.12. I also use primefaces 6.0 but that might not be relevant.

Whenever I include an f:ajax tag on a page, commandLink no longer works and I get an error in the JavaScript console:

ReferenceError: myfaces is not defined

Digging deeper it turns out that the following line is no longer generated when there is a f:ajax tag on the page:

<script type="text/javascript" src="/console/javax.faces.resource/oamSubmit.js.jsf?ln=org.apache.myfaces"></script>

When I manually add this script line everything works again! I do this by adding the folling javascript just after the tag:

<script>
if (!window.myfaces) {
  document.write(unescape('%3Cscript type="text/javascript" src="/console/javax.faces.resource/oamSubmit.js.jsf?ln=org.apache.myfaces"%3E%3C/script%3E'));
}
</script>

Although everything seems to be working fine with this hack it gives me an uneasy feeling to have to do this. Can anyone shed a light on the cause of this issue?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Same issue here. I stumbled upon mojarra is not defined when javax.faces.PROJECT_STAGE is Production and submitForm() not defined for myfaces.JSF_JS_MODE 'minimal-modern' and found out that the issue is only present in javax.faces.PROJECT_STAGE=Production.

Adding

<context-param>
    <param-name>org.apache.myfaces.JSF_JS_MODE</param-name>
    <param-value>minimal</param-value>
</context-param>

to the web.xml fixed the issue for me.

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