Video Tutorial – How to Create a Secure JSF JPA Application

Security

Watch this video to learn how to create a secure web application using multiple Java EE/Jakarta EE APIs and connect it to a MySQL 8 database in this comprehensive tutorial.

 

Comments (6)

Post a comment

Your email address will not be published. Required fields are marked *

Payara needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at any time. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, please review our Legal & Privacy Policy.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. 隆 川場

    Hello.
    It was a very interesting video!
    I would like to learn more,
    Can I download the source code?

  2. Fabio Turizo

    Hello 隆 川場,

    The source code of the complete application is available here: https://github.com/fturizo/SecureWebApplication

  3. Ivan Mayal

    Hello Fabio,

    I’ve learned a lot with this video tutorial. The login works perfect and I’ve been able to deploy the project with Netbeans and Payara.
    Just a question. The code
    public boolean isAllowedToSeeUsers(){
    return securityContext.isCallerInRole(“admin”);
    }
    Always returns false. Do you know how to fix it?

    Thanks by this super tutorial

    Ivan

    1. Richard Grin

      Add the declaration of the roles in web.xml and it should work then.
      For example

      Administrator
      admin

  4. Fabio Turizo

    Ivan, if the call to securityContext.isCallerInRole(“admin”) always returns false, you must review the configuration of the security constraints in the web.xml to make sure that the JSF pages are properly protected. Make sure that the URL patterns match the corresponding ‘app’ prefix

  5. Thomas

    Hi Fabio,

    Thank you very much for your help in this tutorial.

    I just have one problem currently when I try login with incorrect details I get the following error. My code is the same of your.

    javax.el.ELException: Expression cannot be null

    JSF1073: javax.faces.FacesException caught during processing of INVOKE_APPLICATION 5 : UIComponent-ClientId=, Message=Expression cannot be null|#]

    I can’t seem to fix this issue, I would be very greatful if you could point out where I might have gone wrong.

    Kind regards,
    T

Related Posts

End of Life and End of Support Software 3 minutes
Migration

End-of-Life Technology: How to Drive Innovation Without Compromising Stability

When legacy systems approach end-of-life (EOL), enterprise IT teams typically face the choice of moving forward at all costs […]

Timeline showing Payara Platform Enterprise 4, 5, and 6 support phases (Full, Extended, Lifetime) from 2023–2033, along with JDK 8, 11, 17, and 21 support periods and end-of-life markers. 4 minutes
Thought Leadership

Understanding the Payara Platform Enterprise Software Lifecycle: How We Support Long-Term Stability 

Keeping an application server running smoothly isn’t so much about new features, but more about predictability and consistency. Software […]

Patrik Dudits presenting at Devoxx Belgium 2025 5 minutes
Cloud & Microservices

Devoxx BE 2025: It Only Starts with a Container & How Abstraction Becomes Reality 

At Devoxx Belgium 2025, I was able to talk about what happens after you build your container. In theory, […]