Solved

java/html: append to specific section in HTML doc

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
backtracking recursion  code 19 57
Way to decrease size of apk file 9 65
null output 3 24
Adding multiple JVM environments to RedHat 6 7 17
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

813 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