Friday, April 25, 2008

Trimming the history list in Eclipse's internal web browser

I use the internal web browser quite a bit when I'm developing - if nothing else, it's a handy place to test out the GET requests for RESTful web services. I also use Eclipse for HTML writing, and again the internal browser is a useful first test of "does this look right yet?". This means I build up quite a long history list, and the most recent entries – the ones I'm mostly likely to be looking for – require scrolling to find and re-use them. I have not, to date, found a setting inside Eclipse (I'm using 3.3.2 at the time of writing this) to edit the internal browser history. I'd be delighted to be proved wrong. In the meantime, the workaround is to close Eclipse, then edit the file $WORKSPACE/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.browser.prefs where $WORKSPACE is your Eclipse workspace root directory. This is a plain text file: my preferred text editor on Linux and Windows is SciTE but it doesn't actually matter which one. This file has a preference key internalWebBrowserHistory, with the format:

internalWebBrowserHistory=url|*|url|*| ...

Removing stale entries is straightforward; modifying or adding new entries is perfectly doable, noting that colon characters (:) are escaped with a preceding backslash (\:). Save changes, restart Eclipse, done. Hopefully there will be an internal preference editor to make this easier inside Eclipse in future (or, someone will point out to me that I've been unobservant and that it's already there). eclipse, web-browser, tip

Tuesday, April 15, 2008

RESTful service client-side testing tool

I'm using a REST-ful web interface to the server on my current project (having read the excellent book by Richardson and Ruby). For the GET messages, testing via a web browser or wget works well enough. For other message types, and for getting more detailed diagnostics, I found the rest-client from Google Code really useful. I can send any of the standard seven HTTP messages, hack the headers, send different bodies, see all the response headers and set some test predicates on the response. Very nifty ... kudos to the developers. rest, java, unit-testing, software-development, tools.