tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre Delisle <pierre.deli...@sun.com>
Subject Re: Compile Error in JSP generated servlet
Date Wed, 20 Dec 2000 23:12:06 GMT
This problem was already filed in bugrat under bug report #540,
and was fixed yesterday in the 3.2 source tree
(it was already fixed in tomcat-4.0).

    -- Pierre

Kitching Simon wrote:
> 
> Ok, you win :-)
> 
> I confirm that I get exactly the same screwy results, using
> tomcat3.2.1 on HPUX (jvm 1.2.2)
> 
> It looks to me like there is a major bug in the way that tomcat
> treats  <jsp:param> tags within <jsp:include>.
> 
> If no-one says otherwise in the next day or so, I suggest you
> file this one as a bug in "bugrat".
> 
> I include Dave's problem jsp page inline for the
> convenience of others..
> 
> Cheers,
> 
> Simon
> ---------------
> <HTML>
> <BODY bgcolor="#ffffff">
> 
> The following people matched your search criteria:
> <P>
> <%-- Invoke the Table servlet, tell it the name of the attribute
>      where the data is stored (data=people), set the border size to 4
>      on the <TABLE> tag, and describe each column to display.
> 
>      The "people" attribute was sent from the controller servlet
>      and contains a vector of people objects. --%>
> 
> <jsp:include page="TableServlet" flush="true">
>     <jsp:param name="data" value="people"/>
> 
>     <jsp:param name="tableOptions" value="BORDER=4"/>
> 
>     <jsp:param name="column" value="name"/>
>     <jsp:param name="columnType" value="data"/>
>     <jsp:param name="columnHeader" value="Name"/>
> 
>     <jsp:param name="column" value="age"/>
>     <jsp:param name="columnType" value="data"/>
>     <jsp:param name="columnHeader" value="Age"/>
> 
>     <jsp:param name="column" value="city"/>
>     <jsp:param name="columnType" value="data"/>
>     <jsp:param name="columnHeader" value="City"/>
> 
>     <jsp:param name="column" value="state"/>
>     <jsp:param name="columnType" value="data"/>
>     <jsp:param name="columnHeader" value="State"/>
> 
>     <jsp:param name="column" value="country"/>
>     <jsp:param name="columnType" value="data"/>
>     <jsp:param name="columnHeader" value="Country"/>
> 
>     <jsp:param name="column" value="postalCode"/>
>     <jsp:param name="columnType" value="data"/>
>     <jsp:param name="columnHeader" value="Postal Code"/>
> 
>     <jsp:param name="column" value="email"/>
>     <jsp:param name="columnType" value="data"/>
>     <jsp:param name="columnHeader" value="E-Mail"/>
> </jsp:include>
> </BODY>
> </HTML>
> 
> > -----Original Message-----
> > From: Moran, David (David) [SMTP:davidmoran@att.com]
> > Sent: Wednesday, December 20, 2000 5:45 PM
> > To:   'tomcat-user@jakarta.apache.org'
> > Subject:      RE: Compile Error in JSP generated servlet
> >
> >
> >
> > -----Original Message-----
> > From: Kitching Simon [mailto:Simon.Kitching@orange.ch]
> > Sent: Wednesday, December 20, 2000 10:50 AM
> > To: 'tomcat-user@jakarta.apache.org'
> > Subject: RE: Compile Error in JSP generated servlet
> >
> >
> > David,
> >
> > How about posting the original jsp source code?
> >
> > The problem *is* probably somewhere in there,
> > and even if it isn't, most people (like me) are
> > unlikely to give too much attention to a possible
> > problem in tomcat unless we can see for
> > ourselves that there is nothing wrong with the
> > original jsp...
> >
> > Cheers,
> >
> > Simon
> >
> > > -----Original Message-----
> > > From:       Moran, David (David) [SMTP:davidmoran@att.com]
> > > Sent:       Wednesday, December 20, 2000 4:41 PM
> > > To: 'tomcat-user@jakarta.apache.org'
> > > Subject:    RE: Compile Error in JSP generated servlet
> > >
> > > But I'm not doing it.  The JSP engine is doing it.
> > >
> > > -----Original Message-----
> > > From: Morahg, Yoav [mailto:Ymorahg@gist.com]
> > > Sent: Wednesday, December 20, 2000 9:52 AM
> > > To: 'tomcat-user@jakarta.apache.org'
> > > Subject: RE: Compile Error in JSP generated servlet
> > >
> > >
> > > You are declaring the String array twice in your code.
> > >
> > > The first one is okay...
> > >
> > > String [] _tmpS = new String[7];
> > >
> > > but you can't do this again in your code. If you want to create a new
> > > String
> > > array for _tmpS after already declaring _tmpS you should do it without
> > > declaring it...
> > >
> > > _tmpS = new String[7];
> > >
> > > Hope this helps.
> > >
> > > -Y
> > >
> > > ---------------------------
> > > Yoav Morahg
> > > Software Engineer
> > > Gist Communications
> > > (212) 965-1999 xt 110
> > > ymorahg@gist.com
> > >
> > > Interactive Television Guides
> > >
> > >
> > > -----Original Message-----
> > > From: Moran, David (David) [mailto:davidmoran@att.com]
> > > Sent: Tuesday, December 19, 2000 5:50 PM
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Compile Error in JSP generated servlet
> > >
> > >
> > > What would cause JSP to generate the same variable in the generated
> > > servlet.
> > > I am getting the following compile error in the JSP generated servlet in
> > > tomcat 3.2 on Windows NT.  I am trying to get the book examples to run
> > > from
> > > "SE Using Java Server Pages and Servlets"
> > >
> > > Error: 500
> > >
> > > Location: /examples/examples/ShowPeople.jsp
> > >
> > > Internal Servlet Error:
> > >
> > > org.apache.jasper.JasperException: Unable to compile class for
> > >
> > JSPD:\java\servlet\jakarta-tomcat-3.2\work\localhost_8080%2Fexamples\_0002
> > > fe
> > > xamples_0002fShowPeople_0002ejspShowPeople_jsp_0.java:75: Variable
> > '_tmpS'
> > > is already defined in this method.
> > >                     String [] _tmpS = new String[7];
> > >                               ^
> > >
> > D:\java\servlet\jakarta-tomcat-3.2\work\localhost_8080%2Fexamples\_0002fex
> > > am
> > > ples_0002fShowPeople_0002ejspShowPeople_jsp_0.java:83: Variable '_tmpS'
> > is
> > > already defined in this method.
> > >                     String [] _tmpS = new String[7];
> > >                               ^
> > >
> > >
> > > This is the offending code from the servlet
> > >
> > > // begin
> > >
> > [file="D:\\java\\servlet\\jakarta-tomcat-3.2\\webapps\\examples\\examples\
> > > \S
> > > howPeople.jsp";from=(14,0);to=(46,14)]
> > >                 {
> > >                     String _jspx_qStr = "";
> > >                     _jspx_qStr = _jspx_qStr + "?tableOptions=" +
> > > "BORDER=4";
> > >                     String [] _tmpS = new String[7];
> > >                     _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
> > >                     _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
> > >                     _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
> > >                     _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
> > >                     _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
> > >                     _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
> > >                     _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
> > >                     String [] _tmpS = new String[7];
> > >                     _jspx_qStr = _jspx_qStr + "&column=" + "name";
> > >                     _jspx_qStr = _jspx_qStr + "&column=" + "age";
> > >                     _jspx_qStr = _jspx_qStr + "&column=" + "city";
> > >                     _jspx_qStr = _jspx_qStr + "&column=" + "state";
> > >                     _jspx_qStr = _jspx_qStr + "&column=" + "country";
> > >                     _jspx_qStr = _jspx_qStr + "&column=" + "postalCode";
> > >                     _jspx_qStr = _jspx_qStr + "&column=" + "email";
> > >                     String [] _tmpS = new String[7];
> > >                     _jspx_qStr = _jspx_qStr + "&columnHeader=" + "Name";
> > >                     _jspx_qStr = _jspx_qStr + "&columnHeader=" + "Age";
> > >                     _jspx_qStr = _jspx_qStr + "&columnHeader=" + "City";
> > >                     _jspx_qStr = _jspx_qStr + "&columnHeader=" +
> > "State";
> > >                     _jspx_qStr = _jspx_qStr + "&columnHeader=" +
> > > "Country";
> > >                     _jspx_qStr = _jspx_qStr + "&columnHeader=" + "Postal
> > > Code";
> > >                     _jspx_qStr = _jspx_qStr + "&columnHeader=" +
> > "E-Mail";
> > >                     _jspx_qStr = _jspx_qStr + "&data=" + "people";
> > >                     pageContext.include("TableServlet" + _jspx_qStr);
> > >                 }
> >  << File: ShowPeople.jsp >>

Mime
View raw message