I have been working on Java Servlets and HTML for quite a long time and have always had a problem keeping HTML code separate from Java code, but now I’ve found an answer.
While searching on the Net, I found a very good program called XMLC, which really separates your HTML from Java code. It converts your HTML files into Java classes, then allows you to manipulate those Java classes using DOM API and regenerates the HTML. It’s really cool.
If you are planning to use, or currently using, Java Technology like Servlets or JSP for your next project, I would advise you to have a look at XMLC.