Solved

java/html: append to specific section in HTML doc

Posted on 2008-10-01
3
211 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now