mod-rewrite equivalent for Tomcat

I've migrated and merged my old blogs.sun.com and bleaklow.com blogs into this new one, using Pebble. As a result, there are a number of links out there on the interwebs to bleaklow.com that are now broken, as everything has moved around - google's webmaster tools gives me a comprehensive list. If I was hosting this blog using Apache, the standard solution would be to use the most excellent mod-rewrite Apache module to redirect the broken links to somewhere appropriate. However Pebble is a J2EE application and uses Tomcat instead of Apache. I've been looking for an equivalent to mod-rewrite for a while and never managed to find anything. Whilst looking for something else entirely (always the way) I found Url Rewrite Filter. This is functional equivalent to mod-rewrite for J2EE servers, and offers most of the same features as mod-rewrite. I'm using it and it seems to do the job just fine, and the beta even has a mod-rewrite style configuration option, if you need a security blanket :-)

Categories : Java, Web, Tech


Re: mod-rewrite equivalent for Tomcat

Following the Oracle assimilation Sun folks are migrating their blogs to less corporate homes.  I find it interesting that the solution of preference seems to be Wordpress.  Particularly since Java apps have long been preferred to the exclusion of anything else by Sun folks, e.g. PHP based wiki solutions were not even allowed w/in the realm of consideration for the OS.org website redoux.  I think this is the first I've seen go to Java based Pebble rather than PHP based Wordpress.  This trend would appear to be quite the indictment against Roller, and perhaps to lesser degree of Java web technologies in general?  Or perhaps more of an indication of PHP's maturity?  Care to elaborate on your choice here?  Might even be worthy of it's own blog entry.

Re: mod-rewrite equivalent for Tomcat

I can't speak for anyone else's decisions, but not everyone who has a blog on BSC is a web technologies guru, and even if they are they may not want to spend time tinkering with blogging platforms, they may just want the easiest and quickest option. I think people picked Wordpress for the usual reasons - it's the most popular blogging platform, it's easy to get cheap preconfigured hosting for it, there are lots of plugins etc. It's not at all unexpected that Wordpress is what most people chose.

The reasoning behind my choice of Pebble was quite simple - I wanted the simplest possible solution that would do what I needed (support a single blog), and I wanted something that was flat-file based to make it easier to knock my rag-bag collection of old content into shape. I also wanted something I could hack on if I needed to.  If I was setting up a big multi-user blog I'd almost certainly have chosen Roller and not Pebble. And because all the Pebble content is stored in XML files, I've got an easy migration path if I change my mind in the future.

Re: mod-rewrite equivalent for Tomcat

I've just spend the better part of a day trying to use https and for some reason Pebble seems to be re-writing my urls from https://www.4uii.com/pebble to https://www.4uii.com:443/pebble and on some ocassions to https://www.4uii.com:8443/pebble Any clues on how to make it stop I set up Apache and Tomcat just the way I want them I dont need some app going rouge on me and messing with my urls.

Re: mod-rewrite equivalent for Tomcat

I've no experience of using Pebble with SSL, sorry - your best bet is to ask on the Pebble mailing list - see http://pebble.sourceforge.net/mail-lists.html