How to use JSF 2.2 with JBoss 7.1

As the new JSF 2.2 is nearly finished, we all want to play with the new features of it. Markus Eisele has shown in his blog post Testdriving Mojarra 2.2.0-m08 how to do this with Glassfish 3. He’s German too, I begin to wonder if only we guys are that curious or no one else is using JSF any more ;) Unfortunately with JBoss 7 we face the same problem he had: We can not just add the new libraries to our WAR archive as they will clash with the JSF 2....

January 17, 2013 · 3 min · admin

Doing EJB-like transactions with Google App Engine

Using Google App Engine you can’t define a method as transactional with a simple annotation as you can in EJB. You always need to call some boilerplate code which gets quite annoying. Therefore the following utility class comes handy, which takes care of the transaction handling for you: https://gist.github.com/marcusschiesser/5474348 To make use of it, you have to set the same persistence unit as in your persistence.xml configuration file first. Do this by changing the parameter of the method createEntityManagerFactory....

January 5, 2013 · 2 min · admin

Using the Facebook Graph API from your GWT application

January 3, 2013 · 0 min · admin

Storing files RESTful in the cloud using Google App Engine

Do you want to store files RESTful in the cloud? Why not use the Google App Engine for it? Firstly you will need a entity class that is storing the file in the data store: @Entity public class FileEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long key; private Blob content; private String mediaType; public Long getKey() { return key; } public Blob getContent() { return content; } public void setContent(Blob content) { this....

December 1, 2011 · 2 min · admin

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