<?xml version="1.0"?><rss version="2.0">
<channel>
  <title>Java Beans dot Asia - java category</title>
  <link>http://javabeans.asia/categories/java/</link>
  <description>Just a few simple tutorials</description>
  <language>en</language>
  <copyright>Alexander Zagniotov</copyright>
  <lastBuildDate>Tue, 23 Feb 2010 11:04:00 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  <image>
    <url>/images/blog-image.jpg</url>
    <title>Java Beans dot Asia (java category)</title>
    <link>http://javabeans.asia/</link>
  </image>
  <item>
    <title>Generate PDF with Flying Saucer and iText by adding font files</title>
    <link>http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html</link>
	 <description>
        In this post, I would like to show how to load font files and format specific sections of the document at run time, when generating PDF document using &lt;a target=&#034;_blank&#034; title=&#034;XML/XHTML/CSS 2.1 Renderer&#034; href=&#034;https://xhtmlrenderer.dev.java.net/&#034;&gt;Flying Saucer&lt;/a&gt; and &lt;a target=&#034;_blank&#034; title=&#034;iText - Free Java-PDF library&#034; href=&#034;http://www.lowagie.com/iText/&#034;&gt;iText&lt;/a&gt; libraries.&lt;br /&gt;
&lt;br /&gt;
I will create a String that has a structure of valid XHTML file. The content of String is what going to be generated as a PDF document. &lt;a href=&#034;https://xhtmlrenderer.dev.java.net/&#034; title=&#034;XML/XHTML/CSS 2.1 Renderer&#034; target=&#034;_blank&#034;&gt;Flying Saucer&lt;/a&gt; knows how to render XHTML. Before generating the PDF, I will load a font file for future formatting. Once the font file is loaded, I will retrieve the font family and will apply it as a formatting style to the selected paragraph of my future PDF document.&lt;br /&gt;
&lt;pre name=&#034;code&#034; class=&#034;java:firstline[1]&#034;&gt;import java.io.*;&lt;br /&gt;import com.lowagie.text.pdf.*;&lt;br /&gt;import org.xhtmlrenderer.pdf.*;&lt;br /&gt;&lt;br /&gt;public class TestFont {&lt;br /&gt;  public static void main(String[] args) {&lt;br /&gt;   try  {&lt;br /&gt;       ITextRenderer renderer = &lt;br /&gt;                         new ITextRenderer();&lt;br /&gt;       File fontDir = &lt;br /&gt;          new File(SOME_ABSOLUTE_PATH_TO_YOUR_FONT_DIR);&lt;br /&gt;&lt;br /&gt;       //Build valid XHTML source for parsing&lt;br /&gt;       StringBuffer buf = new StringBuffer();&lt;br /&gt;       buf.append(&amp;quot;&amp;lt;html&amp;gt;&amp;quot;);&lt;br /&gt;       buf.append(&amp;quot;&amp;lt;head&amp;gt;&amp;quot;);&lt;br /&gt;       buf.append(&amp;quot;&amp;lt;/head&amp;gt;&amp;quot;);&lt;br /&gt;       buf.append(&amp;quot;&amp;lt;body&amp;gt;&amp;quot;);&lt;br /&gt;&lt;br /&gt;       String body = &lt;br /&gt;            &amp;quot;This is formatted paragraph&amp;quot;;&lt;br /&gt;&lt;br /&gt;       //Gets TTF or OTF font file from &lt;br /&gt;       //the font directory&lt;br /&gt;       if (fontDir.isDirectory()) {&lt;br /&gt;&lt;br /&gt;         //Only add fonts with specific extensions&lt;br /&gt;         File[] files = fontDir.listFiles(&lt;br /&gt;                          new FilenameFilter() {&lt;br /&gt;             public boolean accept(File dir, &lt;br /&gt;                                   String name) {&lt;br /&gt;             String lower = name.toLowerCase();&lt;br /&gt;&lt;br /&gt;             //Load TTF or OTF files&lt;br /&gt;             return lower.endsWith(&amp;quot;.otf&amp;quot;) || &lt;br /&gt;                         lower.endsWith(&amp;quot;.ttf&amp;quot;);&lt;br /&gt;              }&lt;br /&gt;            });&lt;br /&gt;&lt;br /&gt;        if (files.length &amp;gt; 0) {&lt;br /&gt;           String fontFamilyName = &amp;quot;&amp;quot;;&lt;br /&gt;           //You should always embed TrueType fonts.&lt;br /&gt;            renderer.getFontResolver().&lt;br /&gt;               addFont(files[0].&lt;br /&gt;                  getAbsolutePath(), &lt;br /&gt;                      BaseFont.IDENTITY_H, &lt;br /&gt;                         BaseFont.EMBEDDED);&lt;br /&gt;&lt;br /&gt;          //Get font family name from the BaseFont object.&lt;br /&gt;          //All this work just to get font family name&lt;br /&gt;          BaseFont font = &lt;br /&gt;                BaseFont.createFont(files[0].&lt;br /&gt;                              getAbsolutePath(), &lt;br /&gt;                                BaseFont.IDENTITY_H , &lt;br /&gt;                                   BaseFont.NOT_EMBEDDED);&lt;br /&gt;          fontFamilyName = TrueTypeUtil.&lt;br /&gt;                                    getFamilyName(font);&lt;br /&gt;&lt;br /&gt;          if (!fontFamilyName.equals(&amp;quot;&amp;quot;)) {&lt;br /&gt;          //Wrap DIV with font family name &lt;br /&gt;          //around the content&lt;br /&gt;          body = &amp;quot;&amp;lt;div style=\&amp;quot;font-family: &amp;quot; + &lt;br /&gt;             fontFamilyName + &amp;quot;;\&amp;quot;&amp;gt;&amp;quot; + body + &amp;quot;&amp;lt;/div&amp;gt;&amp;quot;;&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;       buf.append(&amp;quot;&amp;lt;p&amp;gt;This paragraph is unformatted&amp;lt;/p&amp;gt;&amp;quot;);&lt;br /&gt;       buf.append(&amp;quot;&amp;lt;p&amp;gt;&amp;quot; + body + &amp;quot;&amp;lt;/p&amp;gt;&amp;quot;);&lt;br /&gt;       buf.append(&amp;quot;&amp;lt;/body&amp;gt;&amp;quot;);&lt;br /&gt;       buf.append(&amp;quot;&amp;lt;/html&amp;gt;&amp;quot;);&lt;br /&gt;&lt;br /&gt;       byte[] bytes = buf.toString().getBytes(&amp;quot;UTF-8&amp;quot;);&lt;br /&gt;&lt;br /&gt;       ByteArrayInputStream bais = &lt;br /&gt;                   new ByteArrayInputStream(bytes);&lt;br /&gt;       DocumentBuilder builder = &lt;br /&gt;                  DocumentBuilderFactory.newInstance().&lt;br /&gt;                             newDocumentBuilder();&lt;br /&gt;       InputSource is = new InputSource(bais);&lt;br /&gt;       Document doc = builder.parse(is);&lt;br /&gt;&lt;br /&gt;       renderer.setDocument(doc, null);&lt;br /&gt;       renderer.layout();&lt;br /&gt;&lt;br /&gt;       String filename = &amp;quot;document.pdf&amp;quot;;&lt;br /&gt;       BufferedOutputStream bufferedOutput = &lt;br /&gt;              new BufferedOutputStream(&lt;br /&gt;                       new FileOutputStream(filename));&lt;br /&gt;&lt;br /&gt;       renderer.createPDF(bufferedOutput);&lt;br /&gt;       bufferedOutput.flush();&lt;br /&gt;       bufferedOutput.close();&lt;br /&gt;   }&lt;br /&gt;   catch (Exception e)&lt;br /&gt;   {&lt;br /&gt;       System.out.println(e.getMessage());&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
I hope by looking at the source code, the concept of how to add fonts and retrieve font family was clear.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Alex&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;t=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;t=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&#034; rel=&#034;bookmark&#034; title=&#034;Export Pebble Blog Entry to PDF Plugin&#034;&gt;Export Pebble Blog Entry to PDF Plugin&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/11/online_pdf_generator.html&#034; rel=&#034;bookmark&#034; title=&#034;Online PDF Generator&#034;&gt;Online PDF Generator&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/03/22/export_to_pdf_using_itext_java_pdf_library.html&#034; rel=&#034;bookmark&#034; title=&#034;Export to PDF using iText Java-PDF library&#034;&gt;Export to PDF using iText Java-PDF library&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&#034; rel=&#034;bookmark&#034; title=&#034;Export to PDF using iText and Flying Saucer&#034;&gt;Export to PDF using iText and Flying Saucer&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          In this post, I would like to show how to load font files and format specific sections of the document at run time, when generating PDF document using Flying Saucer and iText libraries.  I will create a String that has a structure of valid XHTML file. The content of String is what going to be generated as a PDF ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;t=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;title=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&amp;amp;t=Generate PDF with Flying Saucer and iText by adding font files&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>java</category>
    <comments>http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html</guid>
    <pubDate>Tue, 23 Feb 2010 11:04:00 GMT</pubDate>
  </item>
  <item>
    <title>Redefining web applications with AJAX, Servlets and JSON</title>
    <link>http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html</link>
	 <description>
        In this article I would like to show how JSON (JavaScript Object Notation) and Java servlet can be used together in a little AJAX (Asynchronous JavaScript and XML) application. &lt;br /&gt;
