Mixing JSPs and HTML (II)


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Mixing JSPs and HTML (II)

  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" />

    Share on Google+

  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


    Share on Google+

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

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center