Well, you certainly can not use the redirect or the dispatcher. forward() method
because this would result in another request to the server, which would be
intercepted by your servlet and go on forever. So, you need to retrieve the data
some way other than http. If you have static content, you could simply create a
method that uses FileReader, read the file in then write it to the response. If
you have a database or content management system, then you need to get content
throught an api or jdbc using sql.
-ernie
Haakon Emblemsvaag wrote:
> I need to include html content, which can be static or dynamic, in a
> template. The
> template itself can also be static or dynamic.
>
> A servlet should be mapped to the "/" prefix so that every request
> on the site goes through this servlet. The servlet checks the content type
> for "text/html" and includes the content of the requested URL in the
> template.
>
> Is this possible? If so, how may I get the content from the template and the
> requested URL
> since this must be retrieved via the web server (to generate the dynamic
> content)?
>
> -Haakon Emblemsvaag
>
> ___________________________________________________________________________
> 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