Khurram Mahmood wrote:
> I am using jsp1.0 and JRUN2.3. There was no jsp:forward in 0.92 and if I was
> using 0.92, I would've gotten a compilation error, not this strange
> behavior.
>
That was my first thought as well, until I remembered how stupid compilers
really are.
The JSP engine looks through your page for tags it recognizes. Anything else
is considered to be template text, and is passed through unchecked. For 0.92
engines, it recognizes things like <usebean> (without the jsp prefix). It saw
<jsp:forward>, concluded "this must be some new HTML tag I do not understand",
and sent it on to the output file where it showed up in your browser's text.
One of the reasons that the "jsp:" prefix was added in 1.0 was to allow the
compiler to be smarter than this. It can look at a tag <jsp:xxxxx> and
complain if it does not know what xxxxx is. But, if you omit the prefix and
just incorrectly use <forward>, I bet it would make the same mistake.
>
> Thanks,
>
> KM
>
Craig McClanahan
>
> -----Original Message-----
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 02, 1999 9:06 PM
> To: Khurram Mahmood
> Cc: [EMAIL PROTECTED]
> Subject: Re: AW: Redirection to another page
>
> Khurram Mahmood wrote:
>
> > For some reason jsp forward tag never works. Instead of compiling the
> target
> > jsp page into servlet and then executing it, it just shows the jsp code on
> > the html page as text.
> >
> > KM
> >
>
> What version of JSP does your environment support? <jsp:forward> was added
> in
> version 1.0 -- if you are on a version 0.91 or 0.92 system, you won't be
> able
> to use this.
>
> Craig
>
> >
> >
> > -----Original Message-----
> > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, December 02, 1999 12:19 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: AW: Redirection to another page
> >
> > "Bernard, Frank" wrote:
> >
> > > > Is it possible to write JSP code to redirect the browser to open a new
> > > > page,
> > > > say, page B from JSP code in page A?
> > > >
> > > use: response.sendRedirect ( target_URL );
> > >
> >
> > You can also do this on the server side (without a second round trip back
> to
> > the
> > client) with
> >
> > <jsp:forward page="/targetpage.jsp" />
> >
> > Craig McClanahan
> >
> >
> ===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > FAQs on JSP can be found at:
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html