I’ve been playing around with Heroku at work for the past week or two. Heroku is pretty awesome if you want to get an app up and running quickly. Heroku does support Java and they have a few Java templates. Their current offering for Java uses Spring 3 and Tomcat 7.0.54 with Java 7. However,…
Category: Web
Comments were broken for a while
Commenting on this blog was disabled for a while… I think it was due to Akismet misbehaving or something. I’m not sure. Either way, you should be able to comment now. I will be slowly adding anti-spam stuff back in.
Setting the content type to text/plain for a JSON response from a Spring controller
I was using a jQuery plugin called a ajaxfileupload to upload a file through AJAX. Technically what the plugin does isn’t AJAX. It creates a hidden form and an iframe, and then submits the form using the iframe as the target. The iframe will then end up with the response from the server. This response…
Popularity Contest WordPress plugin breaks RSS feed
I’m using a somewhat old plugin (it hasn’t been updated since ’09) called Popularity Contest to show the popularity of my posts. However, I noticed that it was breaking my RSS feed. This is due to the fact that the plugin doesn’t properly escape the ampersand character inside an image URL. Instead of & it…
Implementing JSONP in Spring MVC 3.0.x
In Spring 3, it’s very easy to get a view to return JSON. However, there is no built-in mechanism to return JSONP. I was able to find a pretty good tutorial That uses Spring’s DelegatingFilterProxy. I implemented this solution and I got it to work, but I didn’t like the fact that I had to…
Integrating Regula with Spring 3.0.x MVC
A little less than a year ago, I released Regula, an annotation-based form-validation written in Javascript. The source and documentation are available on GitHub. I started working on the integration on and off throughout most of last year. At the end of the year, I had a pretty good integration going, where you could annotate…
Packaging and distributing taglibs in a JAR
This is more of a “note to self” than a “how to”. If you’re trying to distribute tag files in a JAR, you need to put them under /META-INF/tags. You then need to create a TLD file that you also put under /META-INF/tags. If you have tags or functions that you created in Java, and…
Regula: An annotation-based form-validator written in Javascript
Regula is an annotation-based form-validation framework written in Javascript. There already exist a few frameworks that address form-validation in Javascript, but I have found them to be somewhat lacking. I have thought about writing one of my own for some time, but I honestly had no idea what form it would or should take. I…
JSTL, instanceof, and hasProperty
I’ve been doing a little bit of JSTL over the past week, especially custom tags. I’ve written custom tags in Grails before, and there you use actual Groovy code. I guess this was how custom tags used to be written (in Java), but now you can can build your own custom tags using the standard…