Traditional Web Apps And RESTful APIs

September 23, 2016

When we are building web applications these days, it is considered a best practice to expose all our functionality as a RESTful API and then consume it ourselves. This usually goes with a rich front-end using heavy javascript, e.g. Angular/Ember/Backbone/React. But a heavy front-end doesn’t seem like a good default – applications that require the […]

0

Get Rid of the URL Pollution

August 13, 2014

You want to copy the URL of a nice article/video/picture you’ve just opened and send it to friends in skype chats, whatsapp, other messengers or social networks. And you realize the URL looks like this: http://somesite.com/artices/title-of-the-article?utm_campagin=fsafser454fasfdsaffffas&utm_bullshit=543fasdfafd534254543&somethingelse=uselessstuffffsafafafad&utm_source=foobar What are these parameters that pollute the URL? The above example uses some of the Google Analytics parameters (utm*), […]

20

Why The Web Isn’t Semantic Yet

January 8, 2014

The semantic web. You’ve heard about it. What is it? Chances are, you don’t have a completely clear idea. But why isn’t the web “semantic” yet? First, it’s complex to understand. There are tons of standards around it – RDF, RDFa, RDFS, URI, OWL, SPARQL, etc. It’s hard to get started, because you have to […]

0

Save-and-Refresh With Java Web Projects

November 13, 2013

How do you configure your machine in order to have save-and-refresh for Java web projects? When you ask this question to developers, the answer starts with “oh, well…”, and continues with a description of something that sort-of works. And everyone has his own way. First – why do you need this? Because doing copying and […]

12

A Simple Plugin System for Web Applications

August 2, 2013

We need to make multiple web-based projects with a lot of shared functionality. For that, some sort of a plugin system would be a good option (as an alternative to copy-pasting stuff). Some frameworks (like grails) have the option to make web plugins, but most don’t, so something custom-made is to be implemented. First, let’s […]

5

Templating For Java Web Applications

May 17, 2013

A while ago I asked the following question on stackoverflow: “Why would I use a template engine?”. I compared template engines to simple JSP includes. Although I didn’t particularly fancy any of the answer, it was obvious that templating is the preferred way of defining the structure of websites, especially if they are bigger ones. […]

1

Login Tokens In Email Links

April 26, 2013

Your system is probably sending some emails. Sometimes these emails contain links to the public part of the site, sometimes they have links to the authentication-protected part. Either way, if the email is sent to registered users (as opposed to just subscribed emails) you should not make the user type in username and password. Even […]

12

Caveats With MySQL Pagination

January 22, 2013

We’ve all done pagination – it’s sensible for both lists in the UI and for processing data in batches. “SELECT (columns) FROM table LIMIT X, Y”. Possibly “SELECT (columns) FROM table ORDER BY some_column LIMIT X, Y”. What’s the caveat? Especially when working with an ORM and when processing batches, where order doesn’t matter, you […]

2

A Guide To Authenticating Users With Mozilla Persona

December 1, 2012

Having only twitter and facebook authentication so far, I decided to add Mozilla Persona to the list for my latest project (computoser, computer-generated music). Why? I like trying new things Storing passwords is a tough process, and even though I know how to do it, and even have most of the code written in another […]

7

How To Provide Default Serialization Format With Spring MVC RESTful Services

November 9, 2012

Spring MVC allows you to serialize objects with @ResponseBody to any format – it has built-in converters for JSON and XML. However, even though your application may support both, you may need a default in case the Accept header is not set. Furthermore (this is a strange case, but we had it), you may want […]

3