&lt;br /&gt;
To give brief description to those who are not closely familiar with JSON - &lt;br /&gt;
JSON is a lightweight syntax for representing data, which makes working with it much more pleasant than with XML and makes AJAX applications faster. Also, when working with JSON, there is no need for an XML parsing.&lt;br /&gt;
&lt;br /&gt;
In the following example, I am going to create a callback servlet that fetches and parses an RSS feed. Then the parsed feed data is passed to the client side in a form of JSON. The data then formatted and presented to the user. The client uses AJAX call to query the servlet.&lt;br /&gt;
&lt;br /&gt;
For this application, I used three third-party libraries:&lt;br /&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;strong&gt;JSON library&lt;/strong&gt; provided by &lt;a title=&#034;JSON&#034; target=&#034;_new&#034; href=&#034;http://json.org/java/&#034; onclick=&#034;javascript:pageTracker._trackPageview(&#039;/outbound/article/json.org&#039;);&#034; rel=&#034;nofollow&#034;&gt;JSON.org&lt;/a&gt; and extended by &lt;a target=&#034;_blank&#034; href=&#034;http://oss.metaparadigm.com/jsonrpc/index.html&#034;&gt;JSON-RPC-Java&lt;/a&gt; which allows to create and easily parse JSON data through Java code. This library can run in a Servlet container such as Tomcat, JBoss and other J2EE Application servers.&lt;/li&gt;
    &lt;li&gt;&lt;a href=&#034;https://rome.dev.java.net/&#034; target=&#034;_blank&#034; title=&#034;Project ROME&#034;&gt;Project ROME&lt;/a&gt;&lt;br /&gt;
    ROME is an set of open source Java tools for parsing, generating and publishing RSS and Atom feeds.&lt;/li&gt;
    &lt;li&gt;&lt;a href=&#034;http://jdom.org&#034; target=&#034;_blank&#034; title=&#034;JDOM XML parser&#034;&gt;JDOM XML parser&lt;/a&gt;&lt;br /&gt;
    JDOM is a Java-based &amp;quot;document object model&amp;quot; for XML files. JDOM serves the same purpose as DOM, but is easier to use&lt;/li&gt;
