Articles Tagged ‘tutorial’
Sunday, May 27th, 2012
Many programmers have suffered when trying to setup an environment to handle updates for their application without much effort. Some tried Java Web Start for this purpose and many encountered difficulties with this approach.
Now there is getdown that aims to replace Java Web Start by offering a simple architecture to handle updates that is fast, realiable and the only thing you need is a normal http server. Though getdown lets us handle our updates really easy it is possible to make this process even easier with the getdown maven plugin.
In the following example we’re building a simple swing application to be installed, updated and launched using getdown.
(more…)
Tags: getdown, Java, maven, tutorial, webstart
Posted in Java | 18 Comments »
Monday, April 16th, 2012
The OSGi Blueprint Container specification allows us to use dependency injection in our OSGi environment, declarative import and export of OSGi services, registering lifecycle listeners and wiring dependencies into our services with a few lines of XML code.
In the following tutorial we’re first building an OSGi bundle classical style and afterwards take a trip into the advantages of the Blueprint specification.
Our OSGi container of choice here will be Apache Karaf a lightweight container with a lot of nice features and – of course – blueprint enabled…
(more…)
Tags: apache karaf, bind, blueprint, bundle, dependency injection, export, felix, listener, maven, osgi, service, springdm, tutorial, wiring
Posted in Enterprise, Java | 13 Comments »
Monday, March 26th, 2012
In today’s tutorial we’re exploring the world of faceted searches like the one we’re used to see when we’re searching for an item on Amazon.com or other websites. We’re using Hibernate Search here that offers an API to perform discrete as well as range faceted searches on our persisted data.
(more…)
Tags: discrete, entity, example, facet, hibernate, jboss, jpa, lucene, persistence, range, search, tutorial
Posted in Java | 2 Comments »
Friday, March 23rd, 2012
Having just returned from the Atlassian Camp 2012 I just toyed around with Java and Scala and wanted to share the following snippet that demonstrates how to mix code from both languages in a Maven project using the maven-scala-plugin.
(more…)
Tags: functional, Java, maven, scala, Snippet, tutorial
Posted in Java, Scala | No Comments »
Sunday, March 18th, 2012
Since I got a new tablet running Android 4.0 aka ice cream sandwich I wanted to play around a bit with the fragments API and creating an application for a tablet.
In the following tutorial, we’re going to build an application that renders several articles from a popular tech blog (just kidding) in a web view.
(more…)
Tags: adb, Android, fragment, ice-cream, mobile, tutorial
Posted in Android, Apps, Java | No Comments »
Thursday, October 6th, 2011
In today’s Android tutorial we’re going to take a look at Android’s Widget API and how to make a widget interact with a service using intents.
We’re going to create a fully functional application that allows us to enable or disable our smartphone’s screen lock settings using a widget that can be placed on our home screen.
Finally I am going to show how to use a smartphone to test and debug our application and connect it to the IDE.
(more…)
Tags: adb, Android, appwidgetprovider, intent, mobile, service, smartphone, tutorial, widget
Posted in Android, Java | 3 Comments »
Tuesday, August 30th, 2011
Sometimes in a developer’s life there is no clean API available to gather information from a web application .. no SOAP, no XML-RPC and no REST .. just a website hiding the information we’re looking for somewhere in its DOM hierarchy – so the only solution is screenscraping.
Screenscraping always leaves me with a bad feeling – but luckily there is a tool that makes this job at least a bit easier for a developer .. jsoup to the rescue!
(more…)
Tags: crawler, dom, extraction, html, jsoup, maven, parser, screenscraping, tutorial
Posted in Java | 2 Comments »
Tuesday, July 19th, 2011
Portlets are a common technology to create plug&play components for modern web applications and are specified by the Java Community Process in several specification requests.
In the following tutorial we’re going to learn how to create custom portlets and how to deploy and embed them in Liferay, the popular open-source enterprise portal.
In addition we’re taking a look at inter-portlet-communication and how to create portlets using annotations.
Finally we’re building a portlet-state-aware Java-Server-Faces portlet using the jsf-portlet-bridge mechanism.
(more…)
Tags: bridge, java server faces, jsf, jsr-168, jsr-286, liferay, portlet, portlet bridge, portletfaces, tutorial
Posted in Enterprise, Java | 2 Comments »
Sunday, June 5th, 2011
Message Driven Beans are no new concept due to the fact that they exist since EJB 2.0 but in Java EE 6 and the EJB 3.0 specification it is even more fun to use them.
In this tutorial we’re going to take a look at the specification and create an example application that transfers some objects via the Java Message Service to a Message-Driven Bean deployed on a GlassFish application server.
If you’re not interested in theory please skip to chapter 6 and directly start creating an application – otherwise we’ll begin with a short introduction into the JMS terminology and the concept of a Message-Driven-Bean..
(more…)
Tags: asynchronous, consumer, ejb, Enterprise, glassfish, java ee, jee, jms, mdb, message driven, messaging, publisher, tutorial
Posted in Enterprise, Java | 4 Comments »
Tuesday, May 31st, 2011

