tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sharples, Brian" <Brian.Sharp...@cingular.com>
Subject RE: Errors Compiling a JSP
Date Thu, 15 Aug 2002 15:39:29 GMT
This is the first time colorValues array is used.  I am sending it three
request parameters as 'colors' from myFlag.html:

<HTML>
<HEAD><TITLE>Link Invoking a JSP with parameters</TITLE></HEAD>
<BODY>
	<A HREF="myFlag.jsp?country=venezuela&
		colors=yellow&colors=blue&colors=red">Invoke myFlag.jsp</A>
</BODY>
</HTML>

-----Original Message-----
From: Capr1ce [mailto:capr1ce@capr1ce.co.uk]
Sent: Thursday, August 15, 2002 11:33 AM
To: Tomcat Users List
Subject: RE: Errors Compiling a JSP



 >> Are you actually setting the colorValues array up anywhere before it 
gets to this piece of code?
Actually that was a stupid thing to say.
You should be setting a at least 3 request parameters as 'colors' before 
you call this code.

At 04:30 PM 15/08/2002 +0100, you wrote:

>Is there a more detailed error message?
>Are you actually setting the colorValues array up anywhere before it gets 
>to this piece of code?
>
>At 11:21 AM 15/08/2002 -0400, you wrote:
>>That didn't work.  Removing the "!" gave me the error: Status 500 The
server
>>encountered an internal error that prevented it from fulfilling this
>>request.
>>
>>Thanks
>>
>>Brian
>>
>>-----Original Message-----
>>From: Capr1ce [mailto:capr1ce@capr1ce.co.uk]
>>Sent: Thursday, August 15, 2002 11:19 AM
>>To: Tomcat Users List
>>Subject: Re: Errors Compiling a JSP
>>
>>
>>
>>Try it like this:
>>
>><% String[] colorValues = request.getParameterValues("colors"); %>
>>
>>
>>At 11:14 AM 15/08/2002 -0400, you wrote:
>> >Hi,
>> >
>> >I am learning JSP with the SAMS book"Teach Yourself JSP in 24 Hours".
One
>> >of the sample JSPs keeps getting a compiler error.  The code is:
>> >
>> >Parameters
>> >    * Country = <%= request.getParameter("country") %>
>> >    * Colors:
>> >    <%! String[] colorValues = request.getParameterValues("colors"); %>
>> >        * Color 1 = <%= colorValues[0]%>
>> >        * Color 2 = <%= colorValues[1]%>
>> >        * Color 3 = <%= colorValues[2]%>
>> >
>> >
>> >The error is a status 500 - Internal Server Error: Undefined variable or
>> >class name: request
>> >String[] colorValues = request.getParameterValues("colors");
>> >If I remove the colorValues variable declaration and just put <%
>> >request.getParameterValues("colors") %>, I get past that line.  Of
course,
>> >the next line then shows colorValues as undefined.
>> >I don't understand why this is occurring.  I am using Tomcat 4.0.4 and
>>j2sdk
>> >1.4.0_01.
>> >Thanks for your help.
>> >Brian Sharples
>> >
>> >
>> >--
>> >To unsubscribe, e-mail:
>><mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>> >For additional commands, e-mail:
>><mailto:tomcat-user-help@jakarta.apache.org>
>>
>>
>>
>>--
>>To unsubscribe, e-mail:
>><mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail:
>><mailto:tomcat-user-help@jakarta.apache.org>
>>
>>--
>>To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>
>
>
>
>--
>To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>
>



--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message