hi,
there is a specific mechanism to do so :
code is as follows :
String url = "name of the html file or could be a dynamic file" ;
1. RequestDispatcher rDes - getServletcontext().getRequestDispatcher(url);
2. rDes.include(request,response);

getRequestDispatcher
public RequestDispatcher getRequestDispatcher(java.lang.String path)
Returns a RequestDispatcher object that acts as a wrapper for the resource
located at the given path. A RequestDispatcher object can be used to forward
a request to the resource or to include the resource in a response. The
resource can be dynamic or static.
The pathname must begin with a "/" and is interpreted as relative to the
current context root. Use getContext to obtain a RequestDispatcher for
resources in foreign contexts. This method returns null if the
ServletContext cannot return a RequestDispatcher.
Parameters:
path - a String specifying the pathname to the resource
Returns:
a RequestDispatcher object that acts as a wrapper for the resource at the
specified path
See Also:
RequestDispatcher, getContext(java.lang.String)

public interface RequestDispatcher
Defines an object that receives requests from the client and sends them to
any resource (such as a servlet, HTML file, or JSP file) on the server. The
servlet container creates the RequestDispatcher object, which is used as a
wrapper around a server resource located at a particular path or given by a
particular name.

This interface is intended to wrap servlets, but a servlet container can
create RequestDispatcher objects to wrap any type of resource.


i hope this should work
tarun

----- Original Message -----
From: "Michael De Vorms" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 11, 2002 1:32 PM
Subject: Including HTML file in servlet.


> Hello I'm sure this is done with an '#include' or something.
> Please help me!
> Code examples would be great!
> Thanks,
> Michael De Vorms
>
> _________________________________________________________________
> Join the world's largest e-mail service with MSN Hotmail.
> 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


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.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

Reply via email to