Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

484
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!