tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 
 Tools and Libs > Open Symphony Core > HTML Encode

HTML Encode 

OSCore (Open Symphony Core) is a java library with lot of utilities and reusable components. This requires the libraries oscore-2.2.6.jar, mail.jar to be in classpath. The following example shows using TextUtils.htmlEncode() API.

File Name  :  
com/bethecoder/tutorials/oscore/HtmlEncodeTest.java 
Author  :  Sudhakar KV
Email  :  kvenkatasudhakar@gmail.com
   
package com.bethecoder.tutorials.oscore;

import com.opensymphony.util.TextUtils;

public class HtmlEncodeTest {

  /**
   @param args
   */
  public static void main(String[] args) {

    String html = "<html><body>ABC & DEF</body></html>";
    String encHtml = TextUtils.htmlEncode(html);
    System.out.println(encHtml);
  }

}
   

It gives the following output,
&lt;html&gt;&lt;body&gt;ABC &amp; DEF&lt;/body&gt;&lt;/html&gt;


                    Print

   



Books Recommendation

 
 
bl  br