jsp - Convert &lt; to <

Discussion in 'Java' started by compaqr4000@lycos.com, Aug 15, 2007.

  1. Guest

    I'm using java, struts and jsp. On one of my forms I display the
    website of a company with:
    <td class="stockinfo"> <bean:write
    name="stockInformationForm" property="fundValue(website).value"/> </
    td>

    but jsp converts the < and > into &lt; and &gt;

    When I view the source html in my browser it shows what should be a
    link as:
    <td class="stockinfo">&lt;A HREF=http://www.advanta.com
    target=&quot;_blank&quot;&gt;www.advanta.com&lt;/A&gt;</td>

    .... but it should be:
    <td class="stockinfo"><A HREF=http://www.advanta.com
    target=&quot;_blank&quot;>www.advanta.com</A></td>


    Any suggestions on how to fix this?

    Thanks
    Kay
     
    , Aug 15, 2007
    #1
    1. Advertising

  2. On Aug 15, 10:04 am, wrote:
    > I'm using java, struts and jsp. On one of my forms I display the
    > website of a company with:
    > <td class="stockinfo"> <bean:write
    > name="stockInformationForm" property="fundValue(website).value"/> </
    > td>
    >
    > but jsp converts the < and > into &lt; and &gt;
    >
    > When I view the source html in my browser it shows what should be a
    > link as:
    > <td class="stockinfo">&lt;A HREF=http://www.advanta.com
    > target=&quot;_blank&quot;&gt;www.advanta.com</A></td>
    >
    > ... but it should be:
    > <td class="stockinfo"><A HREF=http://www.advanta.com
    > target=&quot;_blank&quot;>www.advanta.com</A></td>
    >
    > Any suggestions on how to fix this?
    >
    > Thanks
    > Kay


    Try <bean:write name="stockInformationForm"
    property="fundValue(website).value" filter="false"/>

    If using c:eek:ut instead of bean:write, use escapeXml="false".

    -cheers,
    Manish
     
    Manish Pandit, Aug 15, 2007
    #2
    1. Advertising

  3. Guest

    On Aug 15, 10:31 am, Manish Pandit <> wrote:
    > On Aug 15, 10:04 am, wrote:
    >
    >
    >
    > > I'm using java, struts and jsp. On one of my forms I display the
    > > website of a company with:
    > > <td class="stockinfo"> <bean:write
    > > name="stockInformationForm" property="fundValue(website).value"/> </
    > > td>

    >
    > > but jsp converts the < and > into &lt; and &gt;

    >
    > > When I view the source html in my browser it shows what should be a
    > > link as:
    > > <td class="stockinfo">&lt;A HREF=http://www.advanta.com
    > > target=&quot;_blank&quot;&gt;www.advanta.com</A></td>

    >
    > > ... but it should be:
    > > <td class="stockinfo"><A HREF=http://www.advanta.com
    > > target=&quot;_blank&quot;>www.advanta.com</A></td>

    >
    > > Any suggestions on how to fix this?

    >
    > > Thanks
    > > Kay

    >
    > Try <bean:write name="stockInformationForm"
    > property="fundValue(website).value" filter="false"/>
    >
    > If using c:eek:ut instead of bean:write, use escapeXml="false".
    >
    > -cheers,
    > Manish


    That worked perfectly!

    Thanks so much!

    Kay
     
    , Aug 15, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthias Nietz
    Replies:
    1
    Views:
    3,456
    VisionSet
    Nov 12, 2003
  2. Raymond DeCampo

    Custom tags and <jsp:plugin> / <jsp:param>

    Raymond DeCampo, Feb 18, 2004, in forum: Java
    Replies:
    0
    Views:
    635
    Raymond DeCampo
    Feb 18, 2004
  3. Timo Nentwig

    JSP 2.0: <jsp:attribute> in <c:if>

    Timo Nentwig, May 10, 2004, in forum: Java
    Replies:
    0
    Views:
    630
    Timo Nentwig
    May 10, 2004
  4. Sean Aitken
    Replies:
    3
    Views:
    11,049
    Alex Hunsley
    Oct 21, 2004
  5. Replies:
    0
    Views:
    4,394
Loading...

Share This Page