facebook

The JSP editor error tip

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #542846 Reply

    derline
    Participant

    Version: 2017 Stable 1.0
    When like this, it’s ok :

    <select>
        <option  ></option>
    </select>

    When like this, it’s bad:

    <select>
        <option <c:if test=""></c:if> ></option>
    </select>

    At last, I have to wirte circuitously like this:

    #542875 Reply

    Brian Fernandes
    Moderator

    derline,

    I must say I have not come across code where <option <c:if ... would be considered valid, but on doing some research, I do see some examples out there like this (again, no idea if these are valid).

    If you ignore our validation, does the “bad” code you pasted above work as expected in your deployed application.

    #542877 Reply

    support-swapna
    Moderator

    derline,

    The validation error is due to using <c:if> tag inside the <option> tag. Instead of using c:if, you can use EL ternary operator. Example : testStatement ? value1 : value2

    This is how the option tag looks with the ternary operator :
    <option value="${tpl.id}" ${pro.tpl_id==tpl.id?'selected="selected"':''}>${tpl.name}</option>

    Hope this helps. Please let us know if you see any issues.

    –Swapna
    MyEclipse Support

    #548724 Reply

    derline
    Participant

    Thank you very much, Brian Fernandes and support-swapna!

    From China.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: The JSP editor error tip

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