• Post Reply Bookmark Topic Watch Topic
  • New Topic

Understanding the compiled JSP code

 
Vicky Mittal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Experts,

I seek your help in understanding how to read/understand the decompiled version of JSP.

I undertsand that when a JSP is hit, it gets converted to a .java file.

I have the .java file and wish to understand what it contains.

Basically there is a exception that is being thrown while rendering the JSP and I want to debug which code is causing the issue.

Can someone, please help me understand the same.

Thanks and Regards,
Vivek
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That Java code is hard to follow. It'll be easier to peruse the JSP. If you posted the relevant excerpt of the JSP code, as well as the stack trace, maybe we could point you in the right direction.
 
Vicky Mittal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

I wont be able to post any stack from the error.

Is there any reference on how can we try and understand the generated java code.

thanks again for the help.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wont be able to post any stack from the error.

Why not?
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vicky Mittal wrote:Is there any reference on how can we try and understand the generated java code.

As Ulf pointed out above it is advisable to fix the problem where it resides in the first place. Not only it is easy but also it is the solution you are looking for.
So even if go through the generated servlet and identify the error, you will have to fix it in the JSP. The overhead of understanding the generated servlet will not serve any purpose.

But since you asked, ignore stuff from that .java file that is of no interest and the rest would look more or less like another servlet.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It used to be much more instructive to look at the generated code. In fact, I do so in this article on JSP.

But these days, not so much. The generated code tends to simply be calls into proprietary code within the container and isn't all that instructive anymore in diagnosing problems.

You'd be much better off posting the relevant section of code (UseCodeTags) and the error with stack trace. I cannot imagine any valid reason that you could not post a stack trace. (Does your company really think that what it names its methods is a trade secret? )
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!