O'Reilly logo

Spring Security 3.x Cookbook by Anjana Mankale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrating JSF with Spring Security

Let's create a simple Apache MyFaces application in Eclipse. Also let's integrate Spring Security to JSF, and then demonstrate basic authentication.

Getting ready

  • You will need Eclipse Indigo or a higher version
  • Create a dynamic web project JSF
  • In your Eclipse IDE, create a dynamic web project: JSf_Spring_Security_Chapter_3_Recipe1
  • Create a source folder: src/main/java
  • Create a package: com.packt.jsf.bean
  • Create a Managed Bean: User.java
  • Use Tomcat server to deploy the application

How to do it...

Perform the following steps to implement a basic authentication mechanism with JSF and Spring Security:

  1. User.java is the Managed Bean of the application. It has two methods: sayHello() and reset():

    User.java class:

    package com.packt.jsf.bean; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required