Well, I’ve recently gone to the “silver” side and acquired a MacBook Pro to use it for development when I am not at my PC. By development I mean here mainly Java + Javascript development. So I’ve written this post to remember what I had to install/configure to achieve this goal. I need to mention that until now I’ve been ...
Read More »Home »
Run java web apps in embedded containers with Maven, Jetty and Tomcat
While developing java web applications is very practical to have quick feedback from a “real” environment. In this post I’ll explore how to run a java web application with Maven in an embedded container be it Jetty or Tomcat. I’ll show how I have configured them for the development of podcastpedia project backing the Podcastpedia.org website. Prerequisites You should have Maven ...
Read More »Is IntelliJ IDEA shining through Eclipse?
As a long time Eclipse user, I want to give a more serious look to IntelliJ IDEA. The people from JetBrains were very nice and granted me an open source license for the Podcastpedia.org and Codingpedia.org projects. In the post I listed some of the things I use often in Eclipse and their equivalent in IntelliJ. I wrote this post so I ...
Read More »Yet another Java 8 Lamdbas and Streams example
I’ve been lagging behind with what Java 8 features exercising concerns, so in this post I will briefly present my initial experience with lambdas and streams. As usual, I will focus on a Podcast class: package org.codingpedia.learning.java.core; import java.util.Comparator; public class Podcast { int id; String title; String producer; int subscriptionsNumber; /** number of ...
Read More »How to secure Jersey REST services with Spring Security and Basic authentication
In my previous blog post, Quick way to check if the REST API is alive – GET details from Manifest file, I showed how to develop a REST resource to easy check if the developed REST API is reachable. In this post I will present how you can secure this resource with Spring Security and Basic authentication – “In the context of ...
Read More »Quick way to check if the REST API is alive – GET details from Manifest file
There might be cases when you want to quickly verify if your REST API, that is deployed either on dev, test or prod environments, is reachable altogether. A common way to do this is by building a generic resource that delivers for example the version of the deployed API. You can trigger a request to this resource manually or, even better, have ...
Read More »How to integrate Jersey in a Spring MVC application
I have recently started to build a public REST API with Java for Podcastpedia.org and for the JAX-RS implementation I have chosen Jersey, as I find it “natural” and powerful – you can find out more about it by following the Tutorial – REST API design and implementation in Java with Jersey and Spring. Because Podcastpedia.org is a web application powered by Spring ...
Read More »How to test a REST api from command line with curl
If you want to quickly test your REST api from the command line, you can use curl. In this post I will present how to execute GET, POST, PUT, HEAD, DELETE HTTP Requests against a REST API. For the purpose of this blog post I will be using the REST api developed in my post Tutorial – REST API design ...
Read More »How to compress responses in Java REST API with GZip and Jersey
There may be cases when your REST api provides responses that are very long, and we all know how important transfer speed and bandwidth still are on mobile devices/networks. I think this is the first performance optimization point one needs to address, when developing REST apis that support mobile apps. Guess what? Because responses are text, we can compress them. And with ...
Read More »