Thanks very much to anybody who can help.
I am using Tomcat 5.5 and when i compile a jsp i'm facing this
problem.
If the Jsp contains an error in a java script, tomcat doesn't print
out the number where the compilation occurs, but prints out the
beginning of the java script.
Example:
this is the JSP:
----------------------CUT-------------------
<%
out.println("1");
out.println("1");
out.println("1") //Missing something here!
out.println("1");
%>
----------------------CUT-------------------
this is the error:
----------------------CUT-------------------
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /engineeringcentral/
custom/GD_ProveEnrico.jsp
Generated servlet error:
Syntax error, insert ";" to complete Statement
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:
84)
[....]
----------------------CUT-------------------
But i would like to get:
An error occurred at line: 4
instead of 1.
This is very important in complex jsp's.
I think i my previous tomcat (4.1) it worked so, but it doesn't
anymore. Is it a kind of setting?
Thank you very much
Lew - 04 May 2007 14:10 GMT
> Tomcat 5.5 ... this is the JSP:
> ----------------------CUT-------------------
[quoted text clipped - 10 lines]
> An error occurred at line: 4
> instead of 1.
AFAIK all that scriptlet represents a block of whitespace to a JSP, hence it's
all one line in JSP terms.
I doubt we can change that without rebuilding Tomcat. You might find avenues
to express your opinion directly to the tomcat people on their project site.

Signature
Lew
Wojtek - 07 May 2007 14:26 GMT
ennio wrote :
> Thanks very much to anybody who can help.
> I am using Tomcat 5.5 and when i compile a jsp i'm facing this
> problem.
It gets better. When your try to use an object which has not been
created, all you get is a "Jasper Exception".
So with myRef.getStuff(), if myRef is null becuase you forgot to set
it, the runtime will produce a Jasper Exception, but it does NOT tell
you where it is, or what even caused it.
The usual cause is a null reference, but it may be anything.

Signature
Wojtek :-)