Home » Author Archives: Andreas Haufler

Author Archives: Andreas Haufler

Using Rhino with Java 8

java-logo

Java brings Nashorn as new JavaScript implementation for JSR 223 (javax.scripting). While this is certainly great news (Nashorn is way faster than Rhino by directly generating Java code), it comes with some challenges: Nashorn is not 100% compatible with Rhino. Rhino had some extensions and more or less other interpretations on how to combine the Java world with JavaScript. Therefore ...

Read More »

JavaMail can be evil (and force you to restart your app server)

java-logo

JavaMail always had an interesting approach when it comes to its configuration. Basically you have to fill an untyped map or Properties structure and hope for the correct interpretation. Countless tutorials on the net show the minimal properties required to make it work (send / receive mails). However, as we painfully just learned, there are some lesser known properties you ...

Read More »

Version Numbering Scheme – Yet another approach

software-development-2-logo

Version numbering schemes are probably one of the few things we software engineers have more than sort algorithms. However, there’s always room for one more. While the classic approach of MAJOR.MINOR.PATCH (e.g. 1.8.2) works quite well for libraries or products which are distributed in a broad manner, it is still not as easy as it seems.What is a major change? ...

Read More »

Making HTTP content compression work in netty 4

jboss-netty-logo

Netty is really a great framework providing all the things needed to build a high performance HTTP server. The nice thing is, that nearly everything comes out of the box and has just to be put together in the right way. And content compression (gzip or deflate) is no exception. However, when it comes to compressing static content I stumbled ...

Read More »

How to write one of the fastest expression evaluators in Java

java-logo

Granted, the title is a bit of an attention grabber, but nevertheless true (You course you never trust a benchmark you didn’t fake yourself – but that’s another story). So last week I was looking for a small and usable library to evaluate mathematical expressions. I almost directly stumbled upon this stackoverflow post. The recommended library (Expr) is really quite ...

Read More »

How to kill Java with a Regular Expression

java-logo

We recently stumbled upon a phenomen we absolutely weren’t aware of: You can kill any Java IDE and also any Java process with a simple regular expression… Back in university, I was taught that regular expressions, which are called regular grammers or type 3 grammers  always end up in an finite state automaton and can therefore be processed in linear ...

Read More »

Generating Barcodes in PDFs with Flying-Saucer

flying-saucer-logo

Flying-Saucer is a nice library to generate PDF documents from within Java applications. Just generate a bunch of XHTML, throw it into the renderer and let it produce the desired document utilizing iText. When it comes to barcodes however, Flying-Saucer cannot access the built in barcode functionality of iText (at least I didn’t find any documentation for it).     ...

Read More »

Launching and Debugging Tomcat from Eclipse without complex plugins

eclipse-logo

Modern IDEs like Eclipse provide various Plugins to ease web developement. However, I believe that starting Tomcat as “normal” Java application still provides the best debugging experience. Most of the time, this is because these tools launch Tomcat or any other servlet container as external process and then attach a remote debugger on it. While you’re still able to set ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.