Why don't you use the plain <jsp:include> ?

<jsp:include page="/sswstyle/header.jsp" flush="true"/> (assuming sswstyle
is a subdirectory in your context).

If it is not, then you can try:

<%
  RequestDispatcher rd =
application.getContext("/sswstyle").getRequestDispatcher("/header.jsp");
  rd.include(request,response);
%>

Wellington Silva

                -----Original Message-----
                From:   Kurt Bernhard Pruenner [mailto:[EMAIL PROTECTED]]
                Sent:   20 November 2000 09:45
                To:     [EMAIL PROTECTED]
                Subject:        Server-Side Includes (was Re: JSP and
embedded servlet call)

                "Craig R. McClanahan" wrote:
                > Boszormenyi Laszlo wrote:
                > > How should I implement something like <.!--#exec
cgi="..."--> in a jsp
                > > page?
                > 
                > Tomcat does not support server-side includes via "#exec
cgi".  You can use 
                > such commands in HTML pages if you run Tomcat behind a web
server, but not 
                > in a JSP page.

                There's something I actually wanted to ask for some time; on
our server, we
                have had JServ running for quite some time, and we had
absolutely no problems
                using

                <!--#include virtual="/sswstyle/header.jsp" -->

                to include a servlet that does provide the header for most
pages... when we
                tried the same thing with some older Tomcat version (I don't
know if it was
                3.0 or 3.1), the above statement didn't do anything at all
and was left in the
                page served by Apache. 

                Now, I've tried this again with Tomcat 3.2b7 and the latest
JServ, and while
                it at least tries to include something now, I've found that
Tomcat doesn't get
                passed the "/sswstyle/header.jsp", but the location of the
page that tries to
                include the JSP page (i.e. "/test/test.shtml"), which of
course fails again...
                :(

                As I assume that this behaviour happens by JServ passing the
wrong location to
                Tomcat when invoked from mod_include - is this some planned
behaviour and is
                using mod_include with mod_jserv right out of the question,
or is this just a
                bug? :/

                -- 
                Kurt Bernhard Pruenner --- Haendelstrasse 17 --- 4020 Linz
--- Austria
                Music: http://www.mp3.com/Leak --- Work:
http://www.ssw.uni-linz.ac.at
                .......It might be written "Mindfuck", but it's spelt
"L-A-I-N".......
                np: Kendall Jackman - Weightless (ambient.01@hyperreal
comp.)

Reply via email to