&lt;/ol&gt;
The libraries are included in the source code which accompanies this article. This application example is also included as a &lt;a href=&#034;http://javabeans.asia/files/src/json_servlets_ajax_war.zip&#034; title=&#034;WAR archive&#034;&gt;WAR&lt;/a&gt; archive, ready to be deployed on Tomcat.&lt;br /&gt;
&lt;br /&gt;
The following is my servlet implementation. The servlet fetches and parses feed data. The JSON library mentioned previously allows me easily to create and populate JSON object.&lt;br /&gt;
&lt;pre class=&#034;java&#034; name=&#034;code&#034;&gt;package asia.javabeans.json;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.net.MalformedURLException;&lt;br /&gt;import java.net.URL;&lt;br /&gt;import java.util.List;&lt;br /&gt;&lt;br /&gt;import javax.servlet.ServletConfig;&lt;br /&gt;import javax.servlet.ServletException;&lt;br /&gt;import javax.servlet.http.HttpServlet;&lt;br /&gt;import javax.servlet.http.HttpServletRequest;&lt;br /&gt;import javax.servlet.http.HttpServletResponse;&lt;br /&gt;&lt;br /&gt;import org.json.JSONArray;&lt;br /&gt;import org.json.JSONObject;&lt;br /&gt;&lt;br /&gt;import com.sun.syndication.feed.synd.SyndEntry;&lt;br /&gt;import com.sun.syndication.feed.synd.SyndFeed;&lt;br /&gt;import com.sun.syndication.fetcher.FeedFetcher;&lt;br /&gt;import com.sun.syndication.fetcher.FetcherException;&lt;br /&gt;import com.sun.syndication.fetcher.impl.FeedFetcherCache;&lt;br /&gt;import &lt;br /&gt;com.sun.syndication.fetcher.impl.HashMapFeedInfoCache;&lt;br /&gt;import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;&lt;br /&gt;import com.sun.syndication.io.FeedException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * @author Alexander Zagniotov (http://javabeans.asia)&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt;public class JsonServlet extends HttpServlet {&lt;br /&gt;&lt;br /&gt;private static final long serialVersionUID = 1L;&lt;br /&gt;private static final String BLOG_URL = &lt;br /&gt;		&amp;quot;http://javabeans.asia/rss.xml&amp;quot;;&lt;br /&gt;private static final String CONTENT_TYPE = &lt;br /&gt;			&amp;quot;application/json&amp;quot;;&lt;br /&gt;private FeedFetcherCache feedInfoCache = null;&lt;br /&gt;private FeedFetcher feedFetcher = null;&lt;br /&gt;&lt;br /&gt;public void init(ServletConfig config) &lt;br /&gt;			throws ServletException {&lt;br /&gt;	super.init(config);&lt;br /&gt;&lt;br /&gt;	feedInfoCache = &lt;br /&gt;		HashMapFeedInfoCache.getInstance();&lt;br /&gt;	feedFetcher = &lt;br /&gt;		new HttpURLFeedFetcher(feedInfoCache);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void doGet(HttpServletRequest request, &lt;br /&gt;			HttpServletResponse response)&lt;br /&gt;		throws ServletException, IOException {&lt;br /&gt;&lt;br /&gt;	SyndFeed feed = this.feedFethcer(BLOG_URL);&lt;br /&gt;&lt;br /&gt;  if (feed != null) {&lt;br /&gt;	String json = this.feedToJSON(feed);&lt;br /&gt;	response.setContentType(CONTENT_TYPE);&lt;br /&gt;	response.setHeader(&amp;quot;Cache-Control&amp;quot;, &amp;quot;no-cache&amp;quot;);&lt;br /&gt;	response.getWriter().write(json);&lt;br /&gt;  } &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private SyndFeed feedFethcer(String url) {&lt;br /&gt;	SyndFeed feed = null;&lt;br /&gt;	try {&lt;br /&gt;		feed = feedFetcher.retrieveFeed(&lt;br /&gt;		new URL(BLOG_URL));&lt;br /&gt;	} catch (IllegalArgumentException e) {&lt;br /&gt;		e.printStackTrace();&lt;br /&gt;	} catch (FeedException e) {&lt;br /&gt;		e.printStackTrace();&lt;br /&gt;	} catch (FetcherException e) {&lt;br /&gt;		e.printStackTrace();&lt;br /&gt;	} catch (MalformedURLException e) {&lt;br /&gt;		e.printStackTrace();&lt;br /&gt;	} catch (IOException e) {&lt;br /&gt;		e.printStackTrace();&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	return feed;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private String feedToJSON(SyndFeed feed) {&lt;br /&gt;&lt;br /&gt;	JSONObject jsonObj = new JSONObject();&lt;br /&gt;	JSONArray jsonEntryTitles = new JSONArray();&lt;br /&gt;&lt;br /&gt;	jsonObj.put(&amp;quot;blogtitle&amp;quot;, feed.getTitle());&lt;br /&gt;	jsonObj.put(&amp;quot;blogdescription&amp;quot;, feed.getDescription());&lt;br /&gt;	jsonObj.put(&amp;quot;bloglanguage&amp;quot;, feed.getLanguage());&lt;br /&gt;	jsonObj.put(&amp;quot;bloglink&amp;quot;, feed.getLink());&lt;br /&gt;	jsonObj.put(&amp;quot;author&amp;quot;, feed.getCopyright());&lt;br /&gt;&lt;br /&gt;	List&amp;lt;?&amp;gt; feedEntries = feed.getEntries();&lt;br /&gt;&lt;br /&gt;	for (Object c : feedEntries) {&lt;br /&gt;	     SyndEntry syndicateEntry = (SyndEntry) c;&lt;br /&gt;	     jsonEntryTitles.put(syndicateEntry.getTitle());&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	jsonObj.put(&amp;quot;blogentrytitles&amp;quot;, jsonEntryTitles);&lt;br /&gt;	return jsonObj.toString();&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
As you can see it is very easy to construct JSON objects and arrays on the server side and pass them to the client. For the purpose of this example I am getting my data from RSS feed, but the data can also be coming from DB etc. &lt;br /&gt;
&lt;br /&gt;
The following is my client implementation. The client queries the servlet using AJAX call. When an AJAX call returns a response from the servlet in a form of JSON object, the object data is formatted and information about the RSS feed is presented to the client:&lt;br /&gt;
&lt;pre class=&#034;java&#034; name=&#034;code&#034;&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;title&amp;gt;Java Beans dot Asia&amp;lt;/title&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script language=&amp;quot;JavaScript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;		&lt;br /&gt;	var httpRequest = null;&lt;br /&gt;	&lt;br /&gt;function getDescriptionAsJSON() {&lt;br /&gt;&lt;br /&gt;	var description = &lt;br /&gt;		document.getElementById(&#039;description&#039;);&lt;br /&gt;	description.innerHTML = &amp;quot;Loading, please wait ...&amp;quot;;&lt;br /&gt;&lt;br /&gt;	var url = &amp;quot;http://localhost:8080/json/json&amp;quot;;&lt;br /&gt;	if(window.XMLHttpRequest){&lt;br /&gt;		httpRequest = new XMLHttpRequest();&lt;br /&gt;	}&lt;br /&gt;	else if(window.ActiveXObject){&lt;br /&gt;		httpRequest = &lt;br /&gt;			new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;);&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	httpRequest.open(&amp;quot;GET&amp;quot;, url, true);&lt;br /&gt;	httpRequest.onreadystatechange = handler;&lt;br /&gt;	httpRequest.send(null);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function handler() {&lt;br /&gt;	if (httpRequest.readyState == 4) {&lt;br /&gt;		if (httpRequest.status == 200) {&lt;br /&gt;		    processJSON(httpRequest.responseText);&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function processJSON(jsonObjectString) {&lt;br /&gt;&lt;br /&gt;	var description = &lt;br /&gt;		document.getElementById(&#039;description&#039;);&lt;br /&gt;	&lt;br /&gt;      //Since JSON is a subset of JavaScript, I am using &lt;br /&gt;      //JavaScript&#039;s own compiler to parse JSON in one line!&lt;br /&gt;      var jsonObject = eval(&#039;(&#039; + jsonObjectString + &#039;)&#039;)&lt;br /&gt;&lt;br /&gt;	var text = &amp;quot;&amp;quot;;&lt;br /&gt;	&lt;br /&gt;	text += &amp;quot;Author: &amp;quot; + jsonObject.author + &amp;quot;&amp;lt; br /&amp;gt;&amp;quot;;&lt;br /&gt;	text += &amp;quot;Blog Name: &amp;quot; + &lt;br /&gt;		jsonObject.blogtitle + &amp;quot;&amp;lt; br /&amp;gt;&amp;quot;;&lt;br /&gt;	text += &amp;quot;Blog URL: &amp;quot; + &lt;br /&gt;		jsonObject.bloglink + &amp;quot;&amp;lt; br /&amp;gt;&amp;quot;;&lt;br /&gt;	text += &amp;quot;Blog Description: &amp;quot; + &lt;br /&gt;		jsonObject.blogdescription + &amp;quot;&amp;lt; br /&amp;gt;&amp;quot;;&lt;br /&gt;	text += &amp;quot;Blog Language: &amp;quot; + &lt;br /&gt;		jsonObject.bloglanguage + &amp;quot;&amp;lt; br /&amp;gt;&amp;quot;;&lt;br /&gt;	&lt;br /&gt;	description.innerHTML = text;&lt;br /&gt;	var entries = &amp;quot;Last &amp;quot; + &lt;br /&gt;                  jsonObject.blogentrytitles.length &lt;br /&gt;	+ &amp;quot; blog entries are:\n\n&amp;quot;;&lt;br /&gt;&lt;br /&gt;	for (var index = 0; &lt;br /&gt;		index &amp;lt; jsonObject.blogentrytitles.length; &lt;br /&gt;							index ++) {&lt;br /&gt;		entries += (index + 1) + &amp;quot;: &amp;quot; + &lt;br /&gt;			jsonObject.blogentrytitles[index] + &amp;quot;\n&amp;quot;;&lt;br /&gt;	} &lt;br /&gt;	alert(entries);&lt;br /&gt;}&lt;br /&gt;	&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;img src=&amp;quot;images/javabeansmugshot_120x120.jpg&amp;quot; border=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt; br /&amp;gt;&lt;br /&gt;&amp;lt; br /&amp;gt;&lt;br /&gt;&amp;lt;div id=&amp;quot;description&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt; br /&amp;gt;&lt;br /&gt;&amp;lt; br /&amp;gt;&lt;br /&gt;&amp;lt;a href=&amp;quot;javascript:void(0)&amp;quot; &lt;br /&gt;             onclick=&amp;quot;return getDescriptionAsJSON();&amp;quot;&amp;gt;&lt;br /&gt;Click to get description!&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;
As you could see, JSON data can be easily parsed on the client side with the help of Java script &lt;em&gt;eval()&lt;/em&gt; function. To remind - JSON is a subset of Java script, therefore&lt;em&gt; eval()&lt;/em&gt; will produce a valid object. &lt;br /&gt;
&lt;br /&gt;
Keep in mind, that there is a need for extra care when using &lt;em&gt;eval&lt;/em&gt;. The problem is that &lt;em&gt;eval&lt;/em&gt; will compile and execute Java script code that coming back from the response. This could cause a security risk if the response data is coming from an untrusted source.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. I hope this example was clear and helpful :)&lt;br /&gt;
&lt;a href=&#034;http://javabeans.asia/files/src/json_servlets_ajax_war.zip&#034; title=&#034;WAR archive&#034;&gt; &lt;/a&gt;&lt;a href=&#034;http://javabeans.asia/files/src/json_servlets_ajax_war.zip&#034; title=&#034;WAR archive&#034;&gt; &lt;/a&gt;&lt;br /&gt;
Please note that this example was tested by me and its working fine. The source code as mentioned previously is included  as Eclipse project. You can simply create a new Java project from the existing Ant build.xml file. &lt;br /&gt;
&lt;br /&gt;
Comments/flames are appreciated :)&lt;br /&gt;
&lt;br /&gt;
Cheers&lt;br /&gt;
&lt;a href=&#034;http://javabeans.asia/files/src/json_servlets_ajax_war.zip&#034; title=&#034;WAR archive&#034;&gt; &lt;/a&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;t=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;t=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;i&gt;There are no related posts for this blog entry&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          In this article I would like to show how JSON (JavaScript Object Notation) and Java servlet can be used together in a little AJAX (Asynchronous JavaScript and XML) application.   To give brief description to those who are not closely familiar with JSON -  JSON is a lightweight syntax for representing data, which ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;t=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;title=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html&amp;amp;t=Redefining web applications with AJAX, Servlets and JSON&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <enclosure url="http://javabeans.asia/files/src/json_servlets_ajax_src.zip" length="471648" type="application/zip;charset=ISO-8859-1" />
    <category>ajax</category>
    <category>java</category>
    <category>json</category>
    <category>servlets</category>
    <category>xml</category>
    <category>javascript</category>
    <comments>http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2009/09/13/redefining_web_applications_with_ajax_servlets_and_json.html</guid>
    <pubDate>Sun, 13 Sep 2009 04:00:00 GMT</pubDate>
  </item>
  <item>
    <title>Rule Engine Stress Testing</title>
    <link>http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html</link>
	 <description>
        I came across a &lt;a target=&#034;_blank&#034; title=&#034;Illation Blog&#034; href=&#034;http://blogs.illation.com.au/&#034;&gt;blog&lt;/a&gt; by a company called &lt;a target=&#034;_blank&#034; title=&#034;Illation&#034; href=&#034;http://illation.com.au&#034;&gt;Illation&lt;/a&gt;. What those guys do is compare performance of several rule engines available on the market: Drools, ILog, OPSJ and Jess.&lt;br /&gt;