Behaviour Driven Development is the keyword when we’re talking about test scenarios written in an ubiquitous language, strong interaction with stakeholders, product owners or testers and well described, common understandable test scenarios.
The popular JBehave framework is our tool of choice here and allows us to decouple our test stories from the test classes, offers an integration for web tests using Selenium and finally there’s a helpful Maven plugin for JBehave, too.
After a short excursion into the principles of Behaviour Driven Development we’re going to write and implement test stories for simple acceptance tests and web tests using selenium.
(more…)
Tags: acceptance test, agile, bdd, behavior, ddd, jbehave, scenario, selenium, story, tdd, testing, tutorial, xp
Posted in Java | 19 Comments »
Tuesday, February 8th, 2011
Java EE 6 is out and it indeed offers an interesting stack of technologies. So in today’s tutorial we are going to build a small sample web application that builds on this stack using Enterprise JavaBeans, Java Persistence API, Bean Validation, CDI and finally Java Server Faces and PrimeFaces.
The application we’re going to develop is a simple blog app that allows us to create new articles, list them and – finally delete them. We’re also covering some additional topics like JSF navigation, i18n, Ajax-enabled components and the deployment on the GlassFish application server.
(more…)
Tags: bean, bean validation, cdi, eclipselink, ejb, example, glassfish, hibernate, IoC, java ee, javaee, jee, jndi, jsf, jsr-303, jsr-316, jsr-317, jsr-318, maven, mojarra, primefaces, toplink, tutorial, validator, weld
Posted in Java | 85 Comments »
Saturday, January 1st, 2011
Are you playing around with the shiny new 3.1 EJB API?
Using Maven for your Java projects?
Need an easy way to write and execute tests for your EJBs that depends on an Java Application Server?
No problem using Maven Archetypes, the Maven EJB Plugin and the GlassFish embedded Application Container..
(more…)
Tags: application server, arquillian, bean, ejb, embedded, enterprise java bean, example, glassfish, java ee 6, jee, jeeunit, jndi, jsr-318, junit, maven, testing, tutorial
Posted in Java | 8 Comments »
Tuesday, December 14th, 2010
You want to add some validation logic to your Java beans? You want to achieve this with some shiny extendable annotations? Then give the Java Bean Validation standard aka JSR-303 a try..
We’re going to use the reference implementation for bean validation, Hibernate Validator in this tutorial but there are also links to other alternatives like Oval or Apache Bean Validation.
So let’s begin and validate some stuff ..
(more…)
Tags: bean validation, example, hibernate validator, java persistence api, jpa, jsr-303, oval, tutorial, validation
Posted in Java | 2 Comments »
Thursday, November 25th, 2010
Often in a developer’s life there is a REST service to deal with and nowadays one wants a fast and clean solution to create a client for such a service.
The following tutorial shows a quick approach using JAX-RS with its reference implementation, Jersey in combination with JAX-B for annotation driven marshalling between XML or JSON structures and our Java-Beans.
(more…)
Tags: jax-b, jax-rs, jaxrs, jersey, jsr-311, marshalling, maven, rest, tutorial, webservice
Posted in Java, Web Services | 9 Comments »
Sunday, November 14th, 2010
In this tutorial we’re going to modify an existing Java Server Faces / JSF 2 web application by adding rich UI components to the existing layout.
Our tool of choice here is the PrimeFaces framework. It offers a wide range of interesting, customizable and (several) Ajax-enabled components that blend very well with JSF1+2 and also a solid documentation that allows a quick integration into existing projects.
(more…)
Tags: ajax, example, facelet, gui, java server faces, jsf, jsf2, mojarra, primefaces, themeroller, tutorial, widget
Posted in Java | 3 Comments »
Sunday, October 24th, 2010
You’re using the popular Confluence wiki? You’re using its RPC/SOAP API and missing a function you really need? Just extend the capabilities of the Confluence RPC API by programming a custom web service component – it is really easy and also well documented.
In this tutorial we’re going to take a look on how to quickly implement a SOAP service, securing it and putting its methods in a transactional context.
(more…)
Tags: Atlassian, Axis, Confluence, examples, plugin, rpc, soap, soapui, tutorial, webservice, wiki
Posted in Confluence, Web Services | No Comments »
Monday, October 11th, 2010
Today we’re going to take a look at the world of object-relational Mapping and how it is done using the Java Persistence API by creating some basic examples, mapping some relations and querying objects using JPQL or the Criteria API..
(more…)
Tags: annotation, criteria api, eclipselink, example, hibernate, javadb, jee, jpa, jpa2, jpql, jsr-317, junit, mercurial, orm, persistence, toplink, tutorial
Posted in Java | 1 Comment »
Monday, September 27th, 2010
Animations add some spice to our Android applications and the offered animation framework makes it easy to create custom animations and tweens.
So lets dance around and create some animations ;) ..
(more…)
Tags: activity, Android, animation, component, example, tutorial, tween
Posted in Android | 24 Comments »
Thursday, September 23rd, 2010
It is possible to create SOAP webservices with only a few lines of code using the JAX-WS annotations. In a productivity environment you might prefer using contract-first instead of code-first to create your webservice but for now we’re going to use the fast method and that means code-first and annotations olé!
(more…)
Tags: annotation, example, jax-ws, jsr224, soap, tutorial, webservice
Posted in Java, Web Services | 3 Comments »
Wednesday, August 4th, 2010
Today we’re going to take a look at Google’s App Inventor feature that offers programming-novices a nice possibility to enter the fabulous world of Android App programming without deeper knowledge of the API or complex SDK installations.
So lets build some stuff ..
(more…)
Tags: accelerometer, Android, app, app inventor, example, google, gui, sensor, Snippet, tutorial
Posted in Android | 3 Comments »
Sunday, July 25th, 2010
In this tutorial we will take a look at the development of a simple OSGi Web Application and what tools can save us some time.
The Maven Bundle Plugin makes our life much easier here as does the OSGi Bundle Repository that offers some nice bundles – in our case the servlet API and an embedded Jetty web server.
So lets develop some bundles ..
(more…)
Tags: activator, bundle, bundle repository, example, felix, jetty, maven, obr, osgi, servlet, tutorial
Posted in Java | 3 Comments »
Monday, July 12th, 2010
Since Confluence 3.2. there is a new plugin module type that allows you to deploy templates in a bundle via the plugin API.
In addition it is possible to assign these templates to specific spaces and preview available templates in the Confluence administration area.
So let’s build some sample templates..
(more…)
Tags: Confluence, example, maven, plugin, template bundle, tutorial, velocity
Posted in Confluence | 6 Comments »
Tuesday, July 6th, 2010
Protocol Buffers are a serialization format developed by Google- you might ask if another IDL is really needed here – is Google barking at the wrong tree?
But protocol buffers offer some advantages over data serialization via XML or JSON – Google says they (compared to XML)..
- are 3 to 10 times smaller
- are 20 to 100 times faster
- provide generated data access classes for programmatic use
- provide backward compatibility
So lets play around a little with protocol buffers in Java and build a small application that serializes and deserializes some data using a defined format..
Tags: example, google, GWT, idl, Java, marshalling, maven, protocol buffers, serialization, tutorial
Posted in Development | 2 Comments »
Saturday, June 5th, 2010
In this short tutorial we are going to build a Java Server Faces Web-Application using JSF2.0, Facelets, Maven and Hibernate as ORM Mapper.
The goals for this first step are: Setting up the project structure using Maven, defining a frame template/decorator and a registration facelet, creating a managed bean and mapping it’s values to the facelet, adding some basic validation, displaying validation errors and finally adding a navigation structure.
In step2 of this tutorial we are going to add persistence using Hibernate, add some security, create a custom UI component and add some AJAX.
The Mojarra JSF implementation is used for this tutorial – perhaps I’m going to post more about the MyFaces implementation in another tutorial.
(more…)
Tags: eclipse, example, facelet, glassfish, hibernate, java server faces, jee, jsf, jsf 2, jsf2, maven, mojarra, mvc, servlet, tomcat, tutorial
Posted in Development, Java | 6 Comments »
Sunday, May 30th, 2010
The Android SDK offers a nice API to receive information about available providers for location based services and get the current location and coordinates.
In this short tutorial we’re going to build a small activity that displays a list of available location providers and shows the current position using GPS services.
(more…)
Tags: activity, adt, Android, example, gps, lbs, location, mobile, sample, tutorial
Posted in Android | 2 Comments »
Sunday, May 23rd, 2010
Developing plugins for the Confluence Wiki a developer sometimes needs to save additional metadata to a page object using Bandana or the ContentPropertyManager. Wouldn’t it be nice if this metadata was available in the built-in Lucene index?
That is were the Confluence Extractor Module comes into play..
(more…)
Tags: Confluence, document, example, extractor, field, howto, indexer, lucene, luke, maven, plugin, search, tutorial
Posted in Confluence | 3 Comments »
Friday, May 14th, 2010
The integration of gestures into your android app adds some nice functionality and is made very easy using Google’s GestureBuilder application and the integrated GestureLibrary and Gesture Overlay API – so let’s build a sample app.
If you need some basic information regarding gestures on android first – take a look at this article.
(more…)
Tags: adt, Android, capturing, emulator, example, gesture, gesture overlay, gesturebuilder, Snippet, tutorial
Posted in Android | 14 Comments »
Tuesday, May 11th, 2010
Sometimes QR codes are a nice way to distribute information like calendar events, contact information, e-mail, geo-locations or internet addresses.
In the following article we’re going to encode information to QR code images using the ZXing library and afterwards decode information from a given QR code.
Finally we’re taking a look on online QR code generators and how to integrate the ZXing library in a Maven project.
(more…)
Tags: 2d, Android, barcode, generator, qr code, scanner, Snippet, tutorial, zxing
Posted in Android, Java | 5 Comments »
Monday, April 26th, 2010
In this tutorial we are going to build a simple todo app that is able to store simple todos in a database. The user is able to add new todos or delete old ones by clicking on a todo. For this tutorial we won’t use maven to keep it simple – if maven integration is desired – take a look at this tutorial. (more…)
Tags: activity, adb, Android, example, htc desire, logging, mobile, sqlite, tutorial
Posted in Android | 7 Comments »
Thursday, April 8th, 2010
Having written the article “How to build a Confluence SOAP client in 5 minutes” some readers asked me for some more information and help using the JAX-WS plugin that I mentioned in the article instead of the Axis plugin – so here we go ;) (more…)
Tags: Axis, Axis2, jax-ws, maven, maven2, soap, tutorial, webservice, wsdl, wsimport
Posted in Java, Web Services | 13 Comments »
Friday, March 26th, 2010
This short tutorial shows how to set-up a developer instance of the popular Confluence Wiki from Atlassian in a few minutes.
It’s a prerequisite for a few following tutorials regarding the Confluence API and plug-in development for this system.
We want a quick install so we are going to run Confluence with the embedded servlet container and HSQL database.
(more…)
Tags: Atlassian, Confluence, development system, guide, quick install, tutorial, wiki
Posted in Confluence, Development | No Comments »
Thursday, March 25th, 2010
Helo – today I wanted to post a small tutorial for a small index and search operation using the Lucene indexer and Maven for the project setup.
(more…)
Tags: demo, document, index, indexer, lucene, maven, multi-field-search, search, snippets, solr, tutorial
Posted in Java | 2 Comments »