background preloader

Spring - Struts - Hibernate

Facebook Twitter

Bruce Phillips Blog on Java, ColdFusion, Flex and Spry: Using Jersey (RESTful Web Services) and Spring (Dependency Injection) Together. Introduction I worked on a project that uses Jersey RESTful web services that depend on other classes to do the actual work.

Bruce Phillips Blog on Java, ColdFusion, Flex and Spry: Using Jersey (RESTful Web Services) and Spring (Dependency Injection) Together

For example a web service that uses a data access object to get information out of a data repository. Since I like to use Spring to manage dependencies between classes, I needed to learn how to integrate Spring and Jersey. This article assumes you know how to use Jersey and Spring (if you don't check out all the references below). In this article I provide a simple example application that demonstrates how to use Spring to manage dependencies for a Jersey RESTful web service. Stereotype Annotations Cut Down XML Configuration in Spring. Nnotations have been part of the Spring Model-View-Controller (MVC) Framework since Spring 2.0.

Stereotype Annotations Cut Down XML Configuration in Spring

In Spring, annotations can greatly reduce the amount of XML bean configuration and wiring needed. Given the many components of the Spring MVC environment (handler mapping, controller, view resolver, and view), XML configuration can turn unwieldy in a hurry. So, Spring MVC configuration is certainly one area that can really benefit from reduced configuration. As of Spring 2.5, the framework added new annotations to more easily configure and assemble the components of a multi-layered application, such as you might find in an MVC-designed system. In fact, an important type of annotation added in Spring 2.5, stereotype annotations, is for configuring the Spring MVC controller components. Are these new annotations critical to your applications? In Spring framework 3.0 there will be a number of deprecations, for example, the old MVC controller hierarchy.

DeveloperIQ.in - Asia's #1 Software Technology magazine. Posted On April 26, 2011 by GB Shah filed under Programming , Java In the earlier articles we saw that Spring and Hibernate are established frameworks for middle tier and persistence tier respectively and Struts2 is one of the hottest frameworks for the web tier.

DeveloperIQ.in - Asia's #1 Software Technology magazine

The actions in Strut2 not only contains code to service requests but also act as data carriers and hence are model objects. For each request, an action object is created and this affects performance but makes coding simple. No separate data transfer objects (DTOs) are required and the action object pushed into the value stack are pulled by view objects and the data is retrieved and sent to the client.

This makes Struts2 a pull MVC2 framework. Book.java package pojo; SpringHibernateDAO.java and SpringHibernateDAOImpl.java package helper; import pojo.Book; public class SearchAction extends ActionSupport { private Book book; private List books; private SpringHibernateDAO shdao; public List getBooks() { return books; } Put together Struts2, JPA, Hibernate and Spring. This weekend I played a bit with Struts2. Obviously my first thought was to put together “fellowship of the ring” ie Struts, Spring and Hibernate.

Now, we have two ways for integrating Hibernate and I’ve chosen the Java Persistence Architecture approach, because is the latest trend in terms of persistence in the J2EE landscape. For the sake of simplicity I’ll take a simple example that contains Books and Authors. A book has one or more authors while one author wrote one or more books. This looks like a many to many relationship and we want to be able to get, from one shoot, the book and its authors and for an author his entire list of books.

Alfresco

Java Struts Spring Hibernate Tutorial - github.com/ chrishulbert/ JavaTutorial. Struts2, Spring 2 sans XML. Un article de ODcWiki. Autrefois Struts et Spring nécessitaient des fichiers de configuration XML qui avaient tendance à rapidement prendre de l'embonpoint. Nous verrons dans cet article comment tirer partie des progrès réalisés dans Struts 2.1 et Spring 2.5 pour remplacer le XML par des annotations. Librairies nécessaires Les librairies suivantes seront placées dans le dossier WEB-INF/lib (merci Maven) Struts2-jquery - Struts2 jQuery Plugin. A Plugin for the popular java web framework struts2 to provide ajax functionality and UI Widgets based on the jQuery javascript framework.

struts2-jquery - Struts2 jQuery Plugin

News Features AJAX support Easy AJAX Form submission and remote call with the anchor and div tag. Support for AJAX in the Tabs. <%@ taglib prefix="s" uri="/struts-tags"%><%@ taglib prefix="sj" uri="/struts-jquery-tags"%><html> <head> <sj:head/> </head> <body> <div id="div1">Div 1</div> <s:url id="ajaxTest" value="/AjaxTest.action"/> <sj:a id="link1" href="%{ajaxTest}" targets="div1"> Update Content </sj:a> </body></html> Support for themes Built in themes from jQuery black-tie blitzer cupertino dot-luv eggplant excite-bike flick hot-sneaks humanity le-frog mint-choc overcast pepper-grinder redmond smoothness start sunny swanky-purse trontastic ui-darkness ui-lightness vader Your custom theme create with jQuery ThemeRoller More about themes see the Head Tag Use of Build in themes: Use of your costume theme: UI widgets.

Struts, Spring, Hibernate

Hibernate Tutorial. Spring Tutorial. Spring IoC Tutorial Learn how the DI can be used to decouple the dependencies between different components.

Spring Tutorial

Bruce Phillips - Java Spring Framework. Thinking of U and I. Stateful and Stateless Session Bean Life Cycle.