Articles for the ‘Web’ Category
Sunday, November 9th, 2014
Having written two articles about different websocket based chat server implementations in Java, I was recently asked how an implementation of the client side would look like in Java.
That’s why I added this article to demonstrate how to create a websocket chat client applications within a few steps with the Java API for Websocket.
In the following tutorial, we’re going to write a text-based chat client for the console first and afterwards we’re going to program a chat client with a graphical user interface, implemented in JavaFX.
(more…)
Tags: chat, client, fxml, glassfish, java fx, javafx, json, jsr-353, jsr-356, maven, websocket, websockets
Posted in Java, Web | 14 Comments »
Tuesday, August 26th, 2014
There are several ways to aggregate and report application performance indicators in a Java application. One common way here is to use Java Management Extensions (JMX) and MBeans.
The Yammer Metrics Library eases this task for us and simplifies the aggregation of different reports.
In the following tutorial, we’re going to set up a full Java EE 7 web application by the help of Maven archetypes and we’re running the application on WildFly application server that is downloaded and configured completely by the WildFly Maven Plugin.
Finally our application is going to use the Java API for JSON Processing to parse lists of public repositories from the Bitbucket REST API to aggregate different reports, exported via JMX so that we’re finally able to view these reports with jconsole or jmeter.
(more…)
Tags: benchmark, bitbucket, discovery, gauge, glassfish, javaee, javaee7, jconsole, jmeter, jmx, json, jsonp, mbean, metrics, metrics-cdi, monitoring, performance, producer, wildfly, yammer
Posted in Enterprise, Java, Web | 7 Comments »
Thursday, July 31st, 2014
I have written about other database migration frameworks before but in this article I’d like to cover the Liquibase framework in combination with WildFly as Java EE 7 compatible application server.
In the following tutorial, we’re going to write a full Java EE 7 book store application with a few steps and with Liquibase on board to create the database structure and insert example data into the database.
Thanks to the WildFly Maven Plug-in we even do not need to download and configure the application server but let Maven and the plug-in do the work for us.
(more…)
Tags: application server, as, curl, db, dbmigrate, ejb, entitymanager, h2, javaee, javaee7, jax-rs, jaxrs, jee, jpa, json, liquibase, migration, persistence, rdbms, rest, wildfly
Posted in Enterprise, Java, Web, Web Services | 3 Comments »
Wednesday, May 7th, 2014
Recently in a project I encountered the following problem: The development team used Git with a branch-per-feature-like workflow and the integration server, Bamboo in this case, was configured not only to run the integration-tests for the master-branch but also for every change in a feature branch.
As the team developed a Java EE web application ports like 8080 occasionally were already bound and builds failed.
I knew a plug-in for Jenkins CI I to search for available ports and assign them to a build variable but I wanted to control such information directly within the Maven build life-cycle so I searched and finally found Sonatype’s Port Allocator Plug-in for Maven.
In the following short example I’m going to demonstrate how to allocate available random ports in a Maven build and assign them to an embedded servlet container.
(more…)
Tags: allocation, bamboo, ci, jenkins, jetty, maven, port
Posted in Development, Java, Web | 2 Comments »
Sunday, May 4th, 2014
Sometimes in a project there is the need to run tests for your client-side code, written in JavaScript from a Maven build.
One reason might be that Maven manages a complex build life-cycle in your project and you need a close integration for your JavaScript tests, another one might be that you’re in an environment where it is complicated to install and manage additional software like an integration- or build-server.
(more…)
Tags: bdd, devop, ghostdriver, headless, javascript, js, maven, phantomjs, tdd, testing, webdriver, yasmine
Posted in Development, Javascript, Web | 7 Comments »
Wednesday, November 13th, 2013
Vert.x is a modern, lightweight framework to build high performance applications running on the Java Virtual Machine. The framework is polyglot so that you’re able to write your application in Java, Groovy, Ruby, Python or even JavaScript.
In addition it offers a nice component system, an actor-like concurrency model a distributed event bus and an elegant API to create scalable applications in no time.
In the following tutorial we’re going to build a websocket chat by creating a HTTP server and the websocket server using Vert.x, Java and Maven.
(more…)
Tags: actor, chat, html5, io, nonblocking, server, vert.x, websocket
Posted in Java, Web | 23 Comments »
Tuesday, July 9th, 2013
Recently I needed to control an embedded web container from a Java application and I wanted to see how this could be achieved using an embedded instance of either Tomcat or Jetty here.
In the following short examples I would like to show how to embed both servers in an application in no time using Gradle or Maven as build tool.
(more…)
Tags: catalina, gradle, Java, jetty, server, servlet, tomcat
Posted in Apps, Java, Web | 11 Comments »
Sunday, October 21st, 2012
The HTML5 working draft describes different techniques to push information from a server to the client and the one described in this tutorial are Server-Send Events (SSE).
Using Server-Send-Events eliminates the need to poll a server periodically for information using AJAX and is really easy to implement because of the simple specification and the fact that nearly all modern browsers already implement this specification.
(more…)
Tags: asynchronous, html, html5, javascript, jetty, js, nodejs, server send events, servlet, sse
Posted in Java, Javascript, Web | 1 Comment »
Sunday, August 5th, 2012
Some funny stuff can be done using HTML 5, canvas elements and the video events API.
In the following example we’re using these techniques to apply graphic effects to a video embedded in a HTML page..
(more…)
Tags: canvas, codec, html, html5, javascript, js, video
Posted in Javascript, Snippet, Web | 3 Comments »
Friday, May 18th, 2012
CoffeeScript is a neat language that is transcompiled into JavaScript but is more predictable and allows to write the same code with 1/3 fewer lines and of course with a (imho) nicer syntax.
CoffeeScript is nice but a vivid integration into our application build lifecycle with Maven is better and that is what the following example is all about.
(more…)
Tags: brew, coffeescript, compile, javascript, js, maven
Posted in Development, Web | No Comments »