views:

21

answers:

1

If I try to add jqote2 variable declaration into struts2 tablig, such as name attribute. For "<" and ">" character, struts2 will escape them into < and > to client browser, and make jqote2 unable to locate variable defined in struts2 tag attribute, example below:

<script type="text/html" id="priceRowTemplate">  
    <![CDATA[
      <tr>
        <td>
          <s:select name="alist[<%= this.index%>].field1"
            list="@xxx.AEnumObject@values()"
            listKey="toString()" listValue="caption" />
        </td>
        <td><input value="<%= this.priceOfAdult%>"/></td>
        <td><input value="<%= this.priceOfKid%>"/></td>
        <td>X</td>
      </tr>
  ]]>

even I use <s:select name="%{'alist[<%= this.index%>].field1'}"... , the result is still the same. Here is the string response to client

<select name="alist[&lt;%= this.index%&gt;].field1">..</select>

Anyone knows how to tell Struts2 not to escape HTML tag? thanks a lot.

A: 

Hi Matt.

Though I've never used Struts I've googled a bit and found http://struts.apache.org/2.x/docs/property.html. This might work in your case.

Anyways, if you fail to get it to work, I could rewrite jQote2 for you to not depend on < > style tags.

Drop me a note.
aefxx

aefxx
Hi Aefxx,It seems that Struts2 only provide HTML "escape" attribute for <s:property/> tag, but not for the other attributes. It would be very great if jQote2 could use another character to override default <>, just like default tag(%). You can take your time. Thank you very much.
Matt