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 Wed, 15 Nov 2000 10:10:50 GMT
I have been using doGet()!. So I make myself a doPost, and add in some
System.err.println,
and neither doGet or doPost is being called. :(

Craig.

----- Original Message -----
From: "Wyn Easton" <wyn_easton@yahoo.com>
To: <tomcat-user@jakarta.apache.org>; "C S Carnell" <carnell@iabg.de>
Sent: Tuesday, November 14, 2000 5:15 PM
Subject: Re: Integrating servlet output into JSP


> Hmm...
> I know that if I'm in the doPost() of a servlet and I include() another
> servlet the included servlet's doPost() method will be called.
> I'm not sure which method in the servlet is called when you do the
> include from a JSP to a servlet.
> Maybe you could put a System.out.println() in the doGet() and
> doPost() of the included servlet to see which method is being called.
> (Or maybe someone else already knows...)
>
> --- carnell <carnell@iabg.de> wrote:
> > 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/
> >
>
>
> =====
> Wyn Easton
> wyn_easton@yahoo.com
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Calendar - Get organized for the holidays!
> http://calendar.yahoo.com/


Mime
View raw message