Define Restful web services using Spring

In one of my project, I had the difficult decision to switch to another technology: I replaced JSF with Angular-JS. Our goal was to speed up the development by removing the painful part implied with JSF, as a lot of server requests to manage, some view state issues, the refresh management, the need to implement… Continue reading Define Restful web services using Spring

Spring Security with JSF 2 and custom login form

Here, I am integrating Spring Security with JSF 2 using a custom login form. First, the maven dependencies for Spring-Security (I consider that the JSF project is already set-up, if it is not the case, you can check here): <properties> … <spring.security.version>3.2.4.RELEASE</spring.security.version> </properties> … <!– Spring-Security dependencies –> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> <version>${spring.security.version}</version> </dependency> <dependency> <groupId>org.springframework.security</groupId>… Continue reading Spring Security with JSF 2 and custom login form

Maven config for JSF2/RichFaces

Here is my Maven configuration for a JSF2/Richfaces project: <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <groupId>net.classnotfound</groupId> <artifactId>jsf</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>jsf</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <org.apache.myfaces.version>2.2.0</org.apache.myfaces.version> <org.richfaces.version>4.3.5.Final</org.richfaces.version> </properties> <dependencies> <!– web container dependencies –> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-jasper</artifactId> <version>7.0.50</version> <scope>provided</scope> </dependency> <!– JSF dependencies –> <dependency>… Continue reading Maven config for JSF2/RichFaces

Access Spring context from web application

As I am using JSF with Spring, the beans managed by Spring are not accessible in my page, I used this Siegfried Bolz’s blog as a basis and used the facade pattern to hide access to the context. The Spring context is loaded when the application starts using ContextLoaderListener in the apllication web.xml: <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>… Continue reading Access Spring context from web application