Home » Java » Enterprise Java » Page 353

Enterprise Java

Securing a RESTful Web Service with Spring Security 3.1, part 3

1. Overview This tutorial shows how to Secure a REST Service using Spring and Spring Security 3.1 with Java based configuration. The article will focus on how to set up the Security Configuration specifically for the REST API using a Login and Cookie approach. 2. Spring Security in the web.xml The architecture of Spring Security is based entirely on Servlet ...

Read More »

Building a RESTful Web Service with Spring 3.1 and Java based Configuration, part 2

spring-interview-questions-answers

1. Overview This article shows how to set up a REST in Spring – the Controller and HTTP response codes, configuration of payload marshalling and content negotiation. 2. Understanding REST in Spring The Spring framework supports 2 ways of creating RESTful services: using MVC with ModelAndView using HTTP message converters The ModelAndView approach is older and much better documented, but ...

Read More »

Web-service learnings with Apache CXF

In my last couple of projects I worked with web-services, creating them at some places and consuming them at others. I felt that the standard tasks like creating a client, creating a web service etc are quite straight forward and there are enough resources if you get stuck. But with web services, it is some trivial task that can take ...

Read More »

Hibernate by Example – Part 2 (DetachedCriteria)

So last time we helped out justice league to effectively manager their super heroes. Today we focus on how The Avengers will be using Hibernate’s Detached Criteria to find out their enemies with respect to each superhero so as to protect their super heroes. You can download the working example from here. In this example we take only two entities ...

Read More »

Hibernate by Example – Part 1 (Orphan removal)

So i thought to do a series of hibernate examples showing various features of hibernate. In the first part i wanted to show about the Delete Orphan feature and how it may be used with the use of a story line. So let us begin :) Prerequisites: In order for you to try out the following example you will need ...

Read More »

What Is CDI, How Does It Relate to @EJB And Spring?

java-interview-questions-answers

A brief overview of dependency injection in Java EE, the difference between @Resource/@EJB and @Inject, and how does that all relate to Spring – mostly in the form of links. Context Dependency Injection (CDI, JSR 299) is a part of Java EE 6 Web Profile and itself builds on Dependency Injection for Java (JSR 330), which introduces @Inject, @Named etc. ...

Read More »

OSGI and Spring Dynamic Modules – Simple Hello World

In this pose st, we’ll take the first implementation we made using OSGi and use Spring Dynamic Modules to improve the application. Spring Dynamic Modules (Spring Dm) makes the development of OSGi-based applications a lot more easier. With that, the deployment of services is a lot easier. You can inject services like any other Spring beans. So let’s start with ...

Read More »

OSGi – Simple Hello World with services

In this post, we’ll develop a simple Hello World application with OSGi. We will use Felix as OSGi container. In the next post, we’ll continue with this application and use Spring Dynamic Modules to improve it. To make the development interesting, we will create two bundles: A bundle providing a service of HelloWorld A bundle consuming the service to print ...

Read More »

High Performance JPA with GlassFish and Coherence – Part 3

In this third part of my four part series I’ll explain strategy number two of using Coherence with EclipseLink and GlassFish. This is all about using Coherence as Second Level Cache (L2) with EclipseLink. General approach This approach applies Coherence data grid to JPA applications that rely on database hosted data that cannot be entirely pre-loaded into a Coherence cache. ...

Read More »