- This topic has 8 replies, 3 voices, and was last updated 21 years, 5 months ago by No Operation.
-
AuthorPosts
-
russ_hammond@sdsusa.comMemberI’m not sure if this is the right place for this, or if it should be
posted elsewhere, but thought I’d start here. I’m trialing MyEclipse, still on EA1, waiting for EA2, hoping it will fix my problem.The problem is that a JSP is not compiling correctly. The offending
code in the JSP is the <option> tag. The code follows:<select name=”<%= dataBean.formTag_defaultVipAgent %>”
id=”defaultVipAgent”
onchange=”submitForm1(‘<%=dataBean.getVipCodeBase()%>SDSM0145?c=<%=dataBean.getJavaTickTime()%>&Panel=DefaultAgentSwitch&Action=DefaultAgentSwitch’,’NoConfirmationNeeded’);”><% int nbrLines = dataBean.getVipNames().length;
for(int i = 0; i<nbrLines; i++) { %>
<option value=”<%= dataBean.getVipNames(i) %>”
<%
if(dataBean.getVipNames(i).equalsIgnoreCase(dataBean.getDefaultVipName()))
{ %>
selected <% } // end if%>
> <%= dataBean.getVipNames(i) %> </option>
<% } // end for %>
</select>It’s translating into the following HTML:
<select name=”SdsFormData_defaultVipAgent”
id=”defaultVipAgent”
onchange=”submitForm1(‘/sdsvip/servlets/SDSM0145?c=1056129285696&Panel=DefaultAgentSwitch&Action=DefaultAgentSwitch’,’NoConfirmationNeeded’);”><option value=”O14″
O14 </option><option value=”O14JEK”
O14JEK </option>
</select>The closing ‘>’ for the <option> tag does exist in the JSP but notice
the lack of the closing ‘>’ in the HTML. The JSP got compiled into a
servlet that was missing the closing ‘>’.Anybody have any idea why it’s not working?
TIA
Russ
Scott AndersonParticipantRuss,
Thanks for posting this. We’re looking into it. I’ll post our findings when they’re available.
–Scott
MyEclipse Support
No OperationMemberbeen curious:
how do you use MyEclipse to display that HTML, or do you still need some web server?
NOP
Scott AndersonParticipantRuss,
We kicked this issue around internally and the consensus was that what you’ve posted is basically the manifestation of a bug in your JSP compiler. You’ve basically just found a case complex enough that it generates incorrect code. Have you tried simplifying the code to work around it or testing it on another server?
–Scott
MyEclipse Support
russ_hammond@sdsusa.comMemberTo display the HTML, I just view the source under the browser I’m running when I’m testing.
As for simplifying it, I haven’t tried that yet, and have just been testing on Tomcat. I’ll try out a few things to see what happens.
Incidentally, the problem still occured w/o MyEclipse installed, so I suspect it’s perhaps something in the Tomcat plug-in being used, sysdeo.
Scott AndersonParticipantRuss,
Shame on you! 😉 EA2 support Tomcat so please give it a try. Our HotSync’ing deployment model will keep your source in sync with your deployment automatically and with Tomcat 5 you even get source-level JSP debugging for all that code.
–Scott
MyEclipse Support
russ_hammond@sdsusa.comMemberThe problem seems to be related to jasper not compiling something like the following correctly under Tomcat 4.1:
<% } //end loop %> >
It works okay under Tomcat 4.0. And, if you change the source to:
<% } /* end loop */ %> >
it will work as well.
Scott AndersonParticipantActually, that kind of make sense. In the first example you’re effectively commenting out the rest of the line with the //. How this should be handled should really be in the spec, but I don’t know that it is. Definately one of the compilers is wrong, but I have no idea which. Writing code that works on both seems to be the best solution.
Nice workaround and thanks for reposting for everyone else.
–Scott
MyEclipse Support
No OperationMember<% } //end loop %> >
must preserve the > fot HTML output, since the Java single line comment ends at least there where the scriptlet code ends.
NOP
-
AuthorPosts