now i have another problem :))
no exception, and the servlet runs allright, but the text
after the </servlet> tag in the jhtml document are excluded
from the result. is this a familiar problem to anyone?

snorre

> > can anybody give me a clue why I get the following exception from my
> > servlet included in a jhtml file? As far as I can see I dont call
> > getOutputStream.
> > <!-- java.lang.IllegalStateException: Already called 
> getOutputStream.
> > import java.io.*;
> > import javax.servlet.*;
> > import javax.servlet.http.*;
> > public class Hello extends HttpServlet
> > { 
> >     public void doGet (HttpServletRequest request,
> >                        HttpServletResponse response) 
> >         throws ServletException, IOException
> >         {
> >             PrintWriter out;
> >             String title = "Example Apache JServ Servlet";
> >             response.setContentType("text/html");
> >             out = response.getWriter();
> >             out.println("I Rule");
> >             out.close();
> >         }
> > }
> 
> 
> replace this by:
> 
> public class Hello extends HttpServlet
> { 
>       public void doGet (HttpServletRequest request,
>               HttpServletResponse response) 
>               throws ServletException, IOException
>       {
>       PrintWriter out=new PrintWriter(res.getOutputStream());
>       String title = "Example Apache JServ Servlet";
>       response.setContentType("text/html");
>       out.println("I Rule");
>       out.close();
>       }
> }
> 
> that might solve the problem. But you are right... JServs seems to
> behave a little nasty here. I experienced simliar 
> difficulties "porting"
> servlets from another engine to JServ
> 
> MfG Uwe Schaefer
> ______________________________________________
> Email: [EMAIL PROTECTED]
> Fido:  2:2448/2000.0 V34,X75,CM
> ICQ:   15481787
> Fax:   0203-435063
> 
> 
> 
> ------------------------------------------------------------
> To subscribe:    [EMAIL PROTECTED]
> To unsubscribe:  [EMAIL PROTECTED]
> Problems?:       [EMAIL PROTECTED]
> 


------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:       [EMAIL PROTECTED]

Reply via email to