Is there a way of browsing a web site through a proxy and autogenerating Java code (using HtmlClient) that can play back the requests?
Not sure what your code generation needs are. Have you looked at Apache JMeter that records test cases through a proxy and also provides interfaces for you to generate your own data.