DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Carl Crosswhite Guest

    Mixing JSPs and HTML (II)


    Can jsp:forward be used to forward to an HTML?

    i.e., <jsp:forward page="/schedule/index.html" />


  2. #2
    Larne Pekowsky Guest

    Re: Mixing JSPs and HTML (II)

    In article <399a964d$1@news.devx.com>,
    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
    redirect.

    The same goes for jsp:include - you can include an HTML page or output
    of a servlet in a JSP.

    - Larne



Similar Threads

  1. Replies: 1
    Last Post: 09-22-2000, 09:15 AM
  2. Mixing JSPs and HTML (I)
    By Carl Crosswhite in forum authorevents.pekowsky
    Replies: 1
    Last Post: 08-16-2000, 10:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links