Very recently, I showed you one of the probably easiest ways, to host your very own Java-based web-service. Remember, we added providedCompile group: ‘javax.servlet’, name: ‘javax.servlet-api’, version: ‘4.0.1’ to the build.gradle file, implemented a WebServlet, and finally dropped a war file into Tomcat’s webapps directory. I know, you’ll have a hard time finding paying customers […]
Java
Even or Odd

This is a quick demo, showing how to create a Java web-service in just a few minutes. I’m assuming you have Java and Tomcat already installed on you computer and use IntelliJ as your IDE, and gradle as your build-automation system. The simple task is to create a web-service that can answer if a provided […]
Configuring multiple SSL certificates for a single Tomcat connector

Sometimes you may want the same Tomcat instance to respond to requests for more than just one hostname. For HTTP this can easily be accomplished, by mapping those hostnames to the same IP address, using the tools provided by your registrar. Supporting HTTPS for multiple hosts is more involved since the SSL certificates need to […]
Installing an SSL Certificate on Tomcat

If you have Tomcat installed on your Mac or Linux computer, like I have shown here and here, you may sooner or later want to serve content not only through HTTP, but also securely through HTTPS. Instead of going the self-signed certificate route, where the certificate is signed with its own private key, I’m describing […]
Serverless compute with Java, on AWS Lambda

Serverless computing is a cloud computing execution model, in which the cloud provider dynamically manages the allocation of machine resources. Serverless computing allows running applications and services, without thinking much about servers, runtime resources, or scaling issues. A very simple serverless computing application is intended to be used as a template project, a model, or starting […]
Debugging your Alexa Skill

Hosting a skill for the Amazon Alexa platform can be more or less involved, depending on the implementation language and hosting platform you pick. If you have some experience with the Java-Servlet life-cycle, then implementing a skill in Java, using Amazon’s Alexa-Skills-Kit library for Java, available in this Maven Repository and on Github, becomes an […]
Hosting an Alexa Skill yourself

If experimenting with the Amazon Echo / Alexa Skill Kit or running a so-called Skill in production, you generally have two choices: AWS Lambda functions on AWS Lambda (a service offering by Amazon Web Services) Hosting the Web service yourself. If you decide against AWS Lambda, you can build the Web service, using Java Node anything […]
Java 8, Tomcat 8, and Jersey on Mac OS X

A while back, I wrote a blog post on how to quickly develop and deploy a Web app in Java, using RestEasy on top of Tomcat. While this worked well, I never felt really comfortable with the rest-easy dependencies. Moreover, since I wanted a really lean web-app, manually extracting only the absolutely necessary jars from the rather […]
Installing Java 8 and Tomcat 8 on Debian Jessie or Raspbian or RedHat

Apache Tomcat is a Servlet/JSP container and version 8.0 implements the Servlet 3.1 and JavaServer Pages 2.3 specifications. Please note that Apache Tomcat 8.0 requires a Java Standard Edition Runtime Environment (JRE) version 7 or later. So we start with installing a recent version of Oracle’s JRE. Install Oracle JRE 8 on Debian Linux (or Raspbian) […]
Java 8, Tomcat 8, and RESTEasy on Mac OS X

The main idea for this blog post was using the Mac, for quickly developing and deploying a Web app in Java. I’m using RestEasy on top of Tomcat as my server platform and Intellij IDEA as my preferred IDE. Once the webapp has been built and tested locally, IDEA is also used for archiving the […]
JavaOne SwiXML presentation online

Finally, Sun posted PDF formatted session documentation of all JavaOne 2005 sessions here: http://developers.sun.com/learning/javaoneonline/2005/ Even if you went to JavaOne, you probably missed Hans Muller’s Defining Swing GUIs Declaratively session and his take on Swixml. The PDF version of his slides is now available here:
How private are private fields after all?

Last week, I sent the following brain teaser: public class Foo { private int secret = 47; public Foo() { new Hacker().hack(this); } public String tellSecret() { return String.valueOf(secret); } public static void main(String[] args) { System.out.println(”How secret are private members? ..”); System.out.println(”Psst: ” + new Foo().tellSecret(); } } Can you write a void hack(Object […]
Code Inspection

I recently got the chance to participate in another code inspection, in which among other things, the following line of code was heavily criticized for using String concatenation on constants and not using a StringBuffer object for the string operation in general. FindFile.FindFileInClasspath( kPropFilePrefix + “*”+ kPropFileSuffix + kKeyProperties, vPropFiles ); This is from a J2EE […]