- This topic has 1 reply, 2 voices, and was last updated 21 years, 7 months ago by
Scott Anderson.
-
AuthorPosts
-
jwanglerMemberOK – I’ve seen many posts and responses about debugging jsps with fragments. However, I don’t see an exact answer to my situation. So – to beat a dead horse – here is yet another question about this topic.
I have sold my new employer on the benefits of purchasing licences to MyEclipse after showing them the jsp debugging capabilities by running them through the simple jsp debugging tutorial. Now I am in the process of moving their old eclipse projects into a new MyEclipse project. I was succesful at doing that, and I am able to set breakpoints in jsps, but am having problems in relation to their use of fragments.
The two problems are:
1)When I set a breakpoint in a top level jsp that has included fragments at the top, the source doesn’t seem to match the execution context. In other words, as I step in the debugger – I step over blank lines, comments, etc.
2)My breakpoints in fragments aren’t hit. After reading responses to similar posts – I removed the breakpoint in the included fragment, and set a breakpoint in the jsp that includes the fragment. That breakpoint is hit – but I can’t see the “inlined” source for the fragment – so I still can’t debug the inlined jsp fragment.It seems the basic problem is that included fragments aren’t appearing inlined in the source when debugging – which makes debugging jsps that make use of includes next to impossible. Is this related to the fact that they have named their jsp fragments as .jsp instead of .jspf, or is this a technology limitation when debugging jsps that make use of included fragments?
Thanks, Jim Wangler
November 4, 2003 at 12:52 pm #199751
Scott AndersonParticipantJim,
1)When I set a breakpoint in a top level jsp that has included fragments at the top, the source doesn’t seem to match the execution context. In other words, as I step in the debugger – I step over blank lines, comments, etc.
The source mapping from the generated java file back to the JSP typically includes the location of every line in the JSP, not just java lines. This makes it possible to do things like set your breakpoints on lines of HTML or whatever, but the exact behavior is server dependent, based on how it creates its source maps. Since you didn’t follow the posting guidelines and give me your complete configuration details, 😉 I can’t comment more specifically.
2) …I removed the breakpoint in the included fragment, and set a breakpoint in the jsp that includes the fragment. That breakpoint is hit – but I can’t see the “inlined” source for the fragment – so I still can’t debug the inlined jsp fragment.
…
It seems the basic problem is that included fragments aren’t appearing inlined in the source when debugging – which makes debugging jsps that make use of includes next to impossible.You won’t see the inlined code in the JSP; you’ll see the original source. When you use the debugger to “Step Over” the include statement, a new editor window that contains the fragment source code should be opened and highlighted appropriately as you continue to step.
Is this related to the fact that they have named their jsp fragments as .jsp instead of .jspf, or is this a technology limitation when debugging jsps that make use of included fragments?
The JSP spec says that only top-level JSP’s should have a .jsp extension. It recommends a .jspf extension for fragments, but you’re actually free to use whatever non-.jsp extension you like. The editor will compile all .jsp files and mark them appropriately if they fail to compile. The editor will not compile non-.jsp files since it is assumed they are checked when included in their parent JSP’s.
–Scott
MyEclipse Support -
AuthorPosts