&lt;br /&gt;
The stress tests cover different aspects, for example:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Rules firing time&lt;/li&gt;
    &lt;li&gt;Data load time&lt;/li&gt;
    &lt;li&gt;Memory usage&lt;/li&gt;
    &lt;li&gt;Pre-run memory used&lt;/li&gt;
    &lt;li&gt;Post-run memory used&lt;/li&gt;
&lt;/ul&gt;
The test results available  on their blog for the wide public. The team also makes business rules, object model and datasets used in their stress tests available for download if someone wishes to repeat the tests. Some of the results look very interesting.&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;t=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;t=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/09/01/drools_5_case_study_2_complex_event_processing.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools 5 Case Study 2 - Complex Event Processing&#034;&gt;Drools 5 Case Study 2 - Complex Event Processing&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser Drools: Testing Objects&#034;&gt;Brainteaser Drools: Testing Objects&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/23/feedback_by_the_drools_team.html&#034; rel=&#034;bookmark&#034; title=&#034;Feedback by the Drools Team&#034;&gt;Feedback by the Drools Team&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/29/drools_5_case_study_1_writing_dsl_for_drl_rule.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools 5 Case Study 1- Writing DSL for DRL rule&#034;&gt;Drools 5 Case Study 1- Writing DSL for DRL rule&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/31/drools_5_complex_event_processing.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools 5 - Complex Event Processing&#034;&gt;Drools 5 - Complex Event Processing&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/24/drools_tutorial_on_writing_dsl_template.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - tutorial on writing DSL template&#034;&gt;Drools - tutorial on writing DSL template&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/06/09/drools_stop_executing_current_agenda_group_and_all_rules.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - Stop executing current agenda group and all rules&#034;&gt;Drools - Stop executing current agenda group and all rules&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/05/11/drools_working_with_stateless_session.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools - working with Stateless session&#034;&gt;Drools - working with Stateless session&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          I came across a blog by a company called Illation. What those guys do is compare performance of several rule engines available on the market: Drools, ILog, OPSJ and Jess.  The stress tests cover different aspects, for example:      Rules firing time     Data load time     Memory usage     Pre-run memory used     ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;t=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;title=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&amp;amp;t=Rule Engine Stress Testing&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>java</category>
    <category>drools</category>
    <comments>http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html</guid>
    <pubDate>Sat, 05 Sep 2009 01:15:00 GMT</pubDate>
  </item>
  <item>
    <title>Brainteaser Drools: Testing Objects</title>
    <link>http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html</link>
	 <description>
        This can be a hard one, since it requires from you to be familiar with Drools.&lt;br /&gt;
&lt;br /&gt;
Consider the condition side of the following rules:&lt;br /&gt;
&lt;pre class=&#034;java&#034; name=&#034;code&#034;&gt;rule &amp;quot;object comparison one&amp;quot;&lt;br /&gt;&amp;nbsp;no-loop&lt;br /&gt;&amp;nbsp; when&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer1 : Customer( )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer2 : Customer(this != $customer1)&lt;br /&gt;&amp;nbsp; then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;Rule one - Objects are equal&amp;quot;);&lt;br /&gt;end &lt;/pre&gt;
&lt;pre class=&#034;java&#034; name=&#034;code&#034;&gt;rule &amp;quot;object comparison two&amp;quot;&lt;br /&gt;&amp;nbsp;no-loop&lt;br /&gt;&amp;nbsp; when&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer1 : Customer( )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer2 : Customer(eval(this != $customer1))&lt;br /&gt;&amp;nbsp; then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;Rule two - Objects are equal&amp;quot;);&lt;br /&gt;end &lt;/pre&gt;
&lt;strong&gt;Question(s)&lt;/strong&gt;:&lt;br /&gt;
Which of the two rules does valid comparison of the two Customer instances? &lt;br /&gt;
Which of the two rules is invalid? Why?&lt;br /&gt;
&lt;br /&gt;
Looking forward for your answers dear readers&lt;br /&gt;
&lt;br /&gt;
Resources:&lt;br /&gt;
&lt;em&gt;&lt;a href=&#034;http://www.packtpub.com/drools-jboss-rules-5-0-developers-guide/book&#034; target=&#034;_blank&#034;&gt;Drools JBoss Rules 5.0 Developer&#039;s Guide July 2009&lt;/a&gt;&lt;/em&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;t=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;t=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/09/01/drools_5_case_study_2_complex_event_processing.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools 5 Case Study 2 - Complex Event Processing&#034;&gt;Drools 5 Case Study 2 - Complex Event Processing&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/09/05/rule_engine_stress_testing.html&#034; rel=&#034;bookmark&#034; title=&#034;Rule Engine Stress Testing&#034;&gt;Rule Engine Stress Testing&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/23/feedback_by_the_drools_team.html&#034; rel=&#034;bookmark&#034; title=&#034;Feedback by the Drools Team&#034;&gt;Feedback by the Drools Team&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/29/drools_5_case_study_1_writing_dsl_for_drl_rule.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools 5 Case Study 1- Writing DSL for DRL rule&#034;&gt;Drools 5 Case Study 1- Writing DSL for DRL rule&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/31/drools_5_complex_event_processing.html&#034; rel=&#034;bookmark&#034; title=&#034;Drools 5 - Complex Event Processing&#034;&gt;Drools 5 - Complex Event Processing&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser: Broken case of inheritance&#034;&gt;Brainteaser: Broken case of inheritance&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser: Overridable methods &#034;&gt;Brainteaser: Overridable methods &lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/01/brainteaser_arraylist_vs_treeset.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser: ArrayList VS TreeSet&#034;&gt;Brainteaser: ArrayList VS TreeSet&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          This can be a hard one, since it requires from you to be familiar with Drools.  Consider the condition side of the following rules: rule &amp;quot;object comparison one&amp;quot;no-loop when $customer1 : Customer( ) $customer2 : Customer(this != $customer1) then System.out.println(&amp;...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;t=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;title=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&amp;amp;t=Brainteaser Drools: Testing Objects&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>brainteaser</category>
    <category>drools</category>
    <comments>http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html</guid>
    <pubDate>Sat, 22 Aug 2009 12:50:00 GMT</pubDate>
  </item>
  <item>
    <title>Brainteaser: Overridable methods </title>
    <link>http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html</link>
	 <description>
        Consider the following case of inheritance:
