On Thu, 16 Dec 1999, Chris Pratt wrote:
> Have you tried the <PRE> tag?
Actually, any HTML tags in the text between the <PRE> and </PRE> will
be interpreted and rendered as elsewhere, <PRE> only affects the
spacing/line breaks/formatting.
I poked around a little bit, and apparently there were some HTML tags
that "turned off" interpretation of the HTML tags inside them, but
they've been deprecated (<XMP>, <LISTING>, and <PLAINTEXT>). The
recommendation is to use <PRE>, because it does the "same thing".
Well, obviously it doesn't do the same thing. It looks like you (i.e.
Jay Macarty) may need to "parse" the HTML as you mentioned in your
original post.
> ----- Original Message -----
> From: "Jay Macarty" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, December 16, 1999 11:32 AM
> Subject: Re: Displaying HTML Source
>
>
> > Setting the content type will not work in this case because I am
> outputting
> > some actual HTML first; page title, file name, last modified date, etc.;
> and
> > so I must use text/HTML.
> >
> > ----- Original Message -----
> > From: George Ter-Saakov <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, December 16, 1999 12:11 PM
> > Subject: Re: Displaying HTML Source
> >
> >
> > > I think you can read your HTML code and output it as is but you need
> only
> > > setContentType( "text/plain") upfront. Not "text/html"
> > >
> > > Hope it will work.
> > > George.
> > >
> > > > -----Original Message-----
> > > > From: Jay Macarty [SMTP:[EMAIL PROTECTED]]
> > > > Sent: Thursday, December 16, 1999 12:48 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Displaying HTML Source
> > > >
> > > > I have a servlet which needs to be able to show the user the source of
> > an
> > > > HTML file. In performing this same type function in other languages I
> > > > simply
> > > > read the text and converted the characters to their & equivalent. For
> > > > example, <HTML> would become <HTML>
> > > >
> > > > I was wondering if there is an easier way to accomplish this task? If
> > not,
> > > > does someone have, or know of, existing Java code to do the
> conversions?
> > > >
> > > >
> > > > --------------------------------------------------
> > > > Jay Macarty - Technical Specialist
> > > > Phone: (972) 591-7385
> > > >
> > >
> >
>
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html