Tag: Java EE
-
JAX-WS Custom Exception with FaultBean in TomEE and WebSphere Application Server
In our last post we were able to deploy a simple JAX-WS service on both TomEE and WebSphere Application Server. JAX-WS Specification suggests that three thing should be followed for us to implement Custom Exception as SOAP Fault. WrapperException(String message, FaultBean faultInfo) A constructor where WrapperException is replaced with the name of the generated wrapper…
-
JAX-WS Exception Handling with TomEE and WebSphere Application Server 8.5
Let’s write a simple JAX-WS example which will throw an Exception. We will then deploy it in TomEE and then to WebSphere 8.5 and see the difference. Download TomEE ( I have downloaded the plus version which at the time of writing was 1.7.1) Download and install WebSphere Application Server (Developer version is free) Download…
-
Spring Data JPA
Spring Data JPA provides a more cleaner approach of using JPA for DAO layer. It removes boilerplate code and developers can concentrate on actual logic. Our DataModel First create a maven project and add below dependencies: [sourcecode language=”xml”] <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>com.mumz.test.springdata.jpa</groupId> <artifactId>SpringDataJPA</artifactId> <version>0.0.1-SNAPSHOT</version> <properties> <spring.version>3.2.4.RELEASE</spring.version> <spring.data.version>1.3.4.RELEASE</spring.data.version> <hibernate.version>4.2.5.FINAL</hibernate.version> <jpa.version>1.0.1.FINAL</jpa.version> <querydsl.version>3.2.3</querydsl.version> <junit.version>4.8.2</junit.version> </properties>…
-
Integrating Primefaces and Spring Security
Following all previous steps we always configured JSF and Spring. In case we use third party library like Primefaces you will have to configure resources required by Primefaces manually in Spring Security xml. Extending example at if we had Primefaces lib in our project we will have to add below configuration to jsfspring-sec-security-config.xml [sourcecode language=”xml”]…
-
Audit Framework with Spring AOP and JPA
Every now and then we come across a common requirement of building an Audit framework. In simple words it means whenever a record is added, edited or removed there should be an entry made in a separate table so that different actions of users can be monitored. Today in this tutorial we will build an…
-
Accessing method arguments using Spring AOP
Earlier we used Spring AOP to weave common logging functionality to our BookShelf add and remove methods. But those were plain log statements, what if we want to log which Book is being added/removed. Spring AOP provides @Around advice which can be used to get this use case working. First we will enhance our Book.java…
-
Secure your business layer with JSR-250 and Spring Security in a JSF application
In the previouspost we looked at the different option that we have as part of Java EE and Spring security framework. In this tutorial we will see how we can leverage JSR-250 security annotation. To being with you need the source code from previous post. With some code behind us, let’s see how JSR-250 can…
-
Business Layer Security with Java EE and Spring
If you have read previous tutorial about Spring Security and JSF you would have noticed that all this time we have been speaking about securing our web layer. What about business layer ? In this post we will go through few ways of securing our business layer, and then in subsequent post we will see…