&lt;pre name=&#034;code&#034; class=&#034;java:firstline[1]&#034;&gt;public class  Parent {&lt;br /&gt;   public Parent()  {&lt;br /&gt;	getValue();&lt;br /&gt;   }&lt;br /&gt;   public void getValue()  {&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class  Child extends Parent {&lt;br /&gt;   private final Integer integer;&lt;br /&gt;   public Child()  {&lt;br /&gt;	integer = new Integer(888);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   @Override&lt;br /&gt;   public void getValue()  {&lt;br /&gt;	System.out.println(integer);&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;
&lt;strong&gt;Question&lt;/strong&gt;: What would the following program print, why?
&lt;pre name=&#034;code&#034; class=&#034;java:firstline[1]&#034;&gt;public class  Test {&lt;br /&gt;   public static void main(String[] args)  {&lt;br /&gt;	Child child = new Child();&lt;br /&gt;	child.getValue();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
Lets assume that &lt;em&gt;getValue()&lt;/em&gt; implementation in Child class was changed to:
&lt;pre name=&#034;code&#034; class=&#034;java:firstline[1]&#034;&gt;   @Override&lt;br /&gt;   public void getValue()  {&lt;br /&gt;     System.out.println(integer.toString());&lt;br /&gt;   }&lt;/pre&gt;
&lt;strong&gt;Question&lt;/strong&gt;: What would the output of the Test class be now, why?
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;t=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;t=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser Drools: Testing Objects&#034;&gt;Brainteaser Drools: Testing Objects&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser: Broken case of inheritance&#034;&gt;Brainteaser: Broken case of inheritance&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/11/15/java_and_those_frameworks.html&#034; rel=&#034;bookmark&#034; title=&#034;Java and those frameworks&#034;&gt;Java and those frameworks&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/01/brainteaser_arraylist_vs_treeset.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser: ArrayList VS TreeSet&#034;&gt;Brainteaser: ArrayList VS TreeSet&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/12/how_to_set_securitymanager_and_java_security_policy_programmatically.html&#034; rel=&#034;bookmark&#034; title=&#034;How to set SecurityManager and Java security policy programmatically&#034;&gt;How to set SecurityManager and Java security policy programmatically&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/13/hack_any_java_class_using_reflection_attack.html&#034; rel=&#034;bookmark&#034; title=&#034;Hack any Java class using reflection attack&#034;&gt;Hack any Java class using reflection attack&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/19/brainteaser_broken_comparator.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser: Broken comparator&#034;&gt;Brainteaser: Broken comparator&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/09/06/singleton_pattern_and_problem_with_double_checked_locking.html&#034; rel=&#034;bookmark&#034; title=&#034;Singleton pattern and problem with double checked locking &#034;&gt;Singleton pattern and problem with double checked locking &lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          Consider the following case of inheritance: public class  Parent {   public Parent()  { getValue();   }   public void getValue()  {   }}public class  Child extends Parent {   private final Integer integer;   public Child()  { integer = new Integer(888);   }   @Override   public void getValue()  { ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;t=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;title=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&amp;amp;t=Brainteaser: Overridable methods &#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>brainteaser</category>
    <category>java</category>
    <category>design patterns</category>
    <comments>http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html</guid>
    <pubDate>Sat, 18 Apr 2009 02:02:00 GMT</pubDate>
  </item>
  <item>
    <title>Online PDF Generator</title>
    <link>http://javabeans.asia/2009/04/11/online_pdf_generator.html</link>
	 <description>
        &lt;a href=&#034;http://javabeans.asia/pages/pdfgen.html&#034; title=&#034;Online PDF generator - Generate PDF online from HTML snippet or plain text &#034;&gt;Online PDF generator&lt;/a&gt; now available. This simple but useful online PDF generator tool allows you to generate PDF document online from HTML snippets. The tool uses &lt;a target=&#034;_blank&#034; title=&#034;XML/XHTML/CSS 2.1 Renderer&#034; href=&#034;https://xhtmlrenderer.dev.java.net/&#034;&gt;Flying Saucer&lt;/a&gt; library.&lt;br /&gt;
&lt;br /&gt;
The PDF is generated with full compression, including meta data in PDF properties. Keep in mind that for successful PDF generation, your HTML markup has to validate as XHTML 1.0 Transitional, which means &amp;lt;img&amp;gt; becomes &amp;lt;img /&amp;gt; or &amp;lt;p&amp;gt; must be terminated by the matching &amp;lt;/p&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
You can provide URL to your own CSS file with styles for your HTML snippet or to provide a &amp;quot;style&amp;quot; attribute on HTML elements. If URL or &amp;quot;style&amp;quot; attribute are not specified, default system styles will be applied on your HTML snippet.&lt;br /&gt;
&lt;br /&gt;
I hope this helps.&lt;br /&gt;
&lt;br /&gt;
Cheers&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/04/11/online_pdf_generator.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/04/11/online_pdf_generator.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/04/11/online_pdf_generator.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;t=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;t=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&#034; rel=&#034;bookmark&#034; title=&#034;Generate PDF with Flying Saucer and iText by adding font files&#034;&gt;Generate PDF with Flying Saucer and iText by adding font files&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&#034; rel=&#034;bookmark&#034; title=&#034;Export Pebble Blog Entry to PDF Plugin&#034;&gt;Export Pebble Blog Entry to PDF Plugin&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/03/22/export_to_pdf_using_itext_java_pdf_library.html&#034; rel=&#034;bookmark&#034; title=&#034;Export to PDF using iText Java-PDF library&#034;&gt;Export to PDF using iText Java-PDF library&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&#034; rel=&#034;bookmark&#034; title=&#034;Export to PDF using iText and Flying Saucer&#034;&gt;Export to PDF using iText and Flying Saucer&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          Online PDF generator now available. This simple but useful online PDF generator tool allows you to generate PDF document online from HTML snippets. The tool uses Flying Saucer library.  The PDF is generated with full compression, including meta data in PDF properties. Keep in mind that for successful PDF generation, ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/11/online_pdf_generator.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/04/11/online_pdf_generator.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/04/11/online_pdf_generator.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/04/11/online_pdf_generator.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;t=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;title=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/04/11/online_pdf_generator.html&amp;amp;t=Online PDF Generator&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>java</category>
    <category>pebble</category>
    <comments>http://javabeans.asia/2009/04/11/online_pdf_generator.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2009/04/11/online_pdf_generator.html</guid>
    <pubDate>Sat, 11 Apr 2009 11:17:00 GMT</pubDate>
  </item>
  <item>
    <title>Export Pebble Blog Entry to PDF Plugin</title>
    <link>http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html</link>
	 <description>
        In one of my &lt;a title=&#034;Export to PDF using iText and Flying Saucer&#034; href=&#034;http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&#034;&gt;previous&lt;/a&gt; posts, I described how I implemented a plug in for &lt;a target=&#034;_blank&#034; title=&#034;Pebble Blogging Software&#034; href=&#034;http://pebble.sourceforge.net/&#034;&gt;Pebble&lt;/a&gt; blogging software that allows export of blog entries to PDF. &lt;br /&gt;
