AW: Errors Compiling a JSP

2002-08-15 Thread Ralph Einfeldt

There should be more information available in one of the logs.

Some background:

The JSP is compiled to a servlet.

With %! % you define members or methods for the class or 
instance.
With % % you fill the body of a method, all implicit
variables (like request) are local to this method.

Have a look at the generated code in the work directory
to get a better idea what happens with your code.

 -Ursprüngliche Nachricht-
 Von: Sharples, Brian [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 15. August 2002 17:21
 An: 'Tomcat Users List'
 Betreff: RE: Errors Compiling a JSP
 
 
 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:[EMAIL PROTECTED]]
 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 bookTeach 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:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: AW: Errors Compiling a JSP

2002-08-15 Thread Capr1ce


If that is all the code you have, I assume you have a NullPointerException, 
which means that one of the variables you are trying to use is null. ie. 
probably never set.
If that code you gave was in a file called 'test.jsp', add parameters onto 
the end of it when you call it in your browser like this:

http://localhost:8080/yourWebapp/test.jsp?country=ukcolors=redcolors=bluecolors=pink

with this code:

Parameters
 * Country = %= request.getParameter(country) %
  * Colors:
 % String[] colorValues = request.getParameterValues(colors); %
* Color 1 = %= colorValues[0]%
* Color 2 = %= colorValues[1]%
   * Color 3 = %= colorValues[2]%

and it will work.


At 05:34 PM 15/08/2002 +0200, you wrote:
There should be more information available in one of the logs.

Some background:

The JSP is compiled to a servlet.

With %! % you define members or methods for the class or
instance.
With % % you fill the body of a method, all implicit
variables (like request) are local to this method.

Have a look at the generated code in the work directory
to get a better idea what happens with your code.

  -Ursprüngliche Nachricht-
  Von: Sharples, Brian [mailto:[EMAIL PROTECTED]]
  Gesendet: Donnerstag, 15. August 2002 17:21
  An: 'Tomcat Users List'
  Betreff: RE: Errors Compiling a JSP
 
 
  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:[EMAIL PROTECTED]]
  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 bookTeach 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:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
  --
  To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: AW: Errors Compiling a JSP

2002-08-15 Thread Sharples, Brian

The URL I am sending from myFlag.html is:

http://localhost:8080/myJSPs/Hour10/myFlag.jsp?country=venezuelacolors=yell
owcolors=bluecolors=red

-Original Message-
From: Capr1ce [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 11:41 AM
To: Tomcat Users List
Subject: Re: AW: Errors Compiling a JSP



If that is all the code you have, I assume you have a NullPointerException, 
which means that one of the variables you are trying to use is null. ie. 
probably never set.
If that code you gave was in a file called 'test.jsp', add parameters onto 
the end of it when you call it in your browser like this:

http://localhost:8080/yourWebapp/test.jsp?country=ukcolors=redcolors=blue;
colors=pink

with this code:

Parameters
 * Country = %= request.getParameter(country) %
  * Colors:
 % String[] colorValues = request.getParameterValues(colors); %
* Color 1 = %= colorValues[0]%
* Color 2 = %= colorValues[1]%
   * Color 3 = %= colorValues[2]%

and it will work.


At 05:34 PM 15/08/2002 +0200, you wrote:
There should be more information available in one of the logs.

Some background:

The JSP is compiled to a servlet.

With %! % you define members or methods for the class or
instance.
With % % you fill the body of a method, all implicit
variables (like request) are local to this method.

Have a look at the generated code in the work directory
to get a better idea what happens with your code.

  -Ursprüngliche Nachricht-
  Von: Sharples, Brian [mailto:[EMAIL PROTECTED]]
  Gesendet: Donnerstag, 15. August 2002 17:21
  An: 'Tomcat Users List'
  Betreff: RE: Errors Compiling a JSP
 
 
  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:[EMAIL PROTECTED]]
  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 bookTeach 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:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
  --
  To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




AW: Errors Compiling a JSP

2002-08-15 Thread Ralph Einfeldt


I don't believe that, there are always error messages 
in log files. look at them.

- Have you looked at the genarated servlet ?

- Check colorValues for null before derefencing it.
- Check colorValues.length before accessing an index.
- This is not the right forum to learn java.

 -Ursprüngliche Nachricht-
 Von: Sharples, Brian [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 15. August 2002 17:40
 An: 'Tomcat Users List'
 Betreff: RE: Errors Compiling a JSP
 
 If I get rid of the bang I get another internal error with no other
 information.

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]