1. You can use a servlet as the source in a frameset.
2. With respect to the include, create a base servlet with the following
methods. Then extend all your servlets from the base class. I know that
both of these work with Tomcat running the 1.3 jdk.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
public void includePage( HttpServletRequest request, HttpServletResponse
response, String page )
{
try
{
response.setContentType("text/html");
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(page);
dispatcher.include(request, response);
}
catch (Exception e)
{
System.out.println("Exception caught in includePage() (for Page =
" + page + ")");
}
}
public void forwardPage( HttpServletRequest request, HttpServletResponse
response, String page )
{
try
{
response.getWriter().flush();
//response.flushBuffer();
response.setContentType("text/html");
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(page);
dispatcher.forward(request, response);
}
catch (Exception e)
{
System.out.println(e.getMessage());
System.out.println("Exception caught in forwardPage() (for Page = " +
page + ")");
}
}
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Berger, William
Sent: Tuesday, November 21, 2000 3:53 PM
To: [EMAIL PROTECTED]
Subject: Two questions...
Hello All.
First, can a servlet be used as the source in a frameset (particularly if
the html code containing the frameset is itself created by a servlet)?
Second, I have not been able to get any of these methods to work:
ServletContext.getRequestDispatcher(java.lang.String).include(ServletRequest
request, ServletResponse response)
ServletContext.getNamedDispatcher(java.lang.String).include(ServletRequest
request, ServletResponse response)
ServletRequest.getRequestDispatcher(java.lang.String).include(ServletRequest
request, ServletResponse response)
Does anyone have example code using the include() method of the
RequestDispatcher interface? I have been unsuccessful so far.
I am using Tomcat, Servlet Developer's Kit 2.2, and Java Developer's Kit
1.3.
Thanks in advance.
Bill Berger
Spherion
___________________________________________________________________________
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
___________________________________________________________________________
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