Search This Blog

Showing posts with label servlets. Show all posts
Showing posts with label servlets. Show all posts

Tuesday, 29 January 2019

Server-Sent Events - How to do it in Sevlets ?

In the past few posts I have seen some techniques to pull of Push Notifications. HTML5 has introduced a couple of new methods - one of them is Server -Sent Events. In this post I am trying to build one such Servlet based implementation.

Monday, 9 May 2016

Servlet 3.x - Async Servlets

In our last post, I touched on AsyncServlet and used it to implement a Comet Application. I decided to go into the feature into a bit more depth.

Tuesday, 12 April 2016

Reverse AJAX - The Comet Technique

In my series on Reverse AJAX, I covered Polling and Piggybacking. We saw the pros and cons of either technique. In this post I shall take a look at a third technique - Comet.

Sunday, 27 March 2016

Reverse AJAX - Using the Piggback Technique

In the previous post we saw how reverse AJAX was achieved using the polling technique. Although easy, this is not a very popular or scalable solution. An alternative approach is the Piggback Technique.

Friday, 18 March 2016

Reverse AJAX - what and how ?

I had only heard about the concept of reverse AJAX before. So when I started looking at servlets async behavior I was tempted to check out this concept.

Saturday, 27 February 2016

Servlet 3.x - Using MultipartConfig for file uploads

In an earlier post, I had written on performing file upload and download using Spring MVC. In that example I used commons-fileupload-1.2.2.jar. This is because Servlets did not have built in support for File upload operation. However Servlets 3.x provides support - as a part of the specs. So no need to include any additional jars. I decided to try an example of the same.

Sunday, 21 February 2016

Servlet 3.x - HandlesTypes annotation

I came across the @HandlesTypes annotation while looking at Servlet 3.1 specs, and of course with lot of time to spare, I ended up trying it out.

Wednesday, 20 January 2016

Servlet 3.x - Building the web.xml less Web Application

Ever since Java introduced  annotations, every framework has been looking to provide an XML alternative to their configuration information. So how could servlets be left behind.

Thursday, 24 December 2015

Servlets 3.x - pluggin servlets at runtime

In the previous post we looked at Servlet 3.0 spec's ability to allow Servlets and filters to be defined in jars outside the deployment descriptor. In this post I am going to look at a different feature - declaring Servlets and Filters at runtime.

Sunday, 15 November 2015

Servlet 3.x - time to have a look

Its not brand new - in fact it first appeared in December 2009. Since starting to use servlets (actually servlet 2.5) I never really bothered to look at the specs. What started with application development using MVC and having multiple servlets changed to Spring framework with a single controller and lot of JSPs and then less JSPs and more AJAX. Along the way, my web.xml changed to refer to 3.0 and then 3.1.

Monday, 19 November 2012

gzip your Tomcat response

I was looking at the request and response headers in our application the other day. I noticed that the Browser request included the Accept-Encoding header. The values indicated my browser was capable of handling zipped responses.

Monday, 8 October 2012

Caching binary content coming from databases

I recently had the opportunity to work on a mobile project where I faced a whole set of different challenges. All my previous experience involved developing server applications for the web. So when I had to write a REST based API for mobile application we were faced with some interesting challenges.