Regarding the java script errors, you can find the line number as in IE > view source > Go to line number.
But in case of Jsp error/Exception, you sometimes get the line number shown in the exception is not in the actual jsp page.
this is the line number of the servlet class produced form jsp.
you can in case of tomcat installation directory/work/
For example :
i am using eclipse
jsp file > Loing.jsp
servlet file corrosponding to this jsp can be found at this location