Hi,
what is your html file used for chaining?.you didn't mention about this?
Here you are
taking html file and the content type is retrieved from there.
your html file should have blink tags to replace it.
Have u set these two file in options of JWS.
Check this.
Thanks,
kavitha.
>From: [EMAIL PROTECTED]
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Servlet Chaining - returns Null content type
>Date: Tue, 14 Dec 1999 09:07:46 +0530
>
>Hi all,
>Iam just trying out some examples in jason hunterz.
>As a typical example, iam running the following program which will remove
>all
>blinks from any html page displayed.
>Iam using jws 2.0 running in win nt
>
>The program is this
>import java.io.*;
>import javax.servlet.*;
>import javax.servlet.http.*;
>
>public class Deblink extends HttpServlet{
>
> public void doGet(HttpServletRequest req, HttpServletResponse res)
> throws ServletException,IOException{
>
> String contentType = req.getContentType();
> System.out.println("Content type is " + contentType); // juss to
>test
>things out
> if(contentType == null) return;
> res.setContentType(contentType);
>
> PrintWriter out = res.getWriter();
> BufferedReader in = req.getReader();
> String line = null;
> while((line = in.readLine()) != null){
> System.out.println("entered loop");
> line=replace(line,"<BLINK>","");
> line=replace(line,"</BLINK>","");
> out.println(line);
> }
> }
>
> public void doPost(HttpServletRequest req, HttpServletResponse res)
> throws ServletException,IOException{
>
> doGet(req,res);
>
> }
>
> private String replace(String line, String oldString, String
>newString){
> int index = 0;
> while((index = line.indexOf(oldString,index))>=0){
> //Replace old string with the new string (inefficiently)
> line = line.substring(0,index)+
> newString + line.substring(index+oldString.length());
>
> index = index + newString.length();
> }
> return line;
>
>
> }
>}
>
>which naturally should remove all blinks in all html pages. I've made
>necessary
>changes into jws config to make Deblink servlet to run whenever an html is
>requested.
>
>But all i get is null content type and the whole document is null, which i
>found
>out by just adding System.out.println("Content type is " + contentType);
>
>Just tried my best, but cudnt come with an answer. Can somebody help?
>
>Srinivasan.R
>Satyam Infoway Ltd.,
>May Fair Center,
>Secunderabad
>
>___________________________________________________________________________
>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
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
___________________________________________________________________________
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