Home » Tag Archives: Spring (page 43)

Tag Archives: Spring

Spring vs Guice: The one critical difference that matters

google-logo

Spring objects are recognized based on their names It doesn’t matter whether you use XML or Java config, a Spring scope is roughly like a Map<String, Object> structure. This means that you cannot have two objects with the same name. Why is this a bad thing? If you have a large application with lots of @Configuration classes or XML files, ...

Read More »

RESTEasy Tutorial Part-2: Spring Integration

jboss-resteasy-logo

RESTEasy provides support for Spring integration which enables us to expose Spring beans as RESTful WebServices.                     Step#1: Configure RESTEasy+Spring dependencies using Maven. <project xmlns='http:maven.apache.orgPOM4.0.0' xmlns:xsi='http:www.w3.org2001XMLSchema-instance' xsi:schemaLocation='http:maven.apache.orgPOM4.0.0 http:maven.apache.orgmaven-v4_0_0.xsd'> <modelVersion>4.0.0<modelVersion> <groupId>com.sivalabs<groupId> <artifactId>resteasy-demo<artifactId> <version>0.1<version> <packaging>war<packaging> <properties> <project.build.sourceEncoding>UTF-8<project.build.sourceEncoding> <org.springframework.version>3.1.0.RELEASE<org.springframework.version> <slf4j.version>1.6.1<slf4j.version> <java.version>1.6<java.version> <junit.version>4.8.2<junit.version> <resteasy.version>2.3.2.Final<resteasy.version> <properties> <build> <finalName>resteasy-demo<finalName> <build> <dependencies> <dependency> <groupId>junit<groupId> <artifactId>junit<artifactId> <scope>test<scope> <dependency> <dependency> ...

Read More »

Spring & JSF integration: Select Items

jsf-logo

With JSF, to use comboboxes, listboxes and checkboxes, you need to be aware of the javax.faces.model.SelectItem class. A SelectItem represents a single selectable option; it contains both the information needed for rendering, and the value that should be bound if the item is selected. Most of the time SelectItems are constructed with a value and a label: new SelectItem(Title.MISS, "Miss"); ...

Read More »

Spring & JSF integration: Internationalization and Localization

jsf-logo

If you are working on a JSF application that is targeted to multiple languages, you may well be familiar with the <f:loadBundle> tag. Even if your application does not support internationalization using message bundles is still probably a good idea. Under the hood the <f:loadBundle> tag reads messages from a Java java.util.ResourceBundle and, whilst this will work, Spring developers often ...

Read More »

Distribute Spring Beans in Oracle Coherence

oracle-coherence-logo

This article shows how to distribute Spring beans by using EntryProcessor and Portable Object Format(POF) features in Oracle Coherence. Coherence supports a lock-free programming model through the EntryProcessor API. This feature improves system performance by reducing network access and performing an implicit low-level lock on the entries. This implicit low-level locking functionality is different than the explicit lock(key) provided by ...

Read More »

Spring & JSF integration: Converters

jsf-logo

When working with any web framework, you invariable run into the need to convert data input by the user from a String to some other type. Both Spring and JSF have converter strategies to deal with this, although they are really quite different in both their design and capabilities. Lets start by looking at Spring. Spring 3 introduced a whole ...

Read More »

JAXB Custom Binding – Java.util.Date / Spring 3 Serialization

spring-interview-questions-answers

JaxB can handle Java.util.Date serialization, but it expects the following format: “yyyy-MM-ddTHH:mm:ss“. What if you need to format the date object in another format? I had the same issue when I was working with Spring MVc 3 and Jackson JSON Processor, and recently, I faced the same issue working with Spring MVC 3 and JAXB for XML serialization. Let’s digg ...

Read More »

Make your Spring Security @Secured annotations more DRY

spring-interview-questions-answers

Recently a user on the Grails User mailing list wanted to know how to reduce repetition when defining @Secured annotations. The rules for specifying attributes in Java annotations are pretty restrictive, so I couldn’t see a direct way to do what he was asking. Using Groovy doesn’t really help here since for the most part annotations in a Groovy class ...

Read More »

REST CXF for Spring JPA2 backend

spring-interview-questions-answers

In this demo, we will generate a REST/CXF application with spring/jpa2 backend. This demo presents the track REST-CXF of minuteproject. The model from demo 2 remains the same. The enrichment stays the same. But the tracks changes What is added are 2 layers: a DAO layer with spring integration on top of JPA2 a REST-CXF layer with JAX-RS annotation The ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close