Using real POJOs (without JAXB Annotations) as transfer objects with JAX-RS

Are you annoyed that you have to annotate your POJOs with @XmlRootElement, so they can be used with JAX-RS? If your using Jersey as JAX-RS implementation your lucky: Just add to the <servlet> tag in your web.xml the following snippet: <init-param> <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name> <param-value>true</param-value> </init-param> After restarting your servlet, your POJOs are marshalled to JSON as a charme. Enjoy!

December 1, 2011 · 1 min · admin

JBoss-Migration: Von 4 über 5 nach 7

Die Migration einer Java Enterprise-Anwendung auf eine höhere JBoss-Version ist nicht an einem Nachmittag erledigt. Auf welche Probleme man stoßen kann, beschreibe ich in meinem Erfahrungsbericht: Von 4 über 5 nach 7, erschienen im JavaMagazin 10/2011. Behandelt wird die Migration einer J2EE-1.4-Anwendung von JBoss 4 bis 7. Vielen Dank an den Verlag (Software & Support Media GmbH), dass ich das PDF in meinem Blog nun zur Verfügung stellen darf.

November 18, 2011 · 1 min · admin

Let the user change the column order in Java/Swing

Do you have the requirement to let the user of your application change the order of his columns and your app is based on Swing? Then you should read further. Below you find a [TableColumnModel](http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/table/TableColumnModel.html) that has two states: STANDARD and USERDEFINED. In the STANDARD state the user may not change the order of the columns by drag’n’drop, in USERDEFINED he may. The good thing: If you toogle the state the column order is restored....

November 18, 2011 · 2 min · admin

Openbahn-API – Bahn-Webseite als Webservice

As this is only of interest for German users - this article is in German only. It’s about a new project of mine. Sorry folks. Ich bin gerade dabei eine Android-App zu entwickeln, mit der es möglich ist Fahrkarten für Bahn-Pendler einfacher zu buchen. Bei der Entwicklung ist mir aufgefallen, dass die Bahn leider keine Webservices nach außen zur Verfügung stellt – die Webseite www.bahn.de ist zusammen mit der mobilen Variante m....

June 22, 2011 · 2 min · admin

How to detect whether an element is in a scrollable parent

Just think of having an element in a scrollable parent (the CSS property overflow is set to scroll) and you want to test whether the element is visible or not. Using this little function you can do the trick: function isInView(node){ var offsetParent = node.offsetParent; var top = offsetParent.scrollTop; var height = offsetParent.offsetHeight; var y = node.offsetTop; return y >= top && y <= (top + height); } And here’s a small use case - this one scrolls the element into the visible region, if it is not already in the view:...

November 2, 2009 · 1 min · admin