You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tomcat Jakarta <to...@bilbao.com> on 2001/12/11 19:29:46 UTC

My problems with getRequestDispatcher

My piece of code:
--------------//----------------------
req.getRequestDispatcher("myfile").include(req,res);
out.println("</P>***TAIL***");
----------------//-----------------


'myfile.java':
---------------//----------------
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class myfile extends HttpServlet {
protected void doGet(HttpServletRequest req,
HttpServletResponse res) throws ServletException,
IOException {
PrintWriter out = res.getWriter();
out.println("</P>HELLO WORLD</P>");
out.flush();
out.close();
}
}
-----------------//---------------

The page I get:
HELLO WORLD
[end]

Any suggestion? Why I do not get the rest of my code?
I tried removing out.close() and out.flush()...
_______________________________________________________________________
¿Todavía no tienes contestador automático en tu correo?
http://www.hispavista.com/altascorreo/

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: My problems with getRequestDispatcher

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 11 Dec 2001, Tomcat  Jakarta wrote:

> Date: Tue, 11 Dec 2001 19:29:46 +0100
> From: Tomcat  Jakarta <to...@bilbao.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: My problems with getRequestDispatcher
>
> My piece of code:
> --------------//----------------------
> req.getRequestDispatcher("myfile").include(req,res);

The Javadocs will tell you that the argument to this call needs to have a
leading slash, and be a context-relative URL for the resource they want.

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>