Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Demo Application Using JSF, JPA, CDI with Jetty

DZone's Guide to

Demo Application Using JSF, JPA, CDI with Jetty

· Java Zone
Free Resource

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with IBM.

The previous version of the Knappsack Maven Archetypes included archetypes for creating projects using JSF, JPA, CDI and Bean Validation that can run in a servlet container such as Jetty or Tomcat. In order to put it through its paces I decided to create a little test social bookmarking application that lets users create accounts, and when logged in, add bookmarks and tag them. Users that are not logged in can view the bookmarks and filter them by user or tag, and the results are paginated.

The demo application is now included in the latest version of the Knappsack archetypes (1.0.5) which are in the central repository. The GAV information is :

<groupId>org.fluttercode.knappsack</groupId>
<artifactId>jee6-servlet-demo-archetype</artifactId>
<version>1.0.5</version>

Or you can just create a new application from the command line with :

mvn archetype:generate -DarchetypeGroupId=org.fluttercode.knappsack -DarchetypeArtifactId=jee6-servlet-demo-archetype 
-DinteractiveMode=false -DarchetypeVersion=1.0.5 -DgroupId=org.application -DartifactId=bookmarxrus -Dpackage=org.application

This lets you create a new instance of the demo application from the archetype so you can play with it (and break it!).

Alternatively, if you just want to poke around, you can just download the projects maven source from here (Bookmarking Java EE 6 Servlet Demo) , unzip it and use mvn jetty:run to start the app with the embedded Jetty instance and go to http://localhost:8080/bookmarxrus/.

The demo comes with pre-built data and a list of users, tags and URLs to get started with.

Bookmark Application Screenshot

 

From http://www.andygibson.net/blog/news/demo-application-using-jsf-jpa-cdi-with-jetty/

Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}