facebook

JSP compilation error on Strings [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #205094 Reply

    khuwig
    Member

    I get a compilation error ‘expected %>”‘ when using strings in runtime arguments to custom tags. Use this TLD and JSP:

    —- iku.tld —-

    
    <taglib>
        <tlib-version>1.0</tlib-version>
        <jsp-version>1.2</jsp-version>
        <short-name>iku</short-name>
        <uri>/iku</uri>
        <display-name>iku</display-name>   
        <tag>
            <name>conditional</name>
            <tag-class>de.ikuag.sponts.tag.ConditionalTag</tag-class>
            <body-content>JSP</body-content>
            <attribute>
                <name>cond</name>
                <required>true</required>
                <rtexprvalue>true</rtexprvalue>
                <type>boolean</type>
            </attribute>
        </tag>
    </taglib>
    

    —- bug.jsp —-

    
    <%@taglib prefix="iku" uri="/WEB-INF/iku.tld"%>
    <% String haha = "haha"; %>
    <iku:conditional cond="<%= "haha" != null %>">
    </iku:conditional>
    

    If you replace the String-constant ‘”haha”‘ by the variable ‘haha’ it works fine. It does also work fine with Jetty, so it looks like a bug in the compiler.

    #205097 Reply

    Riyad Kalla
    Member

    You need to escape your double quotes inside of the expression, then it will work (I tried this locally).

    #205101 Reply

    khuwig
    Member

    Thank you, this helped.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: JSP compilation error on Strings [Closed]

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