For Programmers: Free Programming Magazines  


Home > Archive > Java Help > October 2004 > generate HTML









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author generate HTML
Petterson Mikael

2004-10-28, 4:00 pm

Hi,

I have a logfile ( text), containing links, that needs to be generated
into HTML.

Any advice on how I should proceed?

//Mikael

Paul Lutus

2004-10-28, 4:00 pm

Petterson Mikael wrote:

> Hi,
>
> I have a logfile ( text), containing links, that needs to be generated
> into HTML.
>
> Any advice on how I should proceed?


Yes. First, define "generated into HTML". In a separate file? Is each line
of the log file a link, or is there other, extraneous information that
needs to be filtered out?

Maybe if you post a short section of the source data so we can see what
problem you face, plus your own code, someone will be able to offer advice.

--
Paul Lutus
http://www.arachnoid.com

Josh Martin

2004-10-28, 8:57 pm

> I have a logfile ( text), containing links, that needs to be generated
> into HTML.


The simplest way is to put <PRE> tags around the file and rename it to
..html. If it is constantly updated, I'd just point to the text file
and let users view the TXT in the browser. If there are only a few
users, you can always just read the entire file with Java (e.g.
StringTokenizer) and output it in HTML format via a Servlet response
object. All that IO will wrench your system if there are a lot of
hits. I'd suggest outputing to XML moving forward - then you can just
use a XSLT style sheet.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com