Solved

java/html: append to specific section in HTML doc

Posted on 2008-10-01
3
215 Views
Last Modified: 2013-11-23
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?
0
Comment
Question by:newbieal
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
basav_com earned 500 total points
ID: 22619965
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
 
LVL 4

Author Comment

by:newbieal
ID: 22623479
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
 
LVL 4

Author Comment

by:newbieal
ID: 22625128
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question