Need to convert text file to html format using the java program. Need to read a block of lines under one ant target and check it has any errors and display them , if no errors can just display as success.

I should not show the entire log in the html , so I have a button to show/hide the log using the javascript. My question is show can this java script go into html ? is there any other way other than just having everything in the string and printing it in the html file ?

Any ideas on this ... much appreciated