facebook

Using String constant in <%= %> [Closed]

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

    fljmayer
    Participant

    I am using MyEclipse 3.8Beta-1 on Ecplise 3.0RC3.
    I get the following syntax error when using a String constant in a script expression <%= %>:
    expected %>”

    Here is an example:
    <bean:message key=”<%=”prompt.case.” + caseRecordType.getKey()%>”/>

    As far as I know my code is correct, it executes without problems in Tomcat 4.1. So I assume that there is a parsing problem with MyEclipse.

    #209056 Reply

    Riyad Kalla
    Member

    Per the JSP spec, you need to escape your quotes, or I think you can use single quotes.

    #209072 Reply

    fljmayer
    Participant

    I cannot find any restriction like in the JSP 2.0 specification. Where did you see that?

    Also this kind of restriction doesn’t make sense to me, all it should care about is the opening <%= and the closing %>. Below is how the specification defines this in section JSP.9.4.3, and my code conforms to that.

    
    Original            Equivalent Text
    <%= expression %>   out.print(expression)
    
    #209088 Reply

    support-michael
    Keymaster

    I cannot find any restriction like in the JSP 2.0 specification. Where did you see that?

    See section 1.6 of the JSP2 Spec, subsection titled “Quoting in Attributes”. Following is an applicable example from this section, see page 1-35.

    The following line shows an illegal attribute values.
    <mytags:tag value=”<%= “hi!” %>” />

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Using String constant in <%= %> [Closed]

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