Content type for jsp/html files

2004-02-24 Thread Johan Wallinder
Hi. I've want to make a servlet that can display the source of any jsp/html file (not the rendered one). Basically my code is like this: *set content type to text/plain *get PrintWriter object out *get the fileobject as an inputstream *write to the out object *flush/close The code is working

Re: Content type for jsp/html files

2004-02-24 Thread Antonio Fiol BonnĂ­n
Johan Wallinder wrote: Hi. I've want to make a servlet that can display the source of any jsp/html file (not the rendered one). Basically my code is like this: *set content type to text/plain *get PrintWriter object out *get the fileobject as an inputstream *write to the out object

RE: Content type for jsp/html files

2004-02-24 Thread Yansheng Lin
Subject: Re: Content type for jsp/html files Johan Wallinder wrote: Hi. I've want to make a servlet that can display the source of any jsp/html file (not the rendered one). Basically my code is like this: *set content type to text/plain *get PrintWriter object out *get the fileobject

RE: Content type for jsp/html files

2004-02-24 Thread Yansheng Lin
typo: context type should be context type. -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 3:15 PM To: 'Tomcat Users List' Subject: RE: Content type for jsp/html files Totally! With context type set to text/plain is not going to provent

Re: Content type for jsp/html files

2004-02-24 Thread Parsons Technical Services
; With this your code will display correctly on the screen. Doug - Original Message - From: Johan Wallinder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 1:39 PM Subject: Content type for jsp/html files Hi. I've want to make a servlet that can display

RE: Content type for jsp/html files

2004-02-24 Thread Johan Wallinder
List Subject: Re: Content type for jsp/html files Johan, If the purpose is just to see the code, then you can parse the stream and replace each of the symbols with a substitute. This will cause the browser to see everything as plain text. Parse the stream. If character equals then replace

Re: Content type for jsp/html files

2004-02-24 Thread Parsons Technical Services
Wallinder [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 5:54 PM Subject: RE: Content type for jsp/html files I've already done that. But than I was thinking. Isn't there an easier way to display plan text files by setting the content type (and not encode