&lt;br /&gt;
Today, I have made modifications to enable plug in to load font files at run time during PDF generation to provide support for additional non-Latin languages. So now, it is possible to export non-Lain characters from blog entries to PDF.&lt;br /&gt;
&lt;br /&gt;
Below, I&#039;ve added some content using different languages. To allow support for non-Latin languages, I am using font file &lt;em&gt;cyberbit.ttf&lt;/em&gt; by Bitstream. You can test the plugin&#039;s multilingual support by generating PDF from the current post. &lt;br /&gt;
&lt;br /&gt;
I think its comes out quite nicely. The only hitch at this moment is that &lt;a href=&#034;https://xhtmlrenderer.dev.java.net/&#034; title=&#034;XML/XHTML/CSS 2.1 Renderer&#034; target=&#034;_blank&#034;&gt;Flying Saucer&lt;/a&gt; does not have support for right-to-left text in PDF yet. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Japanese&lt;/strong&gt; &lt;strong&gt;Kanji&lt;/strong&gt;:&lt;br /&gt;
五輪代表&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Japanese Hiragana&lt;/strong&gt;&lt;br /&gt;
こんにちは、これは真実を決定するためにはテストテキストです。&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Japanese Katakana&lt;/strong&gt;&lt;br /&gt;
ラドクリフ、マラソン&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Japanese Kokuji&lt;br /&gt;
&lt;/strong&gt;和製漢字&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;
&lt;div class=&#034;s&#034;&gt; &lt;br /&gt;
&lt;strong&gt;Chinese Simplified&lt;/strong&gt;:&lt;br /&gt;
您好，这是一个测试文本，以确定事实真相&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Chinese Traditional&lt;/strong&gt;:&lt;br /&gt;
您好，這是一個測試文本，以確定事實真相&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Korean&lt;/strong&gt;:&lt;br /&gt;
안녕하세요,이 사실을 확인하는 테스트 텍스트입니다&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Arabic&lt;/strong&gt;:&lt;br /&gt;
مرحبا ، هذا هو اختبار لتحديد نص الحقيقة&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Hebrew&lt;/strong&gt;:&lt;br /&gt;
שלום, זוהי בדיקה טקסט כדי לקבוע את האמת&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Russian&lt;/strong&gt;:&lt;br /&gt;
Привет, это тест текста, чтобы определить истину &lt;/div&gt;
&lt;br /&gt;
&lt;strong&gt;Greek:&lt;br /&gt;
&lt;/strong&gt;&amp;Gamma;&amp;epsilon;&amp;iota;&amp;alpha; &amp;sigma;&amp;alpha;&amp;sigmaf;, &amp;alpha;&amp;upsilon;&amp;tau;ό &amp;tau;&amp;omicron; &amp;kappa;&amp;epsilon;ί&amp;mu;&amp;epsilon;&amp;nu;&amp;omicron; &amp;epsilon;ί&amp;nu;&amp;alpha;&amp;iota; &amp;mu;&amp;iota;&amp;alpha; &amp;delta;&amp;omicron;&amp;kappa;&amp;iota;&amp;mu;&amp;alpha;&amp;sigma;ί&amp;alpha; &amp;gamma;&amp;iota;&amp;alpha; &amp;tau;&amp;omicron;&amp;nu; &amp;pi;&amp;rho;&amp;omicron;&amp;sigma;&amp;delta;&amp;iota;&amp;omicron;&amp;rho;&amp;iota;&amp;sigma;&amp;mu;ό &amp;tau;&amp;eta;&amp;sigmaf; &amp;alpha;&amp;lambda;ή&amp;theta;&amp;epsilon;&amp;iota;&amp;alpha;&amp;sigmaf;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Thai&lt;/strong&gt;:&lt;br /&gt;
สวัสดีนี่คือการทดสอบข้อความเพื่อตรวจสอบความจริง&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Vietnamese&lt;/strong&gt;:&lt;br /&gt;
Xin ch&amp;agrave;o, đ&amp;acirc;y l&amp;agrave; một b&amp;agrave;i kiểm tra văn bản để x&amp;aacute;c định sự thật&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Turkish&lt;/strong&gt;:&lt;br /&gt;
Merhaba, bu ger&amp;ccedil;eği belirlemek i&amp;ccedil;in bir test metin&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;t=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;t=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&#034; rel=&#034;bookmark&#034; title=&#034;Generate PDF with Flying Saucer and iText by adding font files&#034;&gt;Generate PDF with Flying Saucer and iText by adding font files&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/11/online_pdf_generator.html&#034; rel=&#034;bookmark&#034; title=&#034;Online PDF Generator&#034;&gt;Online PDF Generator&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/03/22/export_to_pdf_using_itext_java_pdf_library.html&#034; rel=&#034;bookmark&#034; title=&#034;Export to PDF using iText Java-PDF library&#034;&gt;Export to PDF using iText Java-PDF library&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&#034; rel=&#034;bookmark&#034; title=&#034;Export to PDF using iText and Flying Saucer&#034;&gt;Export to PDF using iText and Flying Saucer&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/01/21/blogging_software_pebble_is_almost_six_years_old.html&#034; rel=&#034;bookmark&#034; title=&#034;Blogging software Pebble is almost six years old!&#034;&gt;Blogging software Pebble is almost six years old!&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/04/28/pebble_2_3_application_blog.html&#034; rel=&#034;bookmark&#034; title=&#034;Pebble 2.3 application blog&#034;&gt;Pebble 2.3 application blog&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          In one of my previous posts, I described how I implemented a plug in for Pebble blogging software that allows export of blog entries to PDF.   Today, I have made modifications to enable plug in to load font files at run time during PDF generation to provide support for additional non-Latin languages. So now, it is ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;t=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;title=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&amp;amp;t=Export Pebble Blog Entry to PDF Plugin&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>java</category>
    <category>pebble</category>
    <comments>http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html</guid>
    <pubDate>Fri, 10 Apr 2009 09:46:00 GMT</pubDate>
  </item>
  <item>
    <title>Brainteaser: Broken case of inheritance</title>
    <link>http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html</link>
	 <description>
        Consider the following case of inheritance:
