It's not a secret anymore!
The moose likes JSP and the fly likes jsp covert in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp covert in servlet" Watch "jsp covert in servlet" New topic

jsp covert in servlet

Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1283

When I got some javascript error it show some line where it occuers but when i try to find out it on jsp page not able to figure it out .. my friend told me that this line is not on jsp page this is the line belongs to when this jsp converted into servlet. Now I wanna know that if it's ture how can i see the servlet file and figure out the problem line and if it's not true then which line it indicate..?


No Kaustubh No Fun, Know Kaustubh Know Fun..
subhash kumar
Ranch Hand

Joined: Jul 14, 2010
Posts: 63
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


strutsvalidation is the workspace.

Subhash Kumar
Attitude is everything
David Newton

Joined: Sep 29, 2008
Posts: 12617

It's usually easier to just debug the JavaScript using something like Firebug than go digging around in the generated servlets. If the JavaScript was external (as it usually should be) you're more likely to get more useful debug information, at least in my experience. Or run it through a tool like JSLint, which can spot some syntax errors.
Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1283

Thanks david, subhash
I agree. Here's the link:
subject: jsp covert in servlet
It's not a secret anymore!