Display html code in a variable of a pojo failed by JSTL

hai,
my pojo contains the following code:
Class Pojo{ String htmlFormat="<a href='someurl'>click</a>";  setters and getters}
in my jsp displaying this pojo variable <c:out value="${htmlFormat}" /> is displaying it as text but the content is of type html ,but working fine if display the same with expression like
<%=pojo.getHtmlFormat() %>
and my jstl version is 1.1
any help will be helpful
thanks,
udai

Hi,
As Evnafets suggest you can use c:out tag. Or you can use apache commons api.
For example:
<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>
<%=StringEscapeUtils.escapeHtml("<h1>stands for heading tag</h1>")%>I feel Evanfets suggestion is better. If want to have escape in the POJO before giving to view. You can use the apache api.
~Balaji
Edited by: Balaji Chopparapu on Oct 14, 2010 4:21 AM

Similar Messages

  • Displaying html code in JSP page

    Hi.
    How do I display HTML code in an jsp page, so that the actual code is printet on the screen
    fx:
    <html>
    <head>
    </head>
    <body>
    </body>
    </html>

    I can't get my reply to show properly, but the answer is;
    Change < into &lt ; and > into &gt ;
    but with the semi-colons stuck next to the &lt and &gt if you get my drift

  • Display HTML code in WebDynpro for ABAP

    Hi, I would like to display a html page in a WebDynpro View, ie: I have the html code in a "string" variable and would now display this string now not with the html tags visible, but as a "real" html page.
    I found a thread in WebDynpro for ABAP but I am a little bit lost in converting the logic to ABAP world.
    Thanks

    >I found a thread in WebDynpro for ABAP but I am a little bit lost in converting the logic to ABAP world.
    I'm a little bit confused by this statement. Do you mean you found a thread in Web Dynpro Java, perhaps?
    Regardless the approach is possible using the iFrame UI.  The warning about the iFrame is that it is deprecated in NetWeaver 7.0 and 7.01 and my not be usable depending upon your support package level. However in NetWeaver 7.02 the iFrame returns to fully supported status.
    If you have the HTML content in a string, you can simply place it into the ICM cache.  This will provide a temporary URL for the content (you supply the lifetime of the URL) that can be referenced via the iFrame URL or even the LinkToURL if you want to open in a new window.
    Here is the code for placing the string into the ICM Cache:
    ****Create the cached response object that we will insert our content into
      data: cached_response type ref to if_http_response.
      create object cached_response
        type
          cl_http_response
        exporting
          add_c_msg        = 1.
      try. " ignore, if compression can not be switched on
          call method cached_response->set_compression
            exporting
              options = cached_response->co_compress_based_on_mime_type
            exceptions
              others  = 1.
        catch cx_root.
      endtry.
    ****set the data and the headers
      data: l_app_type type string.
          cached_response->set_cdata( lv_html_text ).
          l_app_type = 'text/html'.
    cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                         value = l_app_type ).
      cached_response->set_status( code = 200 reason = 'OK' ).
      cached_response->server_cache_expire_rel( expires_rel = 60 ).
      data: guid type guid_32.
      call function 'GUID_CREATE'
        importing
          ev_guid_32 = guid.
      concatenate '/sap/public' '/' guid '.' 'html' into lv_iframe_url.
    ****Cache the URL
      cl_http_server=>server_cache_upload( url      = lv_iframe_url
                                           response = cached_response ).
      wd_context->get_element( )->set_attribute(
        name =  `IFRAME_URL`
        value = lv_iframe_url ).

  • How to use h:message to display HTML code in message from property file

    I am using <h:message for="somecomponentid"/> to display the error message for a validator attached to a component and the error message which resides in message property file contains HTML elements like <br> and
    The HTML doesnt get displayed properly and the code <br> etc is displayed instead.
    Is there a method to get h:message to display HTML elements correcly.
    [I know there is an h:outputFormat which has an escape parameter to allow HTML to be rendered correcly but it has no for parameter to specify the component id whose validation error message I want to display]
    eg.
    <h:message for="somecomponentid"/>
    to display from errormessages.properties
    com.somecompany.thevalidationerrormessage=You have an error<br> Please click here to return to homepage

    Hello Ivan,
    Fortunately I have just recently found a solution to my problem by using code by a developer who had already had this problem in the past and who provided a patch on the Apache MyFaces jira site.
    See following link for the solution I downloaded and then used :
    http://issues.apache.org/jira/browse/MYFACES-155
    I believe they are intending to eventually release this in a future release of MyFaces extensions on this site.
    I used the escape attribute on the tag to allow 'escaped' html code in error messages to be used.
    Hope it solves your problem too..
    Suhel

  • Displaying HTML code/document within a SIEBEL applet

    Dear All,
    I have a new requirement which is to integrate an external html document/code within a Siebel's applet in my Home Screen/View. This HTML code is DYNAMIC and it will change depending the user connected. It will give general informations.
    I tried to use a new calculated field in the relevant BC then I added it as control (HTML Type = Field - HTML Display Mode = DontEncodeData - Runtime = Y - Visible = Y) within the applet.
    Unfortunately the field property 'Calculated Value' is restricted to 255 caracters. Everything is fine when the HTML code length is less than 255. When it is greater because teh HTML code is more complex, I can not add a calculated field and the associate control due to the limitation (255 caracters).
    Any idea would be greatly appreciate.
    Thanks a lot.

    One way to get around this limit is to do the following. Split the information you need into several calculated fields and then add them together in one.
    Calculated Display Field = [Information Block 1] + [Information Block 2] + .....
    Where [Information Block n] is a calculated field too.
    Depending on the amount of data and where you need to display the field i.e. form/list applet
    you could use InvokeServiceMethod in a calculated field. Have a look here:
    http://download.oracle.com/docs/cd/B40099_02/books/ToolsDevRef/ToolsDevRef_Operators8.html
    Axel

  • SharePoint 2013 Document Library template displays html code when creating a new document from a sharepoint list multiline rich text

    I have a 2010 work flow that is associated with a sharepoint 2013 list that creates a new list document using a custom Microsoft Word 2013 template with a rich text multiline field quick part.  The workflow creates the document and populates
    the the quickpart, however, the text in the document is showing html codes
    <div class="ExternalClass2116495984EB429D95B02CC15F85FD4C"><h1>ABC123</h1><h2>Test&#58; 1234</h2></div>
    and not as 
    ABC123
    Test: 1234
    Is there a no code solution for this?

    Hi,
    I have done a test and I can reproduced your issue.
    I referred to the blog about Automatically create Word documents which include list fields:
    http://blogs.technet.com/b/brenclarke/archive/2009/04/15/automatically-create-word-documents-which-include-list-fields.aspx
    When I create a multiple line of text column in a list, I just choose Plain text, Then I solved the issue:
    Besides, here is a similar post, you can take a look at:
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/a7ab3a61-6643-4a47-a464-fe46b5db1558/rich-text-field-showing-html-code
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • Display HTML code in Crystal Reports

    We have a field in the database in which the data is encoded HTML, it includes links to images.  I have tried to use the RTF/HTML interpretation option for the field but it doesn't work.  I saw on the other thread that there's limitation to displaying HTML - I am using Cyrstal Reports XI.  So the crysal can't understand img tags correct?  I am allowing users to do just about anything with HTML so it's hard to find a workaround if the we have to limit the tags.  Would this issue be fixed in the future?  Any piece of advice how to handle this would be great!
    Thanks.

    Hi Pizzaz,
    The HTML tags that are supported by Crystal Reports are:
    " html
    " body
    " div (causes a paragraph break)
    " tr (causes only a paragraph break; does not
    preserve column structure of a table)
    " span
    " font
    " p (causes a paragraph break)
    " br (causes a paragraph break)
    " h1 (causes a paragraph break, makes the font bold
    & twice default size)
    " h2 (causes a paragraph break, makes the font bold
    & 1.5 times default size)
    " h3 (causes a paragraph break, makes the font bold
    & 9/8 default size)
    " h4 (causes a paragraph break, makes the font bold)
    " h5 (causes a paragraph break, makes the font bold
    & 5/6 default size)
    " h6 (causes a paragraph break, makes the font bold
    & 5/8 default size)
    " center
    " big (increases font size by 2 points)
    " small (decreases font size by 2 points if it's 8
    points or larger)
    " b
    " i
    " s
    " strike
    " u
    And the supported HTML attributes are:
    " align
    " face
    " size
    " color
    " style
    " font-family
    " font-size
    " font-style
    " font-weight
    Hope this helps you!
    Regards,
    Anindita

  • Displaying HTML Code

    Hi,
    is it possible to display HTML in a webdynpro application (without using iframe), e.g. I read HTML from database
    <b>bold text</b>
    then
    bold text should displayed in my WD4A.
    Best Regards,
    Marcel

    Hi Marcel,
    I think iFrame UI element should not be used anymore, but nevertheless, since iFrame seems to be the alternative for you at the moment, here is what you can do.
    First of all, are you creating the iFrame dynamically? Or are you creating it in the layout itself? iFrame has a property - 'source'. You need to create a context node with an attribute of type STRING. You can bind this attribute to the 'source' property of the iFrame. If you are creating it in the layout as an UI element, directly bind it to the 'source' property of the iFrame UI element. If you are dynamically creating it, then use the BIND_SOURCE method of class CL_WD_IFRAME to define the binding.
    You could also refer to the [WDP documentation|http://help.sap.com/saphelp_nw70/helpdata/EN/15/c07941601b1d09e10000000a155106/frameset.htm].
    I hope I understood your problem correctly, and was able to provide some insight on the solution.
    Regards,
    Wenonah

  • How to display html code in posts?

    I thought it was < code> and < /code> to show the actual html.

    No.
    Not looking to do a link.
    I want to show the actual htlm code on the screen.
    I want to display this;
    is this working
    but in order for me to do it, I had to put a space after the "<"http://discussions.apple.com/thread.jspa?threadID=649518&tstart=0">is this working

  • How to display html code in diplaytag field?

    Hi all,
    I have a html text that needs to be displayed in a table. I build the dynamic table using display tag library. I tried using TableDecorator. But I dont want to build the message on the fly when jsp is opened, instead I want to display the text which is already stored in database as preformatted html text. Can I able to do this, without using any decorator class. Do I need to set any attribute value to achieve this. Any help is appreciated.
    Thanks

    No.
    Not looking to do a link.
    I want to show the actual htlm code on the screen.
    I want to display this;
    is this working
    but in order for me to do it, I had to put a space after the "<"http://discussions.apple.com/thread.jspa?threadID=649518&tstart=0">is this working

  • Discussion postings display HTML code in Outlook

    When using a discussion list connected to Outlook (2010), posts will show HTML tags in Outlook (see screenshot). According to a different thread this may be caused by additional columns added to the discussion list.
    I would like to understand if adding additional columns is not supported in SharePoint 2010 in combination with the 'connect to Outlook' option. Since the other thread is related to Office 365 and because it seems closed, I am posting this question here.
    The below post in SharePoint consist of simply the word "test", typed, not copied.

    Hi jeroen,
    Did this happen to all lists with rich text type column when they connect to outlook 2010?
    Did this happen to all users with outlook 2010 on their client PCs?
    I think you can create a new discussion board list, see if it could work.
    Also check if your outlook 2010 message default format is set as HTML, check results again.
    http://office.microsoft.com/en-us/outlook-help/change-the-message-format-to-html-rich-text-or-plain-text-HA101992313.aspx#_Toc269980629
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] 
    Daniel Yang
    TechNet Community Support

  • Display HTML code in TextView

    Helo everybody,
                     I wanna apply <marquee> tag in WebDynpro View.....
    what i did:
    1. Created Attribute with STRING type,
    2. bound to FormattedTextView UI element.
    3. set value as '<html><body><marquee> my message </marquee></body></html>'.
    when i run this, it is showing '<html> tag is not allowed'.
    any other possible ways.. Please describe be clearly i.e step by step process.
    Moderator message: this is the wrong forum, please have a look in the "Web Dynpro ABAP" forum.
    Edited by: Thomas Zloch on Jun 6, 2011 9:30 AM

    Helo everybody,
                     I wanna apply <marquee> tag in WebDynpro View.....
    what i did:
    1. Created Attribute with STRING type,
    2. bound to FormattedTextView UI element.
    3. set value as '<html><body><marquee> my message </marquee></body></html>'.
    when i run this, it is showing '<html> tag is not allowed'.
    any other possible ways.. Please describe be clearly i.e step by step process.
    Moderator message: this is the wrong forum, please have a look in the "Web Dynpro ABAP" forum.
    Edited by: Thomas Zloch on Jun 6, 2011 9:30 AM

  • Display HTML stored in a table

    Hello,
    I want to display HTML Code which is stored in a table.
    Now I have a display as text item and there the HTML is not rendered properly...
    So what must i do to show the HTML Code properly?
    What kind of item should I use?
    Thank you,
    Tim

    Thank you Carsten,
    I had the wrong Item.
    I used "display as text (saves state)"....
    Regards,
    Tim

  • Display HTML Tags on web browser

    My problem is display Html code in web browser.
    i try TextArea.htmlText, Label.htmlText... but they don't
    work...
    i'm searching in google.com and i know Html Component can do
    that, but it not well because i don't have money for that.
    Some body help me for my problem.
    Thanks so much. !
    nice day every body.

    The htmlText property should work however only a few basic
    html tags are supported as far as I know.

  • How to print html code in sap

    Hi gurus
    my requirement is to display html code in sap. in transaction o12c i am giving the html code in longtext , i want to display in co60 transaction . now when i am going to co60 it is taking as textfile instead of html.Plz give a solution
    thanks
    vivek

    Hi Vivek,
    You can take reference of BCALV_DEMO_HTML  this program.
    Regards,
    Pravin

Maybe you are looking for