- This topic has 5 replies, 2 voices, and was last updated 19 years, 4 months ago by Paul Baker.
-
AuthorPosts
-
Paul BakerMemberI’m unable to debug JSPs with nested fragment files.
Environment: Eclipse 3.1 and MyEclipse from EnterpriseWorkbenchInstaller_4.0M2_E3.1.exe
Server: Weblogic 8.1I�m able to set a breakpoint and debug a simple JSP. When this JSP is run the debugger is invoked at the specified breakpoint:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'debug.jsp' starting page</title> </head> <body> <% String test = "test"; %> My test string is: <%= test %> <br> </body> </html>
So, I know that everything is set up ok. But our production JSPs are VERY complex and may include many nested file fragments.
For example: JSP a.jsp may include fragments:
<%@ include file="b.jspf" %> <%@ include file="c.jspf" %> <%@ include file="d.jspf" %>
Each JSP fragment may then include many more fragments:
For example JSP fragment: b.jspf may include fragments:<%@ include file="e.jspf" %> <%@ include file="f.jspf" %> <%@ include file="g.jspf" %>
And so on.
Because there are so many files and the files are very large I have turned off automatic JSP validation. When I manually validate one of our JSPs by right clicking and selecting Validate JSP I get the message: �The JSP File is Valid�. The editor does flag problems via the red bar in the right hand vertical column. See picture:
The “annotations” listed are incorrect. For example the first line states:
-CityData cannot be resolved to a type (in file: �inc_processfindbooking.jspf�).
A search for CityData in inc_processfindbooking.jspf returns zero occurrences.
CityData IS refereced in one of the inc_processfindbooking.jspf include files:
<%@ include file="../utils/city/inc_cityejb.jspf" %>
And inc_cityejb.jspf does contain the following:
<%@ page import = "com.xxxxxx.yyyyy.zzzzzz.city.param.CityData" %>
Would these annotation problems prevent the debugging?
What am I missing?
The JSPs can be successfully deployed with no problems.
My first thought is that the nested includes are causing problems.I beleive the classpath is set up correctly as CityData code completion works fine in the fragment file: ../utils/city/inc_cityejb.jspf
See picture:
Another annotation problem identified is:
INC_SECURITYREDIRECT_BKG cannot be resolved (in file: �inc_processfindbooking.jspf�)
INC_SECURITYREDIRECT_BKG is referenced in inc_processfindbooking.jspf and defined in include fragment file: inc_securityredirect.jspf. The import does seem to be after the usage, but this JSP works fine when deployed.
See picture:
I am actively promoting MyEclipse within our organization but will not be able to get any interest until this is resolved.
Thanks in advance.
Paul
Paul BakerMemberThe problem with the annotations seems to be caused because I had not included a class folder in build path. So, the annotation problem is not an issue.
The real issue is setting breakpoints in jspf files OR after jspf includes. If I place the breakpoint in the main jsp file and before any includes then the breakpoints work 🙂 . If I place the breakpoint after the jspf includes or in a jspf file then the breakpoints do not work 🙁 .
I have read some other thread that address the problem. But there were not solutions…
Is this still a problem? If not, then what am I missing…
If so, when will debugging work with jspf fragments (as advertised)?MyEclipse quote:
Supports breakpoints in both JSP files and included fragments
Scott AndersonParticipantThe real issue is setting breakpoints in jspf files OR after jspf includes. If I place the breakpoint in the main jsp file and before any includes then the breakpoints work 🙂 . If I place the breakpoint after the jspf includes or in a jspf file then the breakpoints do not work 🙁 .
Placing a breakpoing directly in a jspf is a problem. Here’s the issue. A jspf might be included in 1000 differnt files in 1000 different ways. What does setting a breakpoint in it really mean then? It means setting 1000 breakpoints in the files that include the jspf because jspf files aren’t called externally, they’re litterally placed “inline” and replicated in each file they’re used in. Right now, we don’t run down every usage of the jspf to know precisely where to set all the breakpoints in all the files that include it. However, we do allow you to debug by going *into* them, via stepping. So, you can set the breakpoint on a java line above the jspf include you want to debug and then select Step Into in the debugger to walk through the jspf. In the case where a java snippet is not close to the include, the workaround is simply to add one, temporarily, set the breakpoint on it, then step into the jspf you want to debug. A little circuitous I know, but it is effective.
Paul BakerMemberScott, thank-you for your reply.
I had tried what you suggested but there seems to be a problem with the line numbering. I placed a java snippet at the beginning of the JSP and then started stepping.. Everything works fine until the first fragment is included. Then the JSP lines shown in the debugger are completely wrong. The lines shown are JSP lines and it should be a JSPF fragment lines.
My problem is echoed here:
http://www.myeclipseide.com/modules.php?op=modload&name=PNphpBB2&file=viewtopic&t=7393It the line problem still an open issue.
We use Weblogic 8.1.
Paul
Scott AndersonParticipantPaul,
The problem is with WebLogic 8.1 – it doesn’t really support JSR-045 for “real” source level JSP debugging. We have something that works with what they have, but it can’t take into account included files since the information just isn’t available. Good news though – our debugger *will* work with WLS 9 since it really *does* support JSR-045. You’ll need the upcoming release of MyEclipse 4.0M3 with the WLS 9 connector to get that working, if it’s an option for you.
Paul BakerMemberOk, I understand. Thanks! Paul
-
AuthorPosts