tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Brogden <wbrog...@bga.com>
Subject Re: Newbie: JSP + JSPBEAN + XML
Date Wed, 07 Jun 2000 12:48:42 GMT
By the time your bean getMap is called, the JSP has already
gotten an output stream and has written to it - but it has not
been flushed. Instead of passing response to your bean you should
pass the out output stream to keep things in order. 

Marc DANAI wrote:
> 
> Hi,
> 
>  I've got strange PB with Tomcat. I can't understand
> why the result of my JSPBean goes somewhere else in
> the page.
> 
> Here is my JSP page:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.0//EN">
> <HTML>
>   <HEAD>
>     <TITLE>Map System </TITLE>
>     <META HTTP-EQUIV="content-type"
>             CONTENT="text/html;charset=UTF-8">
>     <jsp:useBean id="Map" scope="page" class="map"/>
>   </HEAD>
>   <BODY>
>         <%= Map.getMap(request, response) %>
>   </BODY>
> </HTML>
> 
> When Map.getMap is executed the result goes before
> starting <HTML> tag.
> 
> Here page source after calling jsp file:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <IMG WIDTH=425 HEIGHT=250
> SRC="http://demo.vicinity.com/gif?&amp;CT=37.3772:-122.0216:40000&amp;IC=37.3772:-122.0216:620:You+are+here&amp;FAM=example&amp;W=425&amp;H=250">
> 
> <!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.0//EN">
> <HTML>
> .....
> </HTML>
> 
> I cant understant why result goes before <HTML>. It is
> a for <?xml> tag returned also ?
> 
> But under W95 with JRun it works well with <?xml> tag
> at right position.....
> 
> any suggestion?
> 
> Thanks
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos -- now, 100 FREE prints!
> http://photos.yahoo.com
> 
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org

-- 
WBB - wbrogden@bga.com  Chief Scientist, LANWrights, Inc.
Java Programmer Certification information and mock exam
at  http://www.lanw.com/java/javacert/

Mime
View raw message