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

491
Vistas
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 Respuestas
Responde la pregunta

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 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