Solved

java/html: append to specific section in HTML doc

Posted on 2008-10-01
3
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

751 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