java/html: append to specific section in HTML doc

I've code similar to this:
http://www.experts-exchange.com/Programming/Languages/Java/New_to_Java/Q_23778489.html

However, I use document.append("string") instead.  How can I add information to the <head> tag of a html doc? Is this possible?
LVL 4
newbiealAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
basav_comConnect With a Mentor Commented:
BufferedWriter document = new BufferedWriter(new FileWriter("My File Name.txt"));
The program mentioned in the previous question simplys writes to a file. Here BufferedWriter is a wrapper for filewriter.
you can name the object as anything you want. Eg.  BufferedWriter abcWriter.  Pls check the BufferedWriter class methods for the various operations that you can perform on this. As you are creating the file, you can create it with any content you want. (including adding data to title tag, head tags... etc)

Can you pls elaborate your current question.
0
 
newbiealAuthor Commented:
Yes, would you please provide a code example that demonstrates using these methods and adding a string to the head tag of the html doc?

0
 
newbiealAuthor Commented:
Would this HTML Parser help with this solution (http://htmlparser.sourceforge.net/).  If yes, how could this be added to my code to make it useful?
0
All Courses

From novice to tech pro — start learning today.