tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "carnell" <carn...@iabg.de>
Subject Re: Integrating servlet output into JSP
Date Tue, 14 Nov 2000 14:29:29 GMT
Thanks, I've tried the code,  the JSP produces my layout/menus and stuff,
but theres no output from the servlet.

getRequestDispatcher appears to work correctly as rd is not null, but
nothing seems to be included. I have tried
both the bookholidayshow, and /servlet/bookholidayshow. The servlet works
fine when entered
into the browser.(although missing html/end html tags etc, IE doesn't care
:)

----- Original Message -----
From: "Wyn Easton" <wyn_easton@yahoo.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Tuesday, November 14, 2000 2:55 PM
Subject: Re: Integrating servlet output into JSP


> See code added below.
>
> --- carnell <carnell@iabg.de> wrote:
> > If in my JSP page, say bookholiday.jsp, I would like to include
> > output from
> > bookholidayshow servlet...
> >
> > bookholiday.jsp:
> > <html>
> > <include body/various menus and stuff>
> > <%
>  RequestDispather rd = request.getRequestDispatcher("bookholidayshow");
>  if (rd != null)
>      rd.include(request, resource);
> > %>
> > </body>
> > </html>
> >
> > bookholidayshow.java(class/servlet)
> > doGet(...)
> > {
> >     out.println... etc..
> > }
> >
> > But how do I use RequestDispatcher in the JSP? Can't make much sense
> > of the
> > docs.
> >
> > ----- Original Message -----
> > From: "Wyn Easton" <wyn_easton@yahoo.com>
> > To: <tomcat-user@jakarta.apache.org>
> > Sent: Tuesday, November 14, 2000 12:38 PM
> > Subject: Re: Integrating servlet output into JSP
> >
> >
> > > This may be over simplifying your problem, but have you looked
> > > at the RequestDispather include() method?
> > > It allows you to use the output of another servlet/JSP in the
> > current
> > > servlet/JSP.
> > >
> > > --- carnell <carnell@iabg.de> wrote:
> > > > I am currently migrating two projects that we have, both in
> > Servlets
> > > > into
> > > > JSP.
> > > >
> > > > Rather than rewriting everything into Model 2/with JSP
> > architecture,
> > > > is it
> > > > possible for me to write a JSP page that includes the output of
> > the
> > > > Servlet(which make use of out.println a lot etc). I could simply
> > > > remove the
> > > > outs in the Servlet which generate the html/body/end body/end
> > html
> > > > HTML
> > > > tags.?
> > > >
> > > > Thanks,
> > > >
> > > > Craig.
> > > >
> > >
> > >
> > > =====
> > > Wyn Easton
> > > wyn_easton@yahoo.com
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Calendar - Get organized for the holidays!
> > > http://calendar.yahoo.com/
> > >
> >
>
>
> =====
> Wyn Easton
> wyn_easton@yahoo.com
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Calendar - Get organized for the holidays!
> http://calendar.yahoo.com/


Mime
View raw message