Home » Java (page 627)

Java

Bootstrap a Web Application with Spring 3

spring-interview-questions-answers

1. Overview This is the first of a series of tutorials about setting up a RESTfull web application using Spring 3.1 with Java based configuration. The article will focus on bootstrapping the web application, discussing how to make the jump from XML to Java without having to completely migrate the entire XML configuration. 2. The Maven pom.xml     <project ...

Read More »

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 »

Java SE 7, 8, 9 – Moving Java Forward

Today (NOTE: October 4, 2011) was keynote day. JavaOne Keynote was happening this early morning from 8:30 to 10:30 am and one more time my press pass got me into it quite early. So I had the time taking some very personal pictures from all the key players while they were getting ready and probably nervous. Ballroom A+B is quite ...

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 »

Recycling objects to improve performance

Overview In a previous article I stated that the reason the deserialization of objects was faster was due to using recycled objects. This is potentially surprising for two reasons, 1) the belief that creating objects is so fast these days, it doesn’t matter or is just as fast as recycling yourself, 2) None of the serialization libraries use recycling by ...

Read More »