You can only return once from a Java method.
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.
We have an example application in our
CodeBarn that shows this in a form that (I think) is simple enough to understand without any further explanation.
Look for SimpleMVC:
http://www.javaranch.com/codebarn/codebarn-servlets.jsp