&lt;pre class=&#034;java:firstline[1]&#034; name=&#034;code&#034;&gt;public class ExtendingHashSet&amp;lt;E&amp;gt; extends HashSet&amp;lt;E&amp;gt;  {&lt;br /&gt;   private int counter = 0;&lt;br /&gt;&lt;br /&gt;   public ExtendingHashSet() {&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;    &lt;br /&gt;   @Override&lt;br /&gt;   public boolean add(E e)  {&lt;br /&gt;      counter++;&lt;br /&gt;      return super.add(e);&lt;br /&gt;   }   &lt;br /&gt;&lt;br /&gt;   @Override&lt;br /&gt;   public boolean addAll(Collection&amp;lt;? extends E&amp;gt; c)  {&lt;br /&gt;      counter += c.size();&lt;br /&gt;      return super.addAll(c);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public int getCounter()  {&lt;br /&gt;      return counter;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
Created instance:
&lt;pre class=&#034;java:firstline[1]:nocontrols&#034; name=&#034;code&#034;&gt;ExtendingHashSet&amp;lt;String&amp;gt; s = new ExtendingHashSet&amp;lt;String&amp;gt;();&lt;br /&gt;s.addAll(Arrays.asList(&amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, &amp;quot;three&amp;quot;));&lt;br /&gt;&lt;/pre&gt;
&lt;strong&gt;Question&lt;/strong&gt;: What value would &lt;em&gt;s.getCounter()&lt;/em&gt; method return at this point and why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking forward for your answers dear readers&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;t=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;t=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/08/22/brainteaser_drools_testing_objects.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser Drools: Testing Objects&#034;&gt;Brainteaser Drools: Testing Objects&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/18/brainteaser_overridable_methods.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser: Overridable methods &#034;&gt;Brainteaser: Overridable methods &lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/11/15/java_and_those_frameworks.html&#034; rel=&#034;bookmark&#034; title=&#034;Java and those frameworks&#034;&gt;Java and those frameworks&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/01/brainteaser_arraylist_vs_treeset.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser: ArrayList VS TreeSet&#034;&gt;Brainteaser: ArrayList VS TreeSet&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/12/how_to_set_securitymanager_and_java_security_policy_programmatically.html&#034; rel=&#034;bookmark&#034; title=&#034;How to set SecurityManager and Java security policy programmatically&#034;&gt;How to set SecurityManager and Java security policy programmatically&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/13/hack_any_java_class_using_reflection_attack.html&#034; rel=&#034;bookmark&#034; title=&#034;Hack any Java class using reflection attack&#034;&gt;Hack any Java class using reflection attack&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/10/19/brainteaser_broken_comparator.html&#034; rel=&#034;bookmark&#034; title=&#034;Brainteaser: Broken comparator&#034;&gt;Brainteaser: Broken comparator&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/09/06/singleton_pattern_and_problem_with_double_checked_locking.html&#034; rel=&#034;bookmark&#034; title=&#034;Singleton pattern and problem with double checked locking &#034;&gt;Singleton pattern and problem with double checked locking &lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          Consider the following case of inheritance: public class ExtendingHashSetE extends HashSetE  {   private int counter = 0;   public ExtendingHashSet() {   }       @Override   public boolean add(E e)  {      counter++;      return super.add(e);   }      @Override   public boolean addAll(Collection? extends E c)  {      ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;t=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;title=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html&amp;amp;t=Brainteaser: Broken case of inheritance&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>brainteaser</category>
    <category>design patterns</category>
    <comments>http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2009/04/05/brainteaser_broken_case_of_inheritance.html</guid>
    <pubDate>Sun, 05 Apr 2009 10:34:00 GMT</pubDate>
  </item>
  <item>
    <title>How to prevent iFrame breakaway</title>
    <link>http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html</link>
	 <description>
        Few days ago I was searching for a solution to the problem I&#039;ve encountered - I needed to prevent a third party page to break out of iframe inside a web page of my web application. For people who are not closely familiar with JavaScript, the following JS snippet will make it more clear how page can break out of iframe: &lt;br /&gt;
&lt;pre class=&#034;codeSample&#034;&gt;  if (top.location.href != self.location.href)&lt;br /&gt;     top.location.href = self.location.href; &lt;br /&gt;&lt;/pre&gt;
If the current page is not the parent window - become the parent window. &lt;br /&gt;
&lt;br /&gt;
I needed to implement something on my end, that would block or prevent the above script or similar to it from executing. I&#039;ve spent several hours browsing the Net, talking to people on IRC and simply playing trial and error. &lt;br /&gt;
&lt;br /&gt;
After some time, I understood that I wont be able to find a solution to my problem, simply because there is none unfortunately. But, having said that, I have some findings to share:&lt;br /&gt;
&lt;ol&gt;
    &lt;li&gt;There is iframe &lt;em&gt;security &lt;/em&gt;attribute which only works on IE. Setting this attribute to security=&amp;quot;restricted&amp;quot;, will prevent iframe to break out. Its always &amp;quot;nice&amp;quot; to see that MS have few tricks up their sleeve :). Also, on one of the forums, someone mentioned that the same attribute will work under Opera as well as under IE. I personally haven&#039;t tested it my self under Opera, I can just say that it works for IE and not FF.&lt;/li&gt;
    &lt;li&gt;To make use of &lt;em&gt;window.onbeforeunload&lt;/em&gt; event and prompt user with a dialog that requires user&#039;s input if he agrees to navigate away from the current page. If user disagrees (clicks &amp;quot;cancel&amp;quot;), he will remain on the current page. So here in a sense iframe breakaway was canceled. By the way, there is no way to suppress the dialog prompt and make event from clicking &amp;quot;cancel&amp;quot; default.&lt;/li&gt;
    &lt;li&gt;To grab the content of third party page using &lt;a target=&#034;_blank&#034; title=&#034;http://au.php.net/curl&#034; href=&#034;http://au.php.net/curl&#034;&gt;PHP Curl&lt;/a&gt; lib and to create your own placeholder page for that content. Then the placeholder page can be put inside iframe. The page or the grabbed content will not attempt to breakout, but any request submitted to the placeholder page (hyper link or button click on the grabbed content) will cause page to unload.&lt;br /&gt;
    &lt;/li&gt;
&lt;/ol&gt;
Also, while researching, I came across this &lt;a target=&#034;_blank&#034; title=&#034;Preventing Frame Busting and Click Jacking (UI Redressing)&#034; href=&#034;http://coderrr.wordpress.com/2009/02/13/preventing-frame-busting-and-click-jacking-ui-redressing/&#034;&gt;post&lt;/a&gt; that talks about preventing iframe breakaway and click jacking with the help of 204 header response code.&lt;br /&gt;
&lt;br /&gt;
After all that, my conclusion is:&lt;br /&gt;
If the page inside iframe is not yours, in other words it is a page hosted under another domain, its not possible actually to stop a page from unloading. Having something like that,&amp;nbsp; would allow malicious sites to &amp;quot;trap&amp;quot; a user indefinitely. &lt;br /&gt;
&lt;br /&gt;
I would love to hear any other suggestions regarding iframe breakout you may have dear readers.&lt;br /&gt;
&lt;br /&gt;
Cheers&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;t=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;t=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/01/24/detecting_an_internet_connection_with_javascript.html&#034; rel=&#034;bookmark&#034; title=&#034;Detecting an Internet connection with Javascript&#034;&gt;Detecting an Internet connection with Javascript&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          Few days ago I was searching for a solution to the problem I&#039;ve encountered - I needed to prevent a third party page to break out of iframe inside a web page of my web application. For people who are not closely familiar with JavaScript, the following JS snippet will make it more clear how page can break out of ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;t=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;title=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html&amp;amp;t=How to prevent iFrame breakaway&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>design patterns</category>
    <category>javascript</category>
    <comments>http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2009/03/29/how_to_prevent_iframe_breakaway.html</guid>
    <pubDate>Sun, 29 Mar 2009 06:37:00 GMT</pubDate>
  </item>
  <item>
    <title>Export to PDF using iText and Flying Saucer</title>
    <link>http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html</link>
	 <description>
        In my previous &lt;a href=&#034;http://javabeans.asia/2009/03/22/export_to_pdf_using_itext_java_pdf_library.html&#034; title=&#034;Export to PDF using iText Java-PDF library - New Pebble plugin to export blog entries to PDF document&#034;&gt;post&lt;/a&gt; I attempted to generate PDF on the fly using &lt;a target=&#034;_blank&#034; title=&#034;iText - Free Java-PDF library&#034; href=&#034;http://www.lowagie.com/iText/&#034;&gt;iText&lt;/a&gt; library. My goal was to parse HTML snippet into PDF. Unfortunately, as I discovered &lt;a href=&#034;http://www.lowagie.com/iText/&#034; title=&#034;iText - Free Java-PDF library&#034; target=&#034;_blank&#034;&gt;iText&lt;/a&gt; alone is not powerful enough as HTML parser. &lt;a href=&#034;http://www.lowagie.com/iText/&#034; title=&#034;iText - Free Java-PDF library&#034; target=&#034;_blank&#034;&gt;iText&lt;/a&gt; is not flexible enough to manipulate the CSS. Its understandable, since &lt;a href=&#034;http://www.lowagie.com/iText/&#034; title=&#034;iText - Free Java-PDF library&#034; target=&#034;_blank&#034;&gt;iText&lt;/a&gt;&#039;s main functionality is PDF generation and not HTML parsing.&lt;br /&gt;
