Playing with Struts2

Weekends are supposed to be nice with sunshine and warm temperatures, not so in Atlanta! Over the last weeks every day during the week had plenty of sunshine. Only on weekends it started to rain.

So I started looking at Struts2. Because of the example application the first steps are quite simple. Starting a web application with Maven2 is no problem anymore. I got the application with a different model running in less than 2 hours (needed to write the domain objects and services to access them over the database).

But then it started getting more complicated. First I moved the datasource to the JNDI tree in Tomcat6 by replacing the data-source definition from Spring2.0 and moving it into the context.xml file for Tomcat. By doing this I also had to copy the JDBC driver over to Tomcats lib folder. Then I tried to bind the EntityManager or EntityManagerFactory to the JNDI tree. It seemed quite simple, simply add some elements to the web.xml descriptor. The Servlet 2.5 specification has some elements but Tomcat doesn’t recognize them. So I spent reading more than 3 hours and downloaded the sources for investigations. It doesn’t helped, Tomcat refuses these elements. So I went back to use Spring2.0 for the entity manager.

Now Spring2.5 is out (great, yeah, …). So upgrading should be as easy as changing some numbers in Mavens pom.xml. It’s just that spring-jpa is integrated into spring-orm and when using jee:jndi-lookup somehow Spring wants to use a JDBC transaction manager. So include spring-jdbc and everything works.

A nice thing I also got my hands in is Dojo because of the Ajax capability of the simple application. From a 10 minute view it looks like an interesting messaging system in a single web page.

But now that the weekend is close to be over, back to real work 🙂 .


Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

Du kommentierst mit Deinem Abmelden /  Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden /  Ändern )


Du kommentierst mit Deinem Twitter-Konto. Abmelden /  Ändern )


Du kommentierst mit Deinem Facebook-Konto. Abmelden /  Ändern )


Verbinde mit %s