facebook

JSP compilation error – missing closing ‘>’ on generated

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #196399 Reply

    I’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

    #196402 Reply

    Scott Anderson
    Participant

    Russ,

    Thanks for posting this. We’re looking into it. I’ll post our findings when they’re available.

    –Scott
    MyEclipse Support

    #196447 Reply

    No Operation
    Member

    been curious:

    how do you use MyEclipse to display that HTML, or do you still need some web server?

    NOP

    #196453 Reply

    Scott Anderson
    Participant

    Russ,

    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

    #196470 Reply

    To 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.

    #196472 Reply

    Scott Anderson
    Participant

    Russ,

    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

    #196477 Reply

    The 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.

    #196480 Reply

    Scott Anderson
    Participant

    Actually, 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

    #196499 Reply

    No Operation
    Member

    <% } //end loop %> >

    must preserve the > fot HTML output, since the Java single line comment ends at least there where the scriptlet code ends.

    NOP

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: JSP compilation error – missing closing ‘>’ on generated

You must be logged in to post in the forum log in