&lt;br /&gt;
While trying to find workaround &lt;a href=&#034;http://www.lowagie.com/iText/&#034; title=&#034;iText - Free Java-PDF library&#034; target=&#034;_blank&#034;&gt;iText&lt;/a&gt; limitations, I came across &lt;a href=&#034;https://xhtmlrenderer.dev.java.net/&#034; title=&#034;XML/XHTML/CSS 2.1 Renderer&#034; target=&#034;_blank&#034;&gt;Flying Saucer&lt;/a&gt; Java library. &lt;a href=&#034;https://xhtmlrenderer.dev.java.net/&#034; title=&#034;XML/XHTML/CSS 2.1 Renderer&#034; target=&#034;_blank&#034;&gt;Flying Saucer&lt;/a&gt; is XML/XHTML/CSS 2.1 renderer, that uses &lt;a href=&#034;http://www.lowagie.com/iText/&#034; title=&#034;iText - Free Java-PDF library&#034; target=&#034;_blank&#034;&gt;iText&lt;/a&gt; and allows to render CSS stylesheets and XHTML, either static or generated, directly to PDFs.&lt;br /&gt;
&lt;br /&gt;
I want to say that &lt;a href=&#034;https://xhtmlrenderer.dev.java.net/&#034; title=&#034;XML/XHTML/CSS 2.1 Renderer&#034; target=&#034;_blank&#034;&gt;Flying Saucer&lt;/a&gt; does a beautiful job. You can check this out by trying to export current post to PDF :)&lt;br /&gt;
&lt;br /&gt;
Joshua Marinacci, the &lt;a href=&#034;https://xhtmlrenderer.dev.java.net/&#034; title=&#034;XML/XHTML/CSS 2.1 Renderer&#034; target=&#034;_blank&#034;&gt;Flying Saucer&lt;/a&gt; project lead wrote a nice &lt;a href=&#034;http://today.java.net/pub/a/today/2007/06/26/generating-pdfs-with-flying-saucer-and-itext.html&#034; title=&#034;Generating PDFs for Fun and Profit with Flying Saucer and iText&#034; target=&#034;_blank&#034;&gt;tutorial&lt;/a&gt; that explains how to generate PDF using &lt;a href=&#034;https://xhtmlrenderer.dev.java.net/&#034; title=&#034;XML/XHTML/CSS 2.1 Renderer&#034; target=&#034;_blank&#034;&gt;Flying Saucer&lt;/a&gt;.&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;t=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;t=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2010/02/23/generate_pdf_with_flying_saucer_and_itext_by_adding_font_files.html&#034; rel=&#034;bookmark&#034; title=&#034;Generate PDF with Flying Saucer and iText by adding font files&#034;&gt;Generate PDF with Flying Saucer and iText by adding font files&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/10/export_pebble_blog_entry_to_pdf_plugin.html&#034; rel=&#034;bookmark&#034; title=&#034;Export Pebble Blog Entry to PDF Plugin&#034;&gt;Export Pebble Blog Entry to PDF Plugin&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/04/11/online_pdf_generator.html&#034; rel=&#034;bookmark&#034; title=&#034;Online PDF Generator&#034;&gt;Online PDF Generator&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/03/22/export_to_pdf_using_itext_java_pdf_library.html&#034; rel=&#034;bookmark&#034; title=&#034;Export to PDF using iText Java-PDF library&#034;&gt;Export to PDF using iText Java-PDF library&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2009/01/21/blogging_software_pebble_is_almost_six_years_old.html&#034; rel=&#034;bookmark&#034; title=&#034;Blogging software Pebble is almost six years old!&#034;&gt;Blogging software Pebble is almost six years old!&lt;/a&gt;&lt;br /&gt;&lt;a href=&#034;http://javabeans.asia/2008/04/28/pebble_2_3_application_blog.html&#034; rel=&#034;bookmark&#034; title=&#034;Pebble 2.3 application blog&#034;&gt;Pebble 2.3 application blog&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description>
	<!--
    <description>
          In my previous post I attempted to generate PDF on the fly using iText library. My goal was to parse HTML snippet into PDF. Unfortunately, as I discovered iText alone is not powerful enough as HTML parser. iText is not flexible enough to manipulate the CSS. Its understandable, since iText&#039;s main functionality is PDF ...&lt;p&gt;&lt;a href=&#034;http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;&lt;div class=&#034;tags&#034;&gt;&lt;span&gt;Social Bookmarks : &lt;/span&gt;&amp;nbsp;&lt;a href=&#034;http://slashdot.org/bookmark.pl?url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Slash Dot&#034;&gt;&lt;img src=&#034;common/images/slashdot.png&#034; alt=&#034;Add this post to Slashdot&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://digg.com/submit?url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Digg this post&#034;&gt;&lt;img src=&#034;common/images/digg.png&#034; alt=&#034;Add this post to Digg&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://reddit.com/submit?url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Reddit&#034;&gt;&lt;img src=&#034;common/images/reddit.png&#034; alt=&#034;Add this post to Reddit&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://del.icio.us/post?url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Save this post to Del.icio.us&#034;&gt;&lt;img src=&#034;common/images/delicious.png&#034; alt=&#034;Add this post to Delicious&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.stumbleupon.com/submit?url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Stumble this post&#034;&gt;&lt;img src=&#034;common/images/stumbleupon.png&#034; alt=&#034;Add this post to Stumble it&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Google&#034;&gt;&lt;img src=&#034;common/images/google.png&#034; alt=&#034;Add this post to Google&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://technorati.com/faves?add=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Technorati&#034;&gt;&lt;img src=&#034;common/images/technorati.png&#034; alt=&#034;Add this post to Technorati&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.bloglines.com/sub/http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Bloglines&#034;&gt;&lt;img src=&#034;common/images/bloglines.png&#034; alt=&#034;Add this post to Bloglines&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.facebook.com/share.php?u=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&#034; target=&#034;_blank&#034; title=&#034;Add this post to Facebook&#034;&gt;&lt;img src=&#034;common/images/facebook.png&#034; alt=&#034;Add this post to Facebook&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://www.furl.net/storeIt.jsp?u=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;t=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Furl&#034;&gt;&lt;img src=&#034;common/images/furl.png&#034; alt=&#034;Add this post to Furl&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;https://favorites.live.com/quickadd.aspx?mkt=en-us&amp;amp;url=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;title=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Windows Live&#034;&gt;&lt;img src=&#034;common/images/windowslive.png&#034; alt=&#034;Add this post to Windows Live&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&#034;http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&amp;amp;u=http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html&amp;amp;t=Export to PDF using iText and Flying Saucer&#034; target=&#034;_blank&#034; title=&#034;Add this post to Yahoo!&#034;&gt;&lt;img src=&#034;common/images/yahoo.png&#034; alt=&#034;Add this post to Yahoo!&#034; border=&#034;0&#034; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
      
	-->
    <category>java</category>
    <category>pebble</category>
    <comments>http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html#comments</comments>
    <guid isPermaLink="true">http://javabeans.asia/2009/03/28/export_to_pdf_using_itext_and_flying_saucer.html</guid>
    <pubDate>Sat, 28 Mar 2009 00:23:00 GMT</pubDate>
  </item>
  </channel>
</rss>
