spring

May 13 2011

Proxies and Aspects in Spring

In my latest project I had a requirement to log the inputs and outputs generated by a method with the same name across multiple objects. This was a little more complicated than the functionality included in the SimpleTraceInterceptor and the DebugInterceptor provided by Spring (http://java.dzone.com/articles/using-spring-aop-trace ) since some processing was involved.

Instead of directly modifying every single one of my classes I decided to take advantage of the support for Aspects that Spring has. There are several sites that describe how to configure an aspect using Spring, including the Spring documentation (http://static.springsource.org/spring/docs/2.5.0/reference/aop.html ). After following those instructions I end up with the following:

Read More

Dec 31 2010

Highlevel Spring Portlet MVC Overview

I have received some general Spring MVC questions regarding my Integrating Spring into your Weblogic Portal post.  So in this post I will briefly describe a simple Spring Portlet MVC example along with some of the important annotations that can be used when developing Spring Controllers with version 2.5 or greater.

Read More

May 19 2010

Integrating Spring into your Weblogic Portal

Switching out your Weblogic Page Flow Controllers in favor of Spring Controllers is easier than you might think. Here are just a few steps to help the integration.

Dependencies

The latest production release version of Spring is version 3.0.2. In this version they have broken the release into about 20 different jar files. The libraries listed below are those that you will need to include in the WEB-INF/lib your project:

Read More

Feb 04 2010

Exposing JMX Beans in Weblogic using Spring

Eric Miles and I were working on different clients that were both utilizing the Weblogic application and the Spring framework.  Each of needed a way to expose some of the configuration items as JMX beans so that production support folks could change the values of these items at runtime without requiring server re-boots.  Because both of us were using Spring, exposing the beans was fairly straight forward, we just followed the Spring documentation for exporting JMX beans.

 

Read More

Nov 13 2009

Spring 3 Example Portlet and Overview

Spring Source pushed the first release candidate of Spring 3 a little more than a month ago; it took a little longer than expected, but nonetheless I've been waiting on this release to play around with the new Portlet MVC features.

For portlet developers, the most notable enhancements are in the support for the Portlet 2.0 spec (JSR286), primarily offered through a new set of portlet-specific annotations. There are also various enhancements to Spring Core and Web MVC that will be useful on portal projects and standard java web projects.

I've built an example portlet application to show off some of these new features; it's downloadable below as a deployable WAR (tested on JBoss Portal 2.7.2) and a mavenized eclipse project (zip). 

Read More

Nov 12 2009

Implementing an iPhone friendly REST Service with Jersey, Spring and JAXB

This article provides a specific example, with code, of using Jersey and JAXB to implement a REST service suitable for consumption by an iPhone application.  It follows an earlier article (http://blogs.captechventures.com/blog/jack-cox/components-enterprise-iphone-restful-applications) in which I surveyed the components that can be used to create an iPhone application that consumes a REST service.

Components

Jersey

Jersey is an open source reference implementation of the JSR-311 (JAX-RS) specification provided by Sun.  In my client work with Jersey, it has proven to be a reliable and lightweight framework for providing REST endpoints and it integrates well with Spring, which will be shown later. 

Jersey is available from Sun at https://jersey.dev.java.net

Read More

Tagged: iphone, JAXB, mobile, REST, spring

Feb 27 2009

Alfresco Web Forms Integration - Mock JSF Faces Context

On my current project, we are using Alfresco and working on an integration with JBoss Portal. In particular, we were creating our own version of Alfresco WebForms editor that is built into their web client.

Read More

Feb 27 2009

Spring Portlet MVC Implicit Model

Do you use Spring Portlet MVC? Have you ever noticed the ImplicitModel request parameter in your URL? It looks something like:

org.springframework.web.portlet.mvc.ImplicitModel=true

Well, it’s a Spring Portlet MVC 2.5 feature and I was scratching my head trying to figure out what it does. It’s set by Spring under the covers, so I dug into their source code to understand it and thought I would share.

Read More

Jan 17 2009

Annotation-based Spring Portlet MVC Lifecycle

Jared Richardson spoke at a Richmond Java Users Group meeting I attended last week; his topic was about investing in yourself and your career - what he called career 2.0. At one point during the presentation, he noted that “if you can’t draw something, you don’t understand it”, which motivated me to finish a blog post I started a while back about Spring Portlet MVC.

Read More

Nov 04 2008

JSR250 RolesAllowed Support in Spring Portlet MVC

JSR250 defines the common annotations for Java. Included in these are the javax.annotation.security.* annotations, including @RolesAllowed, @DenyAll, and @PermitAll; they can be used in EJBs to protect service calls.

Read More

Tagged: captech, spring