Mixing JSPs and HTML (II)
Can jsp:forward be used to forward to an HTML?
i.e., <jsp:forward page="/schedule/index.html" />
Re: Mixing JSPs and HTML (II)
In article <firstname.lastname@example.org>,
Carl Crosswhite <Carlxw@ix.netcom.com> wrote:
>Can jsp:forward be used to forward to an HTML?
>i.e., <jsp:forward page="/schedule/index.html" />
Yes, with one caveat. According to section 2.5.2 of the spec:
When a path starts with a "/" it is to be interpreted by the application
to which the JSP page belongs; i.e its ServletContext object provides
the base context URL.
What this means in practice is that if you have a web application
installed as /myapp, and you want to forward to /myapp/somedir/index.html,
your tag would look like:
<jsp:forward page="/somedir/index.html" />
that is, without the /myapp. You can not redirect to a different web
application with jsp:forward, although you can with a regular HTTP
The same goes for jsp:include - you can include an HTML page or output
of a servlet in a JSP.
Last Post: 09-22-2000, 09:15 AM
By Carl Crosswhite in forum authorevents.pekowsky
Last Post: 08-16-2000, 10:48 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL