Showing posts with label spring. Show all posts
Showing posts with label spring. Show all posts

Thursday, September 18, 2014

Java + Vaadin + Spring: creating a basis for application's user interface. From the very beginning.

This article shows the way of creating java application with Vaadin user interface and Spring framework features.

Create a Vaadin application is very easy if you have installed corresponding eclipse plugin. Read http://vaadin.com/eclipse to get to know how to install the plugin and create vaadin application in a few mouse clicks.

Another way of creating vaadin application quickly is using Vaadin "application" archetype. Type the following string in the command line once you're getting into workspace directory:

mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7.1.8

NOTE: if you got an error : "The desired archetype does not exist (com.vaadin:vaadin-archetype-application:7.1.8)" execute this command: mvn archetype:update-local-catalog

I'd like to show old-school way of Vaadin integration into a simple web application. There are two solutions. Second solution I find more attractive, however it cannot be applied to Vaadin 6. Read more for details.

Thursday, July 31, 2014

Spring MVC, OSGI bundles and forwarding requests

I have a post in this blog with example of using OSGI servlet bridge and embedded OSGI framework. Now it's time to extend it.
Let's play with OSGI combining it with Spring MVC application.



With stackoverflow you can find some links to samples and explanations about Sprng MVC and OSGI
http://stackoverflow.com/questions/12832697/looking-for-an-osgi-with-spring-specifically-spring-mvc-tutorial
http://stackoverflow.com/questions/12331722/osgi-spring-mvc-bundle-nightmare-java-lang-classnotfoundexception-org-springf

In this article I'd like to show how does spring MVC application may use OSGI servlet-bundles.
1. My spring MVC application is going to be the main application with a fundamental business logic and it's going to be a bridge for bundles
2. I'd like to have a special bundle with a logic that is common for osgi bundles installed. Some kind of super bundle with general functionality.
3. Other bundles have it's logic implemented inside and also could interact with general bundle and main spring application forwarding its queries.

Step-by-step