If you're interested in moving away from scriptlets (and I applaud you for doing so), this probably isn't the best approach. Building up HTML markup in a Java class is as messy if not messier than scriptlets.
Instead, find a good tutorial on the Model View Controller (MVC) pattern.
In a nutshell: Write your business logic in plain old Java classes (Model). Write a servlet that handles web requests. (Controller) Have the controller instanciate any model classes and call their methods. Have the model classes return the data in the form of JavaBeans and bind them to request (or, if need be, session or context) scope. Forward to a JSP (View) and use JSTL and EL for formatting the data.
I suggest you use a String and StringBuffer and return a String:
[ August 31, 2007: Message edited by: Tom Madson ]
[Moderator edit: removed discussion of approach taken by other posters. If you have issues to air, the JavaRanch discussion forum is the place to do so. Thanks.] [ August 31, 2007: Message edited by: Bear Bibeault ]