Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8446835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:01:32+00:00 2026-06-10T10:01:32+00:00

I am migrating JSF1.2 application to JSF 2.1. It has a Login page, which

  • 0

I am migrating JSF1.2 application to JSF 2.1. It has a Login page, which uses facelets template. And the template page has h:head tag. Login page has a tag h:selectBooleanCheckbox inside ui:composition/ui:define/h:form/a4j:outputPanel/h:panelGrid/h:panelGroup tags.

<h:selectBooleanCheckbox value="#{bean.alogin}" >
  <a4j:ajax event="click" execute="@form" render="loginPanel" />    
</h:selectBooleanCheckbox>

On click of check box, I am getting ‘ReferenceError: RichFaces is not defined’ in Browser Error Console.

The issue is same even with using f:ajax tag, and having

<h:outputScript name="jsf.js" library="javax.faces" target="head"/>

in template page/login page.

This issue (of not finding/loading js libs) is coming only on the First load of Login page. That means if I login to my application and logout and then use the above check box, there is no issue.

Please direct with any pointers and that will be very helpful.
Thanks very much in advance.

And following is the html generated in head tag:

<script src="/myapp/javax.faces.resource/jsf.js.faces?ln=javax.faces" type="text/javascript">&lt;!--
//--&gt;</script>

I have the two *.faces mappings in web.xml. One is CustomFilter (implementing javax.servlet.Filter) and the other is CustomServlet (extending org.apache.myfaces.webapp.MyFacesServlet).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:01:33+00:00Added an answer on June 10, 2026 at 10:01 am

    ReferenceError: RichFaces / jsf is not defined

    This is a JavaScript error. This means that neither var RichFaces = ...; nor var jsf = ...; is anywhere been defined in JavaScript context. This in turn means that auto-including the JSF and RichFaces-provided JavaScript files jsf.js and richfaces.js has failed. This can in turn be caused by not having used the <h:head> component to declare the HTML head which is a mandatory hook for JSF to auto-include JavaScript files.

    Apparently you forgot to replace the

    <head>
        ...
    </head>
    

    in your templates by

    <h:head>
        ...
    </h:head>
    

    Fix it accordingly.

    Using <h:outputScript name="jsf.js" library="javax.faces" target="head"/> only fixes the JSF part of the error, not the RichFaces part and is actually a workaround, not a solution.


    Update: as per your question update, you confirmed that you’ve mapped sort of a login Filter on the exact URL pattern of those resources (at least, the filter name “session filter” in combination with the problem symptoms described so far indicates that you’re blocking requests whereby the user is not logged-in). JSF resources are served by *.faces URL pattern through the FacesServlet as well and thus they are checked by that filter as well (if you have studied the generated <script src> URL closely, you’d have realized that).

    You likely need to alter your Filter to skip the logged-in check on those resources so that those resources won’t be redirected to the login page as well. You could do that by checking if the request URI does not concern the ResourceHandeler.RESOURCE_IDENTIFIER URLs.

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        HttpServletRequest req = (HttpServletRequest) request;
        HttpServletResponse res = (HttpServletResponse) response;
    
        if (req.getRequestURI().startsWith(req.getContextPath() + ResourceHandler.RESOURCE_IDENTIFIER)) {
            chain.doFilter(request, response); // Skip JSF resources (CSS/JS/Images/etc)
            return;
        }
    
        // ... Continue your login check here.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am migrating application from JSF1.2/MyFaces+Facelets TO JSF2.1/MyFaces. I have following template which used
Migrating from Subversion to Git using svn2git (which internally uses git-svn) I'd like to
I'm currently migrating a legacy JSF 1.2 application using RichFaces 3.3 to JSF 2.0
I'm preparing to move my web application which was intially written with JSF 1.x
after migrating a system/database we modified a central table which has been used for
I am migrating a legacy bash script which runs inside a www server. I
Migrating a legacy application from WebSphere v.6 to WebSphere v.8. The application's web.xml only
Background: Migrating an application from ball of mud to MVC. Many classes contain HTML
I'm migrating my application from Rails 3.0.12 to 3.2. I use the active_record_store to
After migrating JSF from 1.2 to 2.0 I begin to receive exception after submitting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.