<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5158645802029540923</id><updated>2024-10-24T13:55:15.164-07:00</updated><title type='text'>Neela Kandan</title><subtitle type='html'>Welcome : All open source  and All framework details available in this blogs.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://neelakandan85.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-7492958404527890469</id><published>2011-06-17T22:32:00.001-07:00</published><updated>2011-06-17T22:32:43.096-07:00</updated><title type='text'>Neelakanda - God</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXXVh7qPZCCDzfD_b8H9JLoGMdOM_Ms6lcCV8X-91lrBcG84msolwulQkIf8cKx7J2jAyAaVYpJ0xlVP9Ow2rDeuWRXUIO6oUwBKzH_3mCnY32HlTQiRvd5OaTWKe__LV1Sp0wya7b_Bo/s1600/001.jpg&quot;&gt;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXXVh7qPZCCDzfD_b8H9JLoGMdOM_Ms6lcCV8X-91lrBcG84msolwulQkIf8cKx7J2jAyAaVYpJ0xlVP9Ow2rDeuWRXUIO6oUwBKzH_3mCnY32HlTQiRvd5OaTWKe__LV1Sp0wya7b_Bo/s1600/001.jpg&lt;/a&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/7492958404527890469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/7492958404527890469'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/06/neelakanda-god.html' title='Neelakanda - God'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-7556362523858802597</id><published>2011-04-02T00:11:00.001-07:00</published><updated>2011-04-02T00:11:48.403-07:00</updated><title type='text'>DTD-Entities</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;intro&quot; style=&quot;color: black;&quot;&gt;
Entities are variables used to define
shortcuts to standard text or special characters. Entity references are references to
entities Entities can be declared internally or
externally.&lt;/div&gt;
&lt;h3 style=&quot;color: black;&quot;&gt;
Internal Entity Declaration&lt;/h3&gt;
&lt;h4 style=&quot;color: black;&quot;&gt;
Syntax&lt;/h4&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; id=&quot;table1&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;!ENTITY entity-name &quot;entity-value&quot;&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;DTD Example:&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 228px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;226&quot;&gt;&amp;lt;!ENTITY name &quot;Amit&quot;&amp;gt;&lt;br /&gt;
        &amp;lt;!ENTITY company &quot;RoseIndia&quot;&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;XML example:&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;Profile&amp;gt;&amp;amp;name;&amp;amp;company;&amp;lt;/Profile&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Note:&lt;/b&gt; An entity has three parts: an ampersand
(&amp;amp;), an entity name, and a semicolon (;).&lt;/div&gt;
&lt;h3 style=&quot;color: black;&quot;&gt;
An External Entity Declaration&lt;/h3&gt;
&lt;h4 style=&quot;color: black;&quot;&gt;
Syntax&lt;/h4&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; id=&quot;table2&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;!ENTITY entity-name SYSTEM &quot;URI/URL&quot;&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;DTD Example:&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 450px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;448&quot;&gt;&amp;lt;!ENTITY name SYSTEM
        &quot;http://www.roseindia.net/entities.dtd&quot;&amp;gt;&lt;br /&gt;
        &amp;lt;!ENTITY company SYSTEM &quot;http://www.roseindia.net/entities.dtd&quot;&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;XML example:&lt;/b&gt;&lt;/div&gt;
&lt;pre style=&quot;color: black;&quot;&gt;&amp;lt;Profile&amp;gt;&amp;amp;name;&amp;amp;company;&amp;lt;/Profile&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/7556362523858802597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/7556362523858802597'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/04/dtd-entities.html' title='DTD-Entities'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-1950920531341048159</id><published>2011-04-02T00:09:00.001-07:00</published><updated>2011-04-02T00:09:50.371-07:00</updated><title type='text'>DTD-Attributes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;In a DTD, attributes are declared with an ATTLIST
declaration.&lt;/b&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Declaring Attributes&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
The ATTLIST declaration defines the element having a
attribute with attribute name , attribute type , and&amp;nbsp; attribute
&lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/Xml_DTD_Attributes.shtml#&quot; id=&quot;KonaLink0&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;background-color: transparent; border-bottom: 1px solid blue; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;default&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kLink&quot; style=&quot;background-color: transparent; border-bottom: 1px solid blue; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;. An attribute declaration has the following syntax:&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;!ATTLIST element-name attribute-name attribute-type default-value&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;pre style=&quot;color: black;&quot;&gt;&lt;b&gt;DTD example:&lt;/b&gt;&lt;/pre&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 285px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;283&quot;&gt;&amp;lt;!ATTLIST
        reciept type &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/Xml_DTD_Attributes.shtml#&quot; id=&quot;KonaLink1&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;CDATA&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; &quot;check&quot;&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;pre style=&quot;color: black;&quot;&gt;&lt;b&gt;XML example:&lt;/b&gt;&lt;/pre&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 200px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td&gt;&amp;lt;reciept type=&quot;check&quot; /&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Attribute-type&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;The attribute-type can be one of the following:&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black; width: 520px;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;th align=&quot;left&quot; width=&quot;218&quot;&gt;Type&lt;/th&gt;
      &lt;th align=&quot;left&quot; width=&quot;292&quot;&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;218&quot;&gt;
        CDATA&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;292&quot;&gt;
        The value is character data&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;218&quot;&gt;
        (en1|en2|..)&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;292&quot;&gt;
        The value must be one from an enumerated list&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;218&quot;&gt;
        ID&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;292&quot;&gt;
        The value is a unique id&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;218&quot;&gt;
        IDREF&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;292&quot;&gt;
        The value is the id of another element&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;218&quot;&gt;
        IDREFS&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;292&quot;&gt;
        The value is a list of other ids&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;218&quot;&gt;
        NMTOKEN&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;292&quot;&gt;
        The value is a valid &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/Xml_DTD_Attributes.shtml#&quot; id=&quot;KonaLink2&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;XML&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; name&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;218&quot;&gt;
        NMTOKENS&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;292&quot;&gt;
        The value is a list of valid XML names&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;218&quot;&gt;
        ENTITY&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;292&quot;&gt;
        The value is an entity&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;218&quot;&gt;
        ENTITIES&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;292&quot;&gt;
        The value is a list of entities&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;218&quot;&gt;
        NOTATION&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;292&quot;&gt;
        The value is a name of a notation&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;218&quot;&gt;
        xml:&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;292&quot;&gt;
        The value is a predefined xml value&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Default-value&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
The default-value can be one of the following:&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black; width: 388px;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;th align=&quot;left&quot; width=&quot;159&quot;&gt;Value&lt;/th&gt;
      &lt;th align=&quot;left&quot; width=&quot;219&quot;&gt;Explanation&lt;/th&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;159&quot;&gt;
        &lt;i&gt;value&lt;/i&gt;&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;219&quot;&gt;
        The default value of the attribute&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;159&quot;&gt;
        #REQUIRED&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;219&quot;&gt;
        The attribute is required&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;159&quot;&gt;
        #IMPLIED&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;219&quot;&gt;
        The attribute is not required&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;159&quot;&gt;
        #FIXED &lt;i&gt;value&lt;/i&gt;&lt;br /&gt;

      &lt;/td&gt;
      &lt;td width=&quot;219&quot;&gt;
        The attribute value is fixed&lt;br /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;span style=&quot;color: navy;&quot;&gt;&lt;br /&gt;
&lt;b&gt;A Default Attribute Value&lt;/b&gt;
&lt;/span&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;DTD Example:&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;!ELEMENT Scale EMPTY&amp;gt;
&amp;lt;!ATTLIST Scale length CDATA &quot;0&quot;&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
In the example above, the DTD defines a &quot;Scale&quot;
element&amp;nbsp; to be&amp;nbsp; empty with a &quot;length &quot; attribute of&amp;nbsp;
type CDATA . If no length is specified, it has a default value of 0.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Valid XML:&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 156px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;152&quot;&gt;&amp;lt;Scale length =&quot;100&quot; /&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;REQUIRED&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Syntax&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; id=&quot;table1&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;!ATTLIST element-name attribute_name attribute-type #REQUIRED&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;DTD Example&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 328px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;326&quot;&gt;&amp;lt;!ATTLIST person number CDATA #REQUIRED&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Valid XML:&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 144px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;140&quot;&gt;&amp;lt;person id=&quot;5677&quot; /&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Invalid XML:&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; id=&quot;table2&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;person /&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
Use the #REQUIRED keyword if you don&#39;t have an option
for a default value, but still want to force the attribute to be present.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;IMPLIED&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Syntax&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;!ATTLIST element-name attribute-name attribute-type #IMPLIED&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;DTD Example&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 314px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;312&quot;&gt;&amp;lt;!ATTLIST emergency no. CDATA #IMPLIED&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Valid XML:&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 219px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;217&quot;&gt;&amp;lt;emergency no.=&quot;555-667788&quot;
        /&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Valid XML:&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;emergency/&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
Use the #IMPLIED keyword if you don&#39;t want to force the
&lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/Xml_DTD_Attributes.shtml#&quot; id=&quot;KonaLink3&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;author&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; to include an attribute, and you don&#39;t have an option for a default
value.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;FIXED&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Syntax&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;!ATTLIST element-name attribute-name attribute-type #FIXED &quot;value&quot;&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;DTD Example&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 328px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;326&quot;&gt;&amp;lt;!ATTLIST Client CDATA
        #FIXED &quot;RoseIndia&quot;&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Valid XML:&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 168px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;166&quot;&gt;&amp;lt;Client =&quot;RoseIndia&quot;
        /&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Invalid XML:&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;Client=&quot;LotusIndia&quot; /&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
Use the #FIXED keyword when you want an attribute to
have a fixed value without allowing the author to change it. If an author
includes another value, the &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/Xml_DTD_Attributes.shtml#&quot; id=&quot;KonaLink4&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;XML &lt;/span&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;parser&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; will return an error.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Enumerated Attribute Values&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Syntax&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;!ATTLIST element-name attribute-name (en1|en2|..) default-value&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;DTD Example&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 291px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;289&quot;&gt;&amp;lt;!ATTLIST reciept type (check|cash)
        &quot;cash&quot;&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;XML example:&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; id=&quot;table3&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;reciept type=&quot;check&quot; /&amp;gt;
or
&amp;lt;reciept type=&quot;cash&quot; /&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
Use enumerated attribute values when you want the
attribute value to be one of a fixed set of legal values.&lt;/div&gt;
&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/1950920531341048159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/1950920531341048159'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/04/dtd-attributes.html' title='DTD-Attributes'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-8667675001870297274</id><published>2011-04-02T00:06:00.001-07:00</published><updated>2011-04-02T00:06:47.164-07:00</updated><title type='text'>DTD - XML Constituent</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;The constituent components of XML DTD Documents.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&amp;nbsp;&lt;b&gt;DTDs are made up by the following integrants:&lt;/b&gt;&lt;/div&gt;
&lt;ul style=&quot;color: black;&quot;&gt;
&lt;li&gt;Elements
  &lt;/li&gt;
&lt;li&gt;Attributes
  &lt;/li&gt;
&lt;li&gt;Entities
  &lt;/li&gt;
&lt;li&gt;PCDATA
  &lt;/li&gt;
&lt;li&gt;CDATA&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Brief explanation of each of the integrants :&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Elements&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
Elements are the &lt;b&gt;main constituent components&lt;/b&gt; of both
XML &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML_dtd_buildingblocks.shtml#&quot; id=&quot;KonaLink0&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;documents&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
Elements can contain text, other elements, or be empty
eg..&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;1&quot; class=&quot;ex&quot; style=&quot;color: black; width: 234px;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;226&quot;&gt;
        &lt;pre&gt;&amp;lt;To&amp;gt;Rohan&amp;lt;/To&amp;gt;
&amp;lt;From&amp;gt;Amit&amp;lt;/From&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;span style=&quot;color: navy;&quot;&gt;&lt;br /&gt;
&lt;b&gt;Attributes&lt;/b&gt;
&lt;/span&gt;
&lt;div style=&quot;color: black;&quot;&gt;
Attributes provide &lt;b&gt;extra information about elements&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
Attributes are always placed inside the opening tag of
an element. Attributes always come in name/value pairs. The following &quot;img&quot;
element has additional information about a source &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML_dtd_buildingblocks.shtml#&quot; id=&quot;KonaLink1&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;file&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;:&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black; width: 218px;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;210&quot;&gt;
        &lt;pre&gt;&amp;lt;img src=&quot;computer.gif&quot; /&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
The name of the element is &quot;img&quot;. The name of
the attribute is &quot;src&quot;. The value of the attribute is &quot;&lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML_dtd_buildingblocks.shtml#&quot; id=&quot;KonaLink2&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;computer&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;.gif&quot;.
Since the element itself is empty it is closed by a &quot; /&quot;.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Entities:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
Entities are expanded when a document is parsed by a
XML parser. Some characters have a special meaning in &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML_dtd_buildingblocks.shtml#&quot; id=&quot;KonaLink3&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;XML&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;, like the less than
sign (&amp;lt;) that defines the start of an XML tag , the greater than sign (&amp;gt;)
that defines the end of a XML tag.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
The following entities are predefined in XML:&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;2&quot; cellspacing=&quot;1&quot; style=&quot;color: black; width: 242px;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;th align=&quot;left&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; width=&quot;134&quot;&gt;Entity
        References&lt;/th&gt;
      &lt;th align=&quot;left&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; width=&quot;104&quot;&gt;&amp;nbsp;&amp;nbsp;
        Character&lt;/th&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;134&quot;&gt;&amp;amp;lt;&lt;/td&gt;
      &lt;td width=&quot;104&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;134&quot;&gt;&amp;amp;gt;&lt;/td&gt;
      &lt;td width=&quot;104&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;134&quot;&gt;&amp;amp;amp;&lt;/td&gt;
      &lt;td width=&quot;104&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;amp;&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;134&quot;&gt;&amp;amp;quot;&lt;/td&gt;
      &lt;td width=&quot;104&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
      &lt;td width=&quot;134&quot;&gt;&amp;amp;apos;&lt;/td&gt;
      &lt;td width=&quot;104&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;span style=&quot;color: navy;&quot;&gt;&amp;nbsp;&lt;/span&gt;
&lt;div style=&quot;color: black;&quot;&gt;

&lt;b&gt;PCDATA:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
PCDATA means &lt;b&gt;parsed character data. &lt;/b&gt;It can be
thought as the character data ( text ) found between the start tag and the end
tag of a XML element.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;PCDATA is a text to be parsed by a parser&lt;/b&gt;. &lt;b&gt;The
text is checked by the parser for entities and markup&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
Tags inside the text will be treated as markup and
entities will be expanded. However, parsed character data should not contain any
&lt;b&gt;&amp;amp;, &amp;lt;,&lt;/b&gt; or&lt;b&gt; &amp;gt; &lt;/b&gt;characters. These should&amp;nbsp; be represented
by the &lt;b&gt;&amp;amp;amp&lt;/b&gt; , &lt;b&gt;&amp;amp;lt,&lt;/b&gt; and &lt;b&gt;&amp;amp;gt&lt;/b&gt; entities,
respectively.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;CDATA:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;CDATA is character data that will NOT be parsed by a
parser&lt;/b&gt;. Tags inside the text will NOT be treated as markup and entities will
not be expanded.&lt;/div&gt;
&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/8667675001870297274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/8667675001870297274'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/04/dtd-xml-constituent.html' title='DTD - XML Constituent'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-7847369637710621171</id><published>2011-04-02T00:05:00.000-07:00</published><updated>2011-04-02T00:05:40.790-07:00</updated><title type='text'>DTD:Document Type Definition</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;intro&quot; style=&quot;color: black;&quot;&gt;
A Document Type Definition (DTD) defines the
legal &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML_DTD.shtml#&quot; id=&quot;KonaLink0&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;building &lt;/span&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;blocks&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; of an XML &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML_DTD.shtml#&quot; id=&quot;KonaLink1&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;document&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;. It defines the document structure with
a list of legal&amp;nbsp;&amp;nbsp;&amp;nbsp; elements and attributes.&lt;/div&gt;
&lt;div class=&quot;intro&quot; style=&quot;color: black;&quot;&gt;
A DTD can be defined&amp;nbsp; inside a&amp;nbsp;
XML document, or a&amp;nbsp; external reference can be declared&amp;nbsp;.&lt;/div&gt;
&lt;h3 style=&quot;color: black;&quot;&gt;
Internal DTD&amp;nbsp;&lt;/h3&gt;
&lt;div style=&quot;color: black;&quot;&gt;
If the DTD is defined inside the XML document, it
should be wrapped in a DOCTYPE definition with the following syntax:&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;!DOCTYPE root-element [element-declarations]&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
Example of a XML document with an internal DTD: &lt;b&gt;E-mail.xml&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;
&amp;lt;!DOCTYPE E-mail[
  &amp;lt;!ELEMENT E-mail (To,From,subject,Body)&amp;gt;
  &amp;lt;!ELEMENT To (#PCDATA)&amp;gt;
  &amp;lt;!ELEMENT From (#PCDATA)&amp;gt;
  &amp;lt;!ELEMENT Subject (#PCDATA)&amp;gt;
  &amp;lt;!ELEMENT Body (#PCDATA)&amp;gt;
]&amp;gt;
&amp;lt;E-mail&amp;gt;
&amp;lt;To&amp;gt;Rohan&amp;lt;/To&amp;gt;
&amp;lt;From&amp;gt;Amit&amp;lt;/From&amp;gt;
&amp;lt;Subject&amp;gt;Surprise....&amp;lt;/Subject&amp;gt;
&amp;lt;Body&amp;gt;Be ready for a cruise...i will 
catch u&amp;nbsp; tonight&amp;lt;/Body&amp;gt;
&amp;lt;/E-mail&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;span style=&quot;color: navy;&quot;&gt;&lt;br /&gt;
&lt;b&gt;Open the file E-mail.xml in a web-browser . you will see&amp;nbsp; the following :&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 200px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td&gt;&lt;img border=&quot;0&quot; height=&quot;279&quot; src=&quot;http://www.roseindia.net/xml/xml-pic1.gif&quot; width=&quot;449&quot; /&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;External DTD&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
If the DTD is defined in an external &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML_DTD.shtml#&quot; id=&quot;KonaLink2&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;file&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;, it should be
wrapped in a DOCTYPE definition with the following syntax:&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;100%&quot;&gt;
        &lt;pre&gt;&amp;lt;!DOCTYPE root-element SYSTEM &quot;filename&quot;&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
This is the same XML document as above,(but with an
external DTD&amp;nbsp;) : &lt;b&gt; E-mail.xml&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black; width: 360px;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;354&quot;&gt;
        &lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;
&amp;lt;!DOCTYPE E-mail SYSTEM 
&quot;E-mail.dtd&quot;&amp;gt;
&amp;lt;E-mail&amp;gt;
&amp;lt;To&amp;gt;Rohan&amp;lt;/To&amp;gt;
&amp;lt;From&amp;gt;Amit&amp;lt;/From&amp;gt;
&amp;lt;Subject&amp;gt;Surprise....&amp;lt;/Subject&amp;gt;
&amp;lt;Body&amp;gt;Be ready for a cruise...i will 
catch u&amp;nbsp; tonight&amp;lt;/Body&amp;gt;
&amp;lt;/E-mail&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;And this is the file &quot;E-mail.dtd&quot; which
contains the following DTD:&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black; width: 360px;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;354&quot;&gt;
        &lt;pre&gt;&amp;lt;!ELEMENT E-mail (To,From,subject,Body)&amp;gt;
&amp;lt;!ELEMENT To (#PCDATA)&amp;gt;
&amp;lt;!ELEMENT From (#PCDATA)&amp;gt;
&amp;lt;!ELEMENT Subject (#PCDATA)&amp;gt;
&amp;lt;!ELEMENT Body (#PCDATA)&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;span style=&quot;color: navy;&quot;&gt;&lt;br /&gt;
&lt;b&gt;Open the file E-mail.xml in a web-browser. It will display the following :&lt;br /&gt;
&lt;/b&gt;
&lt;/span&gt;
&lt;div align=&quot;left&quot; style=&quot;color: black;&quot;&gt;

  &lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 200px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td&gt;&lt;img border=&quot;0&quot; height=&quot;279&quot; src=&quot;http://www.roseindia.net/xml/xml-pic1.gif&quot; width=&quot;449&quot; /&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Importance of a DTD?&lt;/b&gt;&lt;/div&gt;
&lt;ul style=&quot;color: black;&quot;&gt;
&lt;li&gt;With a DTD, a XML file carries a description of its
    own format.&lt;/li&gt;
&lt;li&gt;With a DTD, independent groups of people can agree
    to use a standard DTD for interchanging data.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;User &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML_DTD.shtml#&quot; id=&quot;KonaLink3&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;application&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; can use a standard DTD to
    verify that the data he receives from the outside world is valid.&lt;/li&gt;
&lt;li&gt;User can also use a DTD to verify his own data.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/7847369637710621171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/7847369637710621171'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/04/dtddocument-type-definition.html' title='DTD:Document Type Definition'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-2004866784847910302</id><published>2011-04-02T00:04:00.000-07:00</published><updated>2011-04-02T00:04:09.093-07:00</updated><title type='text'>XML Validation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: black;&quot;&gt;
XML with correct syntax is &lt;b&gt;Well Formed XML&lt;/b&gt;.
&lt;/div&gt;
&lt;div class=&quot;intro&quot; style=&quot;color: black;&quot;&gt;
XML validated against a DTD or a
Schema&amp;nbsp; is a &lt;b&gt;Valid XML.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;Well Formed XML Documents&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
A &quot;Well Formed&quot; XML &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML-Validation.shtml#&quot; id=&quot;KonaLink1&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;background-color: transparent; border-bottom: 1px solid blue; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;document&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; has correct XML
syntax.&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
A &quot;Well Formed&quot; &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML-Validation.shtml#&quot; id=&quot;KonaLink2&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;background-color: transparent; border-bottom: 1px solid blue; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;XML &lt;/span&gt;&lt;span class=&quot;kLink&quot; style=&quot;background-color: transparent; border-bottom: 1px solid blue; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;document&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; is a document
that conforms to the XML syntax rules that were described in the previous
chapters:&lt;/div&gt;
&lt;ul style=&quot;color: black;&quot;&gt;
&lt;li&gt;XML documents must have a root element
  &lt;/li&gt;
&lt;li&gt;XML elements must have a closing tag
  &lt;/li&gt;
&lt;li&gt;&lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML-Validation.shtml#&quot; id=&quot;KonaLink3&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;XML &lt;/span&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;tags&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; are case sensitive
  &lt;/li&gt;
&lt;li&gt;XML elements must be properly nested
  &lt;/li&gt;
&lt;li&gt;XML attribute values must always be quoted&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black; width: 350px;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;344&quot;&gt;
        &lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;
&amp;lt;E-mail&amp;gt;
&amp;lt;To&amp;gt;Rohan&amp;lt;/To&amp;gt;
&amp;lt;From&amp;gt;Amit&amp;lt;/From&amp;gt;
&amp;lt;Subject&amp;gt;Surprise....&amp;lt;/Subject&amp;gt;
&amp;lt;Body&amp;gt;Be ready for a cruise...i will catch u&amp;nbsp; tonight&amp;lt;/Body&amp;gt;
&amp;lt;/E-mail&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;span style=&quot;color: navy;&quot;&gt;&lt;br /&gt;
&lt;b&gt;Valid XML Documents:&lt;/b&gt;
&lt;/span&gt;
&lt;div style=&quot;color: black;&quot;&gt;
A &quot;Valid&quot; XML document is a &quot;Well
Formed&quot; XML document, which also conforms to the rules of a Document Type
Definition (DTD) or a &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML-Validation.shtml#&quot; id=&quot;KonaLink4&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;XML &lt;/span&gt;&lt;span class=&quot;kLink&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;Schema&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; .&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;The following xml document is validated against a DTD ,
notice the highlighted text.&lt;/b&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;ex&quot; style=&quot;color: black; width: 486px;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;480&quot;&gt;
        &lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;
&lt;b&gt;&amp;lt;!DOCTYPE e-mail SYSTEM &quot;InternalE-mail.dtd&quot;&amp;gt;&lt;/b&gt;
&amp;lt;E-mail&amp;gt;
&amp;lt;To&amp;gt;Rohan&amp;lt;/To&amp;gt;
&amp;lt;From&amp;gt;Amit&amp;lt;/From&amp;gt;
&amp;lt;Subject&amp;gt;Surprise....&amp;lt;/Subject&amp;gt;
&amp;lt;Body&amp;gt;Be ready for a cruise...i will catch u&amp;nbsp; tonight&amp;lt;/Body&amp;gt;
&amp;lt;/E-mail&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: black;&quot; /&gt;
&lt;b style=&quot;color: black;&quot;&gt;XML DTD&lt;/b&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;A DTD defines the legal elements of an XML document.&lt;/b&gt;
The purpose of a DTD is to define the legal building
blocks of an XML document. It defines the document structure with a list of
legal elements. &lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;XML Schema&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;XML Schema is an XML based alternative to DTD&amp;nbsp;&lt;/b&gt;.W3C supports an alternative to DTD called XML Schema. &lt;/div&gt;
&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/2004866784847910302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/2004866784847910302'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/04/xml-validation.html' title='XML Validation'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-5188116151640461022</id><published>2011-04-01T23:58:00.000-07:00</published><updated>2011-04-01T23:58:09.313-07:00</updated><title type='text'>XML Syntax Rules</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;intro&quot;&gt;
&lt;span style=&quot;color: navy;&quot;&gt;The syntax&amp;nbsp; rules&amp;nbsp; for&amp;nbsp;
XML are very simple and strict. These&amp;nbsp; are&amp;nbsp; easy to learn and&amp;nbsp; use.
Because of this, creating software that can read and manipulate XML is very
easy. Xml enables an user to create&amp;nbsp; his own tags.&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;Note - &lt;span style=&quot;font-size: small;&quot;&gt;XML documents use a
self-describing and simple syntax&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: navy;&quot;&gt;Let&#39;s develop a simple XML &lt;a class=&quot;kLink&quot; href=&quot;http://www.roseindia.net/xml/XML-SyntaxRules.shtml#&quot; id=&quot;KonaLink2&quot; style=&quot;font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static; text-decoration: underline ! important;&quot;&gt;&lt;span style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;color: blue ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: relative;&quot;&gt;document&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; :&lt;/span&gt;&lt;br /&gt;

&lt;div align=&quot;left&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; height=&quot;144&quot; style=&quot;width: 392px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td height=&quot;144&quot; width=&quot;390&quot;&gt;&lt;span style=&quot;color: navy;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot;
        encoding=&quot;ISO-8859-1&quot;?&amp;gt;&lt;br /&gt;
        &amp;lt;E-mail&amp;gt;&lt;br /&gt;
        &amp;lt;To&amp;gt;Rohan&amp;lt;/To&amp;gt;&lt;br /&gt;
        &amp;lt;From&amp;gt;Amit&amp;lt;/From&amp;gt;&lt;br /&gt;
        &amp;lt;Subject&amp;gt;Surprise....&amp;lt;/Subject&amp;gt;&lt;br /&gt;
        &amp;lt;Body&amp;gt;Be ready for a cruise...i will catch u&amp;nbsp; tonight&amp;lt;/Body&amp;gt;&lt;br /&gt;
        &amp;lt;/E-mail&amp;gt;&lt;br /&gt;
        &lt;/span&gt;
        &lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;The XML declaration:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;b&gt;&amp;nbsp;
&lt;/b&gt;Always the first line in the xml document:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;

&lt;i&gt;T&lt;span style=&quot;color: navy;&quot;&gt;he XML declaration&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: navy;&quot;&gt;
should always be included. It defines the XML version and the character encoding
used in the document. In this case the document conforms to the 1.0
specification of&amp;nbsp; XML and uses the ISO-8859-1 (Latin-1/West European)
character set.&lt;/span&gt;&lt;br /&gt;

&lt;div align=&quot;left&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 377px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;375&quot;&gt;&lt;span style=&quot;color: navy;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot;
        encoding=&quot;ISO-8859-1&quot;?&amp;gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;span style=&quot;color: navy;&quot;&gt;&lt;b&gt;Root Element: &lt;/b&gt;The next line defines the first
element of the document . It is called as the root element&amp;nbsp;&lt;/span&gt;&lt;br /&gt;

&lt;div align=&quot;left&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 200px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td&gt;&lt;span style=&quot;color: navy;&quot;&gt;&amp;lt;E-mail&amp;gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;span style=&quot;color: navy;&quot;&gt;&lt;b&gt;Child Elements: &lt;/b&gt;The next 4 lines describe the
four child elements of the root (To, From, Subject and Body).&lt;/span&gt;&lt;br /&gt;

&lt;div align=&quot;left&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 376px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;374&quot;&gt;&lt;span style=&quot;color: navy;&quot;&gt;&amp;lt;To&amp;gt;Rohan&amp;lt;/To&amp;gt;&lt;br /&gt;
        &amp;lt;From&amp;gt;Amit&amp;lt;/From&amp;gt;&lt;br /&gt;
        &amp;lt;Subject&amp;gt;Surprise....&amp;lt;/Subject&amp;gt;&lt;br /&gt;
        &amp;lt;Body&amp;gt;Be ready for a cruise...i will catch u&amp;nbsp; tonight&amp;lt;/Body&amp;gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;span style=&quot;color: navy;&quot;&gt;And finally the last line defines the end of the root
element .&lt;/span&gt;&lt;br /&gt;

&lt;div align=&quot;left&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 200px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td&gt;&lt;span style=&quot;color: navy;&quot;&gt;&amp;lt;/E-mail&amp;gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;span style=&quot;color: navy;&quot;&gt;you may feel from this example that the XML document
contains a&amp;nbsp; E-mail To Rohan&amp;nbsp; From Amit. Don&#39;t you agree that XML is quite
self-descriptive?&lt;/span&gt;&lt;br /&gt;

&lt;span style=&quot;color: navy;&quot;&gt;Now let&#39;s discuss its syntax-rules which are very
simple to learn.&lt;/span&gt;&lt;br /&gt;

&lt;h3&gt;
&lt;span style=&quot;color: navy;&quot;&gt;All XML elements must have a closing tag&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;color: navy;&quot;&gt;In XML all the elements must have a closing tag like
this:&lt;/span&gt;&lt;br /&gt;

&lt;div align=&quot;left&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 284px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;282&quot;&gt;&lt;span style=&quot;color: navy;&quot;&gt;&amp;lt;To&amp;gt;Rohan&amp;lt;/To&amp;gt;&lt;br /&gt;
        &amp;lt;From&amp;gt;Amit&amp;lt;/From&amp;gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;h3&gt;
&lt;span style=&quot;color: navy;&quot;&gt;XML tags are case sensitive&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;color: navy;&quot;&gt;XML tags are case sensitive. The tag &amp;lt;To&amp;gt; is
different from the tag &amp;lt;to&amp;gt;.Hence the opening and closing tags must&amp;nbsp;
be written with the same case:&lt;/span&gt;&lt;br /&gt;

&lt;div align=&quot;left&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 200px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td&gt;&lt;span style=&quot;color: navy;&quot;&gt;&amp;lt;To&amp;gt;Rohan&amp;lt;/To&amp;gt;&lt;br /&gt;
        &amp;lt;to&amp;gt;Rohan&amp;lt;/to&amp;gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;h3&gt;
&lt;span style=&quot;color: navy;&quot;&gt;XML Elements Must be Properly Nested&lt;/span&gt;&lt;/h3&gt;
&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;Improper nesting of tags makes no sense to XML. &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: navy;&quot;&gt;In
XML all elements must be properly nested within each other like this in a
logical order:&lt;/span&gt;&lt;br /&gt;

&lt;div align=&quot;left&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 320px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;318&quot;&gt;&lt;span style=&quot;color: navy;&quot;&gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Hi , how are
        you.....&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;h3&gt;
&lt;span style=&quot;color: navy;&quot;&gt;XML Documents Must Have a Root Element&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;color: navy;&quot;&gt;All XML documents must contain a single tag pair to
define a root element. All other elements must be written within this root
element. All elements can have sub elements called as child elements. Sub
elements must be correctly nested within their parent element:&lt;/span&gt;&lt;br /&gt;

&lt;div align=&quot;left&quot;&gt;

  &lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 200px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
      &lt;td&gt;&lt;span style=&quot;color: navy;&quot;&gt;&amp;lt;root&amp;gt;&lt;br /&gt;
        &amp;nbsp; &amp;lt;child&amp;gt;&lt;br /&gt;
        &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;subchild&amp;gt;.....&amp;lt;/subchild&amp;gt;&lt;br /&gt;
        &amp;nbsp; &amp;lt;/child&amp;gt;&lt;br /&gt;
        &amp;lt;/root&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;h3&gt;
&lt;span style=&quot;color: navy;&quot;&gt;Always Quote the XML Attribute Values&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;color: navy;&quot;&gt;In XML the attribute value must always be quoted&lt;b&gt;.&amp;nbsp;&lt;/b&gt;XML
elements can have attributes in name/value pairs just like in HTML. Just look
the two XML documents below.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;

&lt;span style=&quot;color: navy;&quot;&gt;The error in the first document is that the date and
version attributes are not quoted .&lt;/span&gt;
&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; class=&quot;ex&quot; style=&quot;width: 355px;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;347&quot;&gt;
        &lt;pre&gt;&lt;span style=&quot;color: navy;&quot;&gt;&amp;lt;?xml version=1.0 encoding=&quot;ISO-8859-1&quot;?&amp;gt;
&amp;lt;E-mail date=12/11/2002/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;span style=&quot;color: navy;&quot;&gt;The second document is correct:&lt;/span&gt;&lt;br /&gt;

&lt;table bgcolor=&quot;#ffffcc&quot; border=&quot;1&quot; class=&quot;ex&quot; style=&quot;width: 356px;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
      &lt;td width=&quot;348&quot;&gt;
        &lt;pre&gt;&lt;span style=&quot;color: navy;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;
&amp;lt;E-mail date=&quot;12/11/2002&quot;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;
&lt;span style=&quot;color: navy;&quot;&gt;&lt;b&gt;With XML, White Space is Preserved&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;color: navy;&quot;&gt;With XML, the white space in a document is&amp;nbsp;
preserved .&lt;/span&gt;&lt;br /&gt;

&lt;span style=&quot;color: navy;&quot;&gt;So a sentence like this :&amp;nbsp;&amp;nbsp;&lt;b&gt; Hello&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
How are you,&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: navy;&quot;&gt;will be displayed like this:&lt;/span&gt;&lt;br /&gt;


  
    
      &lt;span style=&quot;color: navy;&quot;&gt;Hello&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
        How are you,&lt;/span&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/5188116151640461022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/5188116151640461022'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/04/xml-syntax-rules.html' title='XML Syntax Rules'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-6534526191147825638</id><published>2011-04-01T23:53:00.000-07:00</published><updated>2011-04-01T23:55:36.877-07:00</updated><title type='text'>Comparing  XML with HTML</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
The Main Differences Between XML and HTML&lt;br /&gt;
&lt;br /&gt;
XML is designed to carry data.&lt;br /&gt;
&lt;br /&gt;
XML  describes and  focuses on the data  while HTML only displays and focuses on how data looks. HTML is all about displaying information but XML is all about describing information. In current scenario XML is the most common tool for  data manipulation and data transmission.&lt;br /&gt;
&lt;br /&gt;
XML is used to store data in files and for sharing data between diverse applications. Unlike  HTML document where data and display logic are available in the same file, XML hold only data. Different presentation logics could be applied to display the xml data in the required format. XML is the best way to exchange information.&lt;br /&gt;
XML tags are not predefined. User must &quot;invent&quot; his tags.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
XML allows the user to define his own tags and document structure.&lt;br /&gt;
&lt;br /&gt;
XML Tags are Case Sensitive&lt;br /&gt;
&lt;br /&gt;
Unlike HTML, XML tags are case sensitive. In HTML the following will work:&lt;br /&gt;
&lt;message&gt;This is incorrect&lt;/message&gt;&lt;br /&gt;
&lt;br /&gt;
In XML opening and closing tags must therefore be written with the same case:&lt;br /&gt;
&lt;br /&gt;
&lt;message&gt;This is correct&lt;/message&gt;&lt;b&gt;&lt;i&gt;This text is bold and italic&lt;/i&gt;&lt;/b&gt;&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
In XML all elements must be properly nested within each other like this:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;This text is bold and italic&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
XML is a Complement to HTML&lt;br /&gt;
&lt;br /&gt;
XML is not a replacement for HTML.&lt;br /&gt;
&lt;br /&gt;
It is important to understand that XML is not a replacement for HTML. In  Web development it is most likely that XML will be used to describe the data, while HTML will be used to format and display the same data.&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/6534526191147825638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/6534526191147825638'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/04/comparing-xml-with-html.html' title='Comparing  XML with HTML'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-3742565960772998271</id><published>2011-04-01T23:49:00.000-07:00</published><updated>2011-04-01T23:49:22.191-07:00</updated><title type='text'>XML: An Introduction - Brief History</title><content type='html'>In the 1970’s,  Charles Goldfarb, Ed Mosher and Ray Lorie invented GML at IBM. GML was used to describe a way of marking up technical documents with structural tags. The initials stood for Goldfarb, Mosher and Lorie.&lt;br /&gt;
&lt;br /&gt;
Goldfarb invented the term “mark-up language”  to make better use of the initials and it became the Standard Generalised Markup Language .&lt;br /&gt;
&lt;br /&gt;
In 1986 , SGML was adopted by the ISO .&lt;br /&gt;
&lt;br /&gt;
SGML is just a specification for defining markup languages.&lt;br /&gt;
&lt;br /&gt;
SGML (Standardized Generalized Markup Language) is the mother of all markup languages like HTML, XML, XHTML, WML etc...&lt;br /&gt;
&lt;br /&gt;
 In 1986, SGML became an international standard for defining the markup languages. It was used to create other languages, including HTML, which is very popular for its use on the web. HTML was made by Tim Berners Lee in 1991.&lt;br /&gt;
&lt;br /&gt;
While on one hand SGML is very effective but complex, on the other, HTML is very easy, but limited to a fixed set of tags. This situation raised the need for a language that was as effective as SGML and at the same time as simple as HTML. This gap has now been filled by XML.&lt;br /&gt;
&lt;br /&gt;
The development of XML started in 1996 at Sun Microsystems.  Jon Bosak with his team  began work on a project for remoulding  SGML. They took the best of SGML and produced something to be powerful, but much simpler to use.&lt;br /&gt;
&lt;br /&gt;
The World Wide Web Consortium also contributes to the creation and development of the standard for XML. The specifications for XML were laid down in just 26 pages</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3742565960772998271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3742565960772998271'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/04/xml-introduction-brief-history.html' title='XML: An Introduction - Brief History'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-1641967924124207263</id><published>2011-04-01T23:48:00.000-07:00</published><updated>2011-04-01T23:48:16.181-07:00</updated><title type='text'>How Can You Use XML?</title><content type='html'>Few Applications of XML&lt;br /&gt;
&lt;br /&gt;
Although there are countless  applications that use XML, here are a few examples of the  applications that are making use of this technology.&lt;br /&gt;
&lt;br /&gt;
Refined search results - With XML-specific tags, search engines can give users more refined search results. A search engine seeks the term in the tags, rather than the entire document, giving the user more precise results.&lt;br /&gt;
&lt;br /&gt;
EDI Transactions - XML has  made electronic data interchange (EDI) transactions accessible to a broader set of users. XML  allows data to be exchanged, regardless of the computing systems or accounting applications being used.&lt;br /&gt;
&lt;br /&gt;
Cell Phones - XML data is sent to some cell phones, which is then formatted by the specification of the cell phone software designer to display text, images and even play sounds!&lt;br /&gt;
File Converters - Many applications have been written to convert existing documents into the XML standard. An example is a PDF to XML converter.&lt;br /&gt;
&lt;br /&gt;
VoiceXML - Converts XML documents into an audio format so that a user can listen to an XML document.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/1641967924124207263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/1641967924124207263'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/04/how-can-you-use-xml.html' title='How Can You Use XML?'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-1787983947710640193</id><published>2011-04-01T23:46:00.001-07:00</published><updated>2011-04-01T23:46:43.438-07:00</updated><title type='text'>XML--What is XML?</title><content type='html'>&quot;XML is a cross-platform, software and hardware independent tool for transmitting information&quot;&lt;br /&gt;
&lt;br /&gt;
XML is a W3C Recommendations. It stands for Extensible Markup Language . It  is a markup language much like HTML used to describe data. In XML, tags are not predefined. A user  defines his own tags and XML document structure like Document Type Definition (DTD) , XML Schema to describe the data. Hence it is self-descriptive too.There is Nothing Special About XML It is just plain text with the addition of some XML tags enclosed in angle brackets. In a simple text  editor, the XML document is easily visible .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Why Is XML So Important?&lt;br /&gt;
&lt;br /&gt;
There are number of reasons that contributes to the  XML&#39;s  increasing acceptance , few of them are:&lt;br /&gt;
&lt;br /&gt;
Plain Text&lt;br /&gt;
&lt;br /&gt;
In XML it is easy to create and edit files with anything from a standard text editor to a visual development environment. XML also provides scalability for anything from small configuration files to a company-wide data repository.&lt;br /&gt;
&lt;br /&gt;
Data Identification&lt;br /&gt;
&lt;br /&gt;
The markup tags in XML documents identifiy the information and break up the data into parts for example.. a search program can look for messages sent to particular people from the rest of the message. Different parts of the information are  identified and further  they can be used in different ways by different applications.&lt;br /&gt;
&lt;br /&gt;
Stylability&lt;br /&gt;
&lt;br /&gt;
When display  matters, the stylesheet standard, XSL (an advance feature of  XML), lets you dictate over the convectional designs ( like using HTML)  to portray the data. XML being style-free, uses  different stylesheets  to produce output in postscript, TEX, PDF, or some new format that hasn&#39;t even been invented yet. A user can use a simple XML document  to display data in diverse  formats like&lt;br /&gt;
&lt;br /&gt;
    * a plain text file&lt;br /&gt;
    * an XHTML file&lt;br /&gt;
    * a WML (Wireless Markup Language) document suitable for display on a PDA&lt;br /&gt;
    * an Adobe PDF document suitable for hard copy&lt;br /&gt;
    * a VML (Voice Markup Language) dialog for a voicemail information system&lt;br /&gt;
    * an SVG (Scalable Vector Graphic) document that draws pictures of thermometers and water containers&lt;br /&gt;
&lt;br /&gt;
Universally Processed&lt;br /&gt;
&lt;br /&gt;
Apart from being valid , restrictions are imposed on a xml file to abide by a DTD or a Schema  to make it well-formed .Otherwise, the XML parser won&#39;t be able to read the data. XML is a vendor-neutral standard, so a user can choose among several XML parsers to  process XML data.&lt;br /&gt;
&lt;br /&gt;
Hierarchical Approach&lt;br /&gt;
&lt;br /&gt;
XML documents get benefitted from their hierarchical structure. Hierarchical document structures are, faster to access. They are also easier to rearrange, because each piece is delimited. This makes xml files easy to  modify and maintain.&lt;br /&gt;
&lt;br /&gt;
Inline Reusabiliy&lt;br /&gt;
&lt;br /&gt;
XML documents  can be composed of separate entities. XML entities can be included &quot;in line&quot; in a XML document. And this included sections look like a normal part of the document .A user can single-source a section so that an edit to it is reflected everywhere the section is used, and yet a document composed  looks  like a one-piece document.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/1787983947710640193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/1787983947710640193'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/04/xml-what-is-xml.html' title='XML--What is XML?'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-2579939131296178915</id><published>2011-02-24T08:34:00.000-08:00</published><updated>2011-02-24T08:34:01.321-08:00</updated><title type='text'>I have two textboxes as TextBox1 and TextBox2 and a checkbox also on the form</title><content type='html'>&lt;!--&lt;input type=&quot;text&quot; id=&quot;t1&quot; onkeyup=&quot;document.getElementById(&#39;t2&#39;).value = this.value&quot; /&gt;&lt;br /&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;&quot; onclick=&quot;function();&quot;&gt;copy value&lt;/input&gt;&lt;br /&gt;
&lt;input type=&quot;text&quot; id=&quot;t2&quot; /&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;script&gt;
function()
{
var t1 = document.getElementById(&#39;t1&#39;);
t1.onkeyup = t1.onchange = function() {
    document.getElementById(&#39;t2&#39;).value = this.value;
};
}
&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
 --&gt;&lt;br /&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;br /&gt;
 	&lt;head runat=&quot;server&quot;&gt;&lt;br /&gt;
 	  &lt;title&gt;Test Page&lt;/title&gt;&lt;br /&gt;
 	 &lt;/head&gt;&lt;body&gt;&lt;br /&gt;
	 &lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------&lt;br /&gt;
 	 &lt;form id=&quot;form1&quot;&gt; 	 &lt;script type=&quot;text/javascript&quot;&gt;
 	    function CopyText() {
	        var cb = document.getElementById(&#39;CheckBox1&#39;);   
	        var tb1 = document.getElementById(&#39;TextBox1&#39;);  
	        var tb2 = document.getElementById(&#39;TextBox2&#39;);   
			var tb3 = document.getElementById(&#39;TextBox3&#39;);  
	        var tb4 = document.getElementById(&#39;TextBox4&#39;); 

 
	        var tb1c = document.getElementById(&#39;TextBox1c&#39;);  
	        var tb2c = document.getElementById(&#39;TextBox2c&#39;);   
			var tb3c = document.getElementById(&#39;TextBox3c&#39;);  
	        var tb4c = document.getElementById(&#39;TextBox4c&#39;); 			
			
	         
	        if (cb.checked)        {   
	        tb1c.value = tb1.value;
			tb2c.value = tb2.value;
			tb3c.value = tb3.value;
			tb4c.value = tb4.value;
			
			}    
	        else        {   
	        tb1c.value = &#39;&#39;;  
			tb2c.value = &#39;&#39;;  
			tb3c.value = &#39;&#39;;  
			tb4c.value = &#39;&#39;;  
			}
	   }  
	   &lt;/script&gt;  &lt;br /&gt;
	   &lt;div&gt;   &lt;br /&gt;
   &lt;br /&gt;
	     &lt;input type=&quot;text&quot; ID=&quot;TextBox1&quot; &gt;&lt;/input&gt; &lt;br/&gt;&lt;br/&gt;&lt;br /&gt;
		 &lt;br /&gt;
	     &lt;input type=&quot;text&quot; ID=&quot;TextBox2&quot; &gt;&lt;/input&gt;&lt;br/&gt;&lt;br/&gt;&lt;br /&gt;
		 &lt;br /&gt;
	     &lt;input type=&quot;text&quot; ID=&quot;TextBox3&quot; &gt;&lt;/input&gt;&lt;br/&gt;&lt;br/&gt;&lt;br /&gt;
		 &lt;br /&gt;
	     &lt;input type=&quot;text&quot; ID=&quot;TextBox4&quot; &gt;&lt;/input&gt;&lt;br/&gt;&lt;br/&gt;&lt;br /&gt;
		 &lt;br /&gt;
 	     &lt;input type=&quot;CheckBox&quot; ID=&quot;CheckBox1&quot;  Text=&quot;Copy&quot; OnClick=&quot;CopyText()&quot;&gt; copy value below&lt;/input&gt;&lt;br/&gt;&lt;br/&gt;&lt;br /&gt;
	     &lt;input type=&quot;text&quot; ID=&quot;TextBox1c&quot;&gt;&lt;/input&gt;&lt;br/&gt;&lt;br/&gt;&lt;br /&gt;
 &lt;input type=&quot;text&quot; ID=&quot;TextBox2c&quot;&gt;&lt;/input&gt;   &lt;br/&gt;&lt;br/&gt;&lt;br /&gt;
 &lt;input type=&quot;text&quot; ID=&quot;TextBox3c&quot;&gt;&lt;/input&gt;   &lt;br/&gt;&lt;br/&gt;&lt;br /&gt;
 &lt;input type=&quot;text&quot; ID=&quot;TextBox4c&quot;&gt;&lt;/input&gt; &lt;br/&gt; 	&lt;br/&gt;	 &lt;br /&gt;
	   &lt;/div&gt;	 &lt;/form&gt;	 &lt;/body&gt;&lt;br /&gt;
	 &lt;/html&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/2579939131296178915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/2579939131296178915'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/02/i-have-two-textboxes-as-textbox1-and.html' title='I have two textboxes as TextBox1 and TextBox2 and a checkbox also on the form'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-3926886546836154555</id><published>2011-01-07T01:58:00.001-08:00</published><updated>2011-01-07T02:00:12.695-08:00</updated><title type='text'>Struts 2 Theme &amp; Template</title><content type='html'>Please click the link:&lt;br /&gt;
&lt;a href=&quot;http://www.mkyong.com/struts2/working-with-struts-2-theme-template/&quot;&gt;Working with Struts 2 Theme &amp; Template&lt;br /&gt;
 &lt;/a&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3926886546836154555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3926886546836154555'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/01/working-with-struts-2-theme-template.html' title='Struts 2 Theme &amp; Template'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-3895875929955627601</id><published>2011-01-07T01:49:00.000-08:00</published><updated>2011-01-07T01:49:26.588-08:00</updated><title type='text'>Struts Tiles</title><content type='html'>Tiles is a framework for the development user interface. Tiles is enables the developers to develop the web applications by assembling the reusable tiles (jsp, html, etc..). Tiles uses the concept of reuse and enables the developers to define a template for the web site and then use this layout to populate the content of the web site. For example, if you have to develop a web site having more that 500 page of static content and many dynamically generated pages. The layout of the web site often changes according to the business requirement. In this case you can use the Tiles framework to design the template for the web site and use this template to populate the contents. In future if there is any requirement of site layout change then you have to change the layout in one page. This will change the layout of you whole web site.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
Steps To Create Tiles Application&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Tiles is very useful framework for the development of web applications. Here are the steps necessary for adding Tiles to your Struts application:&lt;br /&gt;
&lt;br /&gt;
   1. Add the Tiles Tag Library Descriptor (TLD) file to the web.xml.&lt;br /&gt;
   2. Create layout JSPs.&lt;br /&gt;
   3. Develop the web pages using layouts.&lt;br /&gt;
   4. Repackage, run and test application.&lt;br /&gt;
&lt;br /&gt;
Add the Tiles TLD to web.xml file&lt;br /&gt;
Tiles can can be used with or without Struts. Following entry is required in the web.xml file before you can use the tiles tags in your application.&lt;br /&gt;
&lt;taglib&gt;&lt;br /&gt;
     &lt;taglib-uri&gt;/tags/struts-tiles&lt;/taglib-uri&gt;&lt;br /&gt;
      &lt;taglib-location&gt;/WEB-INF/struts-tiles.tld&lt;/taglib-location&gt;&lt;br /&gt;
&lt;/taglib&gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
Create layout JSPs.&lt;br /&gt;
Our web application layout is divided into four parts: To Banner, Left Navigation Bar, Content Area and Bottom of the page for copy right information. Here is the code for out template (template.jsp):&lt;br /&gt;
&lt;%@ page language=&quot;java&quot; %&gt;&lt;br /&gt;
&lt;%@ taglib uri=&quot;/WEB-INF/struts-tiles.tld&quot; prefix=&quot;tiles&quot; %&gt;&lt;br /&gt;
&lt;html&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;head&gt;&lt;br /&gt;
    &lt;title&gt;&lt;tiles:getAsString name=&quot;title&quot; ignore=&quot;true&quot;/&gt;&lt;/title&gt;&lt;br /&gt;
&lt;/head&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;body&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot; bordercolor=&quot;#000000&quot; bgcolor=&quot;#E7FDFE&quot;&gt;&lt;tr&gt;
&lt;td width=&quot;100%&quot; colspan=&quot;2&quot; valign=&quot;top&quot;&gt;&lt;tiles:insert attribute=&quot;header&quot;/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width=&quot;23%&quot;&gt;&lt;tiles:insert attribute=&quot;menu&quot;/&gt;&lt;/td&gt;
&lt;td width=&quot;77%&quot; valign=&quot;top&quot; valign=&quot;top&quot;&gt;&lt;tiles:insert attribute=&quot;body&quot;/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width=&quot;100%&quot; colspan=&quot;2&quot; valign=&quot;top&quot;&gt;&lt;tiles:insert attribute=&quot;bottom&quot;/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
&lt;/body&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/html&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3895875929955627601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3895875929955627601'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/01/struts-tiles.html' title='Struts Tiles'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-1633447807609109443</id><published>2011-01-07T01:46:00.000-08:00</published><updated>2011-01-07T01:46:16.937-08:00</updated><title type='text'>Custom Validators in STRUTS</title><content type='html'>Struts Validator framework provides many validation rules that can be used in the web applications. If you application needs special kind of validation, then you can extend the validator framework to develop your own validation rule.&lt;br /&gt;
&lt;br /&gt;
The client-side validation in Struts is well known. Here are some of the available features:&lt;br /&gt;
&lt;br /&gt;
    * required&lt;br /&gt;
    * requiredif&lt;br /&gt;
    * validwhen&lt;br /&gt;
    * minlength&lt;br /&gt;
    * maxlength&lt;br /&gt;
    * mask&lt;br /&gt;
    * byte&lt;br /&gt;
    * short&lt;br /&gt;
    * integer&lt;br /&gt;
    * long&lt;br /&gt;
    * float&lt;br /&gt;
    * double&lt;br /&gt;
    * byteLocale&lt;br /&gt;
    * shortLocale&lt;br /&gt;
    * integerLocale&lt;br /&gt;
    * longLocale&lt;br /&gt;
    * floatLocale&lt;br /&gt;
    * doubleLocale&lt;br /&gt;
    * date&lt;br /&gt;
    * intRange&lt;br /&gt;
    * longRange&lt;br /&gt;
    * floatRange&lt;br /&gt;
    * doubleRange&lt;br /&gt;
    * creditCard&lt;br /&gt;
    * email&lt;br /&gt;
    * url&lt;br /&gt;
&lt;br /&gt;
These are found in the validator-rules.xml inside the &lt;validator&gt; tags. The validator-rules.xml file is found in the commons-validator jar.&lt;br /&gt;
&lt;br /&gt;
Let us know create a new validator for entering the name field of a form. The form should accept only &quot;administrator&quot; for the name field. To accomplish this edit the validator-rules.xml and add the following code under the &lt;global&gt; tag:&lt;br /&gt;
&lt;br /&gt;
        &lt;validator name=&quot;matchname&quot;
                   classname=&quot;org.apache.struts.validator.FieldChecks&quot;
                   method=&quot;validateName&quot;
                   methodParams=&quot;java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       org.apache.commons.validator.Validator,
                       javax.servlet.http.HttpServletRequest&quot;
                   msg=&quot;errors.name&quot;&gt;&lt;br /&gt;
        &lt;javascript&gt;&lt;![CDATA[
                function validateName(form) {
        var isValid = true;
        var focusField = null;
        var i = 0;
        var fields = new Array();

        var omatchName= eval(&#39;new &#39; + jcv_retrieveFormName(form) +  &#39;_matchname() &#39;);

        for (var x in omatchName) {
            if (!jcv_verifyArrayElement(x, omatchName[x])) {
                continue;
            }
            var field = form[omatchName[x][0]];

            if (!jcv_isFieldPresent(field)) {
                fields[i++] = omatchName[x][1];
                isValid=false;
                } else if (field.value != &quot;administrator&quot;) {
                        fields[i++]=omatchName[x][1];
                        isValid=false;
                }
        }
        
        if (fields.length &gt; 0) {&lt;br /&gt;
           jcv_handleErrors(fields, focusField);&lt;br /&gt;
        }&lt;br /&gt;
        return isValid;&lt;br /&gt;
        }&lt;br /&gt;
        ]]&gt;&lt;br /&gt;
        &lt;/javascript&gt;&lt;br /&gt;
        &lt;/validator&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/1633447807609109443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/1633447807609109443'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/01/custom-validators-in-struts.html' title='Custom Validators in STRUTS'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-5076573445131809040</id><published>2011-01-07T01:44:00.000-08:00</published><updated>2011-01-07T01:44:42.578-08:00</updated><title type='text'>Client Side Address Validation in Struts</title><content type='html'>   1.  Enabling the Validator plug-in: This makes the Validator available to the system.&lt;br /&gt;
   2. Create Message Resources for the displaying the error message to the user.&lt;br /&gt;
   3. Developing the Validation rules We have to define the validation rules in the validation.xml for the address form. Struts Validator Framework uses this rule for generating the JavaScript for validation.&lt;br /&gt;
   4. Applying the rules: We are required to add the appropriate tag to the JSP for generation of JavaScript.&lt;br /&gt;
   5. Build and test: We are required to build the application once the above steps are done before testing. &lt;br /&gt;
&lt;br /&gt;
Enabling the Validator plug- in&lt;br /&gt;
To enable the validator plug-in open the file struts-config.xml and make sure that following line is present in the file.&lt;br /&gt;
&lt;!--  Validator plugin --&gt;&lt;br /&gt;
&lt;plug-in className=&quot;org.apache.struts.validator.ValidatorPlugIn&quot;&gt;&lt;br /&gt;
          &lt;set-property
            property=&quot;pathnames&quot;
           value=&quot;/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml&quot;/&gt;&lt;br /&gt;
&lt;/plug-in&gt;&lt;br /&gt;
&lt;br /&gt;
Creating Message Resources&lt;br /&gt;
Message resources are used by the Validator Framework to generate the validation error messages. In our application we need to define the messages for name, Address and E-mail address. Open the Struts\strutstutorial\web\WEB-INF\MessageResources.properties file and add the following lines:&lt;br /&gt;
AddressForm.name=Name&lt;br /&gt;
AddressForm.address=Address&lt;br /&gt;
AddressForm.emailAddress=E-mail address&lt;br /&gt;
&lt;br /&gt;
Developing Validation rules&lt;br /&gt;
In this application we are adding only one validation that the fields on the form should not be blank.  Add the following code in the validation.xml. &lt;br /&gt;
&lt;!-- Address form Validation--&gt;&lt;br /&gt;
&lt;form name=&quot;AddressForm&quot;&gt;    &lt;field  property=&quot;name&quot;
          depends=&quot;required&quot;&gt;&lt;br /&gt;
         &lt;arg key=&quot;AddressForm.name&quot;/&gt;&lt;br /&gt;
    &lt;/field&gt;&lt;br /&gt;
    &lt;field  property=&quot;address&quot;
         depends=&quot;required&quot;&gt;&lt;br /&gt;
         &lt;arg key=&quot;AddressForm.address&quot;/&gt;&lt;br /&gt;
     &lt;/field&gt;&lt;br /&gt;
     &lt;field  property=&quot;emailAddress&quot;
         depends=&quot;required&quot;&gt;&lt;br /&gt;
        &lt;arg key=&quot;AddressForm.emailAddress&quot;/&gt;&lt;br /&gt;
     &lt;/field&gt;&lt;br /&gt;
&lt;/form&gt;&lt;br /&gt;
The above definition defines the validation for the form fields name, address and emailAddress. The attribute depends=&quot;required&quot; instructs the Validator Framework to generate the JavaScript that checks that the fields are not left blank. If the fields are left blank then JavaScript shows the error message. In the error message the message are taken from the key defined in the &lt;arg key=&quot;..&quot;/&gt; tag. The value of key is taken from the message resources (Struts\strutstutorial\web\WEB-INF\MessageResources.properties).&lt;br /&gt;
&lt;br /&gt;
Applying Validation rules to JSP&lt;br /&gt;
Now create the AddressJavascriptValidation.jsp file to test the application. The code for AddressJavascriptValidation.jsp is as follows:&lt;br /&gt;
&lt;%@ taglib uri=&quot;/tags/struts-bean&quot; prefix=&quot;bean&quot; %&gt;&lt;br /&gt;
&lt;%@ taglib uri=&quot;/tags/struts-html&quot; prefix=&quot;html&quot; %&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;html:html locale=&quot;true&quot;&gt;&lt;br /&gt;
&lt;head&gt;&lt;br /&gt;
    &lt;title&gt;&lt;bean:message key=&quot;welcome.title&quot;/&gt;&lt;/title&gt;&lt;br /&gt;
&lt;html:base/&gt;&lt;br /&gt;
&lt;/head&gt;&lt;br /&gt;
&lt;body bgcolor=&quot;white&quot;&gt;&lt;br /&gt;
&lt;html:form action=&quot;/AddressJavascriptValidation&quot; method=&quot;post&quot; onsubmit=&quot;return validateAddressForm(this);&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;left&quot;&gt;&lt;p&gt;This application shows the use of Struts Validator.&lt;br&gt;&lt;br /&gt;
The following form contains fields that are processed by Struts Validator.&lt;br&gt; &lt;br /&gt;
Fill in the form and see how JavaScript generated by Validator Framework validates the form.&lt;br /&gt;
&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;html:errors/&gt;&lt;br /&gt;
&lt;/p&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot; colspan=&quot;2&quot;&gt;&lt;br /&gt;
&lt;font size=&quot;4&quot;&gt;&lt;b&gt;Please Enter the Following Details&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
&lt;/tr&gt;&lt;br /&gt;
&lt;tr&gt;&lt;br /&gt;
&lt;td align=&quot;right&quot;&gt;&lt;br /&gt;
&lt;b&gt;Name&lt;/b&gt;&lt;br /&gt;
&lt;/td&gt;&lt;br /&gt;
&lt;td align=&quot;left&quot;&gt;&lt;br /&gt;
&lt;html:text property=&quot;name&quot; size=&quot;30&quot; maxlength=&quot;30&quot;/&gt;&lt;br /&gt;
&lt;/td&gt;&lt;br /&gt;
&lt;/tr&gt;&lt;br /&gt;
&lt;tr&gt;&lt;br /&gt;
&lt;td align=&quot;right&quot;&gt;&lt;br /&gt;
&lt;b&gt;Address&lt;/b&gt;&lt;br /&gt;
&lt;/td&gt;&lt;br /&gt;
&lt;td align=&quot;left&quot;&gt;&lt;br /&gt;
&lt;html:text property=&quot;address&quot; size=&quot;30&quot; maxlength=&quot;30&quot;/&gt;&lt;br /&gt;
&lt;/td&gt;&lt;br /&gt;
&lt;/tr&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;tr&gt;&lt;br /&gt;
&lt;td align=&quot;right&quot;&gt;&lt;br /&gt;
&lt;b&gt;E-mail address&lt;/b&gt;&lt;br /&gt;
&lt;/td&gt;&lt;br /&gt;
&lt;td align=&quot;left&quot;&gt;&lt;br /&gt;
&lt;html:text property=&quot;emailAddress&quot; size=&quot;30&quot; maxlength=&quot;30&quot;/&gt;&lt;br /&gt;
&lt;/td&gt;&lt;br /&gt;
&lt;/tr&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;tr&gt;&lt;br /&gt;
&lt;td align=&quot;right&quot;&gt;&lt;br /&gt;
&lt;html:submit&gt;Save&lt;/html:submit&gt;&lt;br /&gt;
&lt;/td&gt;&lt;br /&gt;
&lt;td align=&quot;left&quot;&gt;&lt;br /&gt;
&lt;html:cancel&gt;Cancel&lt;/html:cancel&gt;&lt;br /&gt;
&lt;/td&gt;&lt;br /&gt;
&lt;/tr&gt;&lt;br /&gt;
&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;
&lt;!-- Begin Validator Javascript Function--&gt;&lt;br /&gt;
&lt;html:javascript formName=&quot;AddressForm&quot;/&gt;&lt;br /&gt;
&lt;!-- End of Validator Javascript Function--&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/html:form&gt;&lt;br /&gt;
&lt;/body&gt;&lt;br /&gt;
&lt;/html:html&gt;&lt;br /&gt;
&lt;br /&gt;
The code &lt;html:javascript formName=&quot;AddressForm&quot;/&gt; is used to plug-in the Validator JavaScript.&lt;br /&gt;
&lt;br /&gt;
Create the following entry in the struts-config.xml for the mapping the /AddressJavascriptValidation url for handling the form submission through AddressJavascriptValidation.jsp.&lt;br /&gt;
&lt;action
     path=&quot;/AddressJavascriptValidation&quot;
     type=&quot;roseindia.net.AddressAction&quot;
     name=&quot;AddressForm&quot;
     scope=&quot;request&quot;
     validate=&quot;true&quot;
     input=&quot;/pages/AddressJavascriptValidation.jsp&quot;&gt;&lt;br /&gt;
     &lt;forward name=&quot;success&quot; path=&quot;/pages/success.jsp&quot;/&gt;&lt;br /&gt;
&lt;/action&gt;&lt;br /&gt;
&lt;br /&gt;
Add the following line in the index.jsp to call the form.&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;&lt;br /&gt;
&lt;html:link page=&quot;/pages/AddressJavascriptValidation.jsp&quot;&gt;Client Side Validation for Address Form&lt;/html:link&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
The Address Form that validates the data on the client side using Stuts Validator generated JavaScript.&lt;br /&gt;
&lt;/li&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/5076573445131809040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/5076573445131809040'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/01/client-side-address-validation-in.html' title='Client Side Address Validation in Struts'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-3839156688419060972</id><published>2011-01-07T01:43:00.000-08:00</published><updated>2011-01-07T01:43:15.668-08:00</updated><title type='text'>Struts 2 Features</title><content type='html'>The &lt;b&gt;strut-2 framework&lt;/b&gt; is designed for the compilation of the entire development cycle including of building, developing and maintaining the whole application. It is very extensible as each class of the framework is based on an Interface and all the base classes are given an extra application and even you can add your own. The basic platform requirements are Servlet API 2.4, JSP API 2.0 and Java 5. &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;i&gt;How Struts Works&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
The basic purpose of the Java Servlets in struts is to handle requests made by the client or by web browsers. In struts JavaServerPages (JSP) are used to design the dynamic web pages. In struts, servlets helps to route request which has been made by the web browsers to the appropriate ServerPage. The use of servlet as a router helps to make the web applications easier to design, create, and maintain. Struts is purely based on the Model- View- Contoller (MVC) design pattern. It is one of the best and most well developed design patterns in use. By using the MVC architecture we break the processing in three sections named Model, the View, and the Controller. Below we are describing the working of struts.&lt;br /&gt;
&lt;br /&gt;
   1. As we all are well aware of the fact that each application we develop has a deployment descriptor i.e. WEB-INF/web.xml. This is the file which the container reads.&lt;br /&gt;
      This file has all the configuration information which we have defined for our web application. The configuration information includes the index file, the default welcome page, the mapping of our servlets including path and the extension name, any init parameters, information related to the context elements. &lt;br /&gt;
      In the file WEB-INF/web.xml of struts application we need to configure the Struts ActionServlet which handles all the request made by the web browsers to a given mapping.  ActionServlet is the central component of the Struts controller. This servlet extends the HttpServlet. This servlet basically performs two important things. First is : When the container gets start, it reads the Struts Configuration files and loads it into memory in the init() method. You will know more about the Struts Configuration files below. Second point is: It intercepts the HTTP request in the doGet() and doPost() method and handles it appropriately.&lt;br /&gt;
        &lt;br /&gt;
   2. In struts application we have another xml file which is a Struts configuration file named as struts.config.xml. The name of this file can be changed. The name of the struts configuration file can be configured in the web.xml file. This file is placed under the WEB-INF directory of the web application.  It is an XML document that describes all or part of Struts application. This file has all the information about many types of Struts resources and configures their interaction.  This file is used to associate paths with the controller components of your application., known as Action classes like &lt;action path =&quot;/login&quot; type = &quot;LoginAction&quot;&gt;.  This tag tells the Struts ActionServlet that whenever the incoming request is http://myhost/myapp/login.do, then it must invoke the controller component LoginAction. Above, you can see that we have written .do in the URL. This mapping is done to tell the web application that whenever a request is received with the .do extension then it should be appended to the URL.  &lt;br /&gt;
        &lt;br /&gt;
   3. For each action we also have to configure Struts with the names of the resulting pages that will be shown as a result of that action. In our application there can be more than one view which depends on the result of an action. One can be for a success and the other for the failure. If the result action is &quot;success&quot; then the action tells the ActionServlet that the action has been successfully accomplished or vice- versa.  The struts knows how  to forward the specific page to the concerned destination. The model which we want to use is entirely to you, the model is called from within the controller components. &lt;br /&gt;
        &lt;br /&gt;
   4. Action can also get associate with a JavaBean in our Struts configuration file. Java bean is nothing but a class having getter and setter methods that can be used to communicate between the view and the controller layer. These java beans are validated by invoking the validate() method on the ActionForm by the help of the Struts system. The client sends the request by the normal form submission by using Get or Post method, and the Struts system updates that data in the Bean before calling the controller components.&lt;br /&gt;
        &lt;br /&gt;
   5. The view we use in the struts can be either Jsp page, Velocity templates, XSLT pages etc. In struts there are set of JSP tags which has been bundled with the struts distribution, but it is not mandatory to use only Jsp tags, even plain HTML files can be used within our Struts application but the disadvantage of using the html is that it can&#39;t take the full advantage of all the dynamic features provided in the struts framework. &lt;br /&gt;
      The framework includes a set of custom tag libraries that facilitate in creating the user interfaces that can interact gracefully with ActionForm beans. The struts Jsp taglibs has a number of generic and struts specific tags tags which helps you to use dynamic data in your view. These tags helps us to interact with your controller without writing much java code inside your jsp. These tags are used create forms, internally forward to other pages by interacting with the bean and helps us to invoke other actions of the web application. &lt;br /&gt;
      There are many tags provided to you in the struts frameworks which helps you in sending error messages, internationalization etc. &lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
Note: The points we have described above will be in effect if and only if when the ActionServlet is handling the request. When the request is submitted to the container which call the ActionServlet, make sure that the extension of the file which we want to access should have the extension .do.&lt;br /&gt;
&lt;br /&gt;
Struts working:&lt;br /&gt;
&lt;br /&gt;
Process flow:&lt;br /&gt;
&lt;br /&gt;
web.xml : Whenever the container gets start up the first work it does is to check the web.xml file and determine what struts action Servlets exist. The container is responsible for mapping all the file request to the correct action Servlet. &lt;br /&gt;
&lt;br /&gt;
A Request : This is the second step performed by the container after checking the web.xml file. In this the user submits a form within a browser and the request is intercepted by the controller. &lt;br /&gt;
&lt;br /&gt;
The Controller : This is the heart of the container. Most Struts application will have only one controller that is ActionServlet which is responsible for directing several Actions. The controller determines what action is required and sends the information to be processed by an action Bean. The key advantage of having a controller is its ability to control the flow of logic through the highly controlled, centralized points. &lt;br /&gt;
&lt;br /&gt;
struts.config.xml : Struts has a configuration file to store mappings of actions. By using this file there is no need to hard code the module which will be called within a component. The one more responsibility of the controller is to check the struts.config.xml file to determine which module to be called upon an action request. Struts only reads the struts.config.xml file upon start up. &lt;br /&gt;
&lt;br /&gt;
Model : The model is basically a business logic part which takes the response from the user and stores the result for the duration of the process. This is a great place to perform the preprocessing of the data received from request. It is possible to reuse the same model for many page requests. Struts provides the ActionForm and the Action classes which can be extended to create the model objects.&lt;br /&gt;
&lt;br /&gt;
View : The view in struts framework is mainly a jsp page which is responsible for producing the output to the user.&lt;br /&gt;
&lt;br /&gt;
Struts tag libraries : These are struts components helps us to integrate the struts framework within the project&#39;s logic. These struts tag libraries are used within the JSP page. This means that the controller and the model part can&#39;t make use of the tag library but instead use the struts class library for strut process control.&lt;br /&gt;
&lt;br /&gt;
Property file : It is used to store the messages that an object or page can use. Properties files can be used to store the titles and other string data. We can create many property files to handle different languages. &lt;br /&gt;
&lt;br /&gt;
Business objects :  It is the place where the rules of the actual project exists. These are the modules which just regulate the day- to- day site activities.&lt;br /&gt;
&lt;br /&gt;
The Response : This is the output of the View JSP object. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Understanding Struts Controller&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The class org.apache.struts.action.ActionServlet is the heart of the Struts Framework. It is the Controller part of the Struts Framework. ActionServlet is configured as Servlet in the web.xml file as shown in the following code snippets.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;!-- Standard Action Servlet Configuration (with debugging) --&gt;&lt;br /&gt;
&lt;servlet&gt;&lt;br /&gt;
     &lt;servlet-name&gt;action&lt;/servlet-name&gt;&lt;br /&gt;
      &lt;servlet-class&gt;org.apache.struts.action.ActionServlet&lt;/servlet-class&gt;&lt;br /&gt;
      &lt;init-param&gt;&lt;br /&gt;
        &lt;param-name&gt;config&lt;/param-name&gt;        &lt;param-value&gt;/WEB-INF/struts-config.xml&lt;/param-value&gt;      &lt;/init-param&gt;&lt;br /&gt;
     &lt;init-param&gt;&lt;br /&gt;
        &lt;param-name&gt;debug&lt;/param-name&gt;        &lt;param-value&gt;2&lt;/param-value&gt;        &lt;/init-param&gt;&lt;br /&gt;
        &lt;init-param&gt;&lt;br /&gt;
        &lt;param-name&gt;detail&lt;/param-name&gt;        &lt;param-value&gt;2&lt;/param-value&gt;     &lt;/init-param&gt;&lt;br /&gt;
    &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;&lt;br /&gt;
&lt;/servlet&gt;&lt;br /&gt;
&lt;br /&gt;
This servlet is responsible for handing all the request for the Struts Framework, user can map the specific pattern of request to the ActionServlet. &lt;servlet-mapping&gt; tag in the web.xml file specifies the url pattern to be handled by the servlet. By default it is *.do, but it can be changed to anything. Following code form  the web.xml file shows the mapping.&lt;br /&gt;
&lt;!-- Standard Action Servlet Mapping --&gt;&lt;br /&gt;
&lt;servlet-mapping&gt;&lt;br /&gt;
    &lt;servlet-name&gt;action&lt;/servlet-name&gt;&lt;br /&gt;
    &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;&lt;br /&gt;
&lt;/servlet-mapping&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;i&gt;What is Action Class?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
An Action class in the struts application extends Struts &#39;org.apache.struts.action.Action&quot; Class. Action class acts as wrapper around the business logic and provides an inteface to the application&#39;s Model layer. It acts as glue between the View and Model layer. It also transfers the data from the view layer to the specific business process layer and finally returns the procssed data from business layer to the view layer.&lt;br /&gt;
&lt;br /&gt;
An Action works as an adapter between the contents of an incoming HTTP request and the business logic that corresponds to it. Then the struts controller (ActionServlet) slects an appropriate Action and creates an instance if necessary, and finally calls execute method.&lt;br /&gt;
&lt;br /&gt;
To use the Action, we need to  Subclass and overwrite the execute() method. In the Action Class don&#39;t add the business process logic, instead move the database and business process logic to the process or dao layer.&lt;br /&gt;
&lt;br /&gt;
The ActionServlet (commad) passes the parameterized class to Action Form using the execute() method. The return type of the execute method is ActionForward which is used by the Struts Framework to forward the request to the file as per the value of the returned ActionForward object.&lt;br /&gt;
&lt;br /&gt;
Developing our Action Class?&lt;br /&gt;
&lt;br /&gt;
Our Action class (TestAction.java) is simple class that only forwards the TestAction.jsp. Our Action class returns the ActionForward  called &quot;testAction&quot;, which is defined in the struts-config.xml file (action mapping is show later in this page). Here is code of our Action Class:&lt;br /&gt;
&lt;br /&gt;
TestAction.java&lt;br /&gt;
package roseindia.net;&lt;br /&gt;
&lt;br /&gt;
import javax.servlet.http.HttpServletRequest;&lt;br /&gt;
import javax.servlet.http.HttpServletResponse;&lt;br /&gt;
&lt;br /&gt;
import org.apache.struts.action.Action;&lt;br /&gt;
import org.apache.struts.action.ActionForm;&lt;br /&gt;
import org.apache.struts.action.ActionForward;&lt;br /&gt;
import org.apache.struts.action.ActionMapping;&lt;br /&gt;
&lt;br /&gt;
public class TestAction extends Action&lt;br /&gt;
{&lt;br /&gt;
  public ActionForward execute(&lt;br /&gt;
    ActionMapping mapping,&lt;br /&gt;
    ActionForm form,&lt;br /&gt;
    HttpServletRequest request,&lt;br /&gt;
    HttpServletResponse response) throws Exception{&lt;br /&gt;
      return mapping.findForward(&quot;testAction&quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
Understanding Action Class&lt;br /&gt;
Here is the signature of the Action Class.&lt;br /&gt;
&lt;br /&gt;
public ActionForward execute(ActionMapping mapping,&lt;br /&gt;
                             ActionForm form,&lt;br /&gt;
                             javax.servlet.http.HttpServletRequest request,&lt;br /&gt;
                             javax.servlet.http.HttpServletResponse response)&lt;br /&gt;
                      throws java.lang.Exception&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
What is ActionForm?&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
An ActionForm is a JavaBean that extends org.apache.struts.action.ActionForm. ActionForm maintains the session state for web application and the ActionForm object is automatically populated on the server side with data entered from a form on the client side.&lt;br /&gt;
&lt;br /&gt;
We will first create the class AddressForm which extends the ActionForm class. Here is the code of the class:&lt;br /&gt;
&lt;br /&gt;
AddressForm.java&lt;br /&gt;
package roseindia.net;&lt;br /&gt;
&lt;br /&gt;
import javax.servlet.http.HttpServletRequest;&lt;br /&gt;
&lt;br /&gt;
import org.apache.struts.action.*;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* @author Deepak Kumar&lt;br /&gt;
* @Web http://www.roseindia.net&lt;br /&gt;
* @Email roseindia_net@yahoo.com&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Form bean for the Address Entry Screen.&lt;br /&gt;
 *&lt;br /&gt;
*/&lt;br /&gt;
public class AddressForm extends ActionForm&lt;br /&gt;
{&lt;br /&gt;
  private String name=null;&lt;br /&gt;
  private String address=null;&lt;br /&gt;
  private String emailAddress=null;&lt;br /&gt;
&lt;br /&gt;
  public void setName(String name){&lt;br /&gt;
    this.name=name;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public String getName(){&lt;br /&gt;
    return this.name;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public void setAddress(String address){&lt;br /&gt;
    this.address=address;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public String getAddress(){&lt;br /&gt;
    return this.address;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  public void setEmailAddress(String emailAddress){&lt;br /&gt;
    this.emailAddress=emailAddress;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public String getEmailAddress(){&lt;br /&gt;
    return this.emailAddress;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Reset all properties to their default values.&lt;br /&gt;
     *&lt;br /&gt;
     * @param mapping The mapping used to select this instance&lt;br /&gt;
     * @param request The servlet request we are processing&lt;br /&gt;
     */&lt;br /&gt;
    public void reset(ActionMapping mapping, HttpServletRequest request) {&lt;br /&gt;
    this.name=null;&lt;br /&gt;
    this.address=null;&lt;br /&gt;
    this.emailAddress=null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Reset all properties to their default values.&lt;br /&gt;
     *&lt;br /&gt;
     * @param mapping The mapping used to select this instance&lt;br /&gt;
     * @param request The servlet request we are processing&lt;br /&gt;
   * @return errors&lt;br /&gt;
     */&lt;br /&gt;
  public ActionErrors validate( &lt;br /&gt;
      ActionMapping mapping, HttpServletRequest request ) {&lt;br /&gt;
      ActionErrors errors = new ActionErrors();&lt;br /&gt;
      &lt;br /&gt;
      if( getName() == null || getName().length() &lt; 1 ) {
        errors.add(&quot;name&quot;,new ActionMessage(&quot;error.name.required&quot;));
      }
      if( getAddress() == null || getAddress().length() &lt; 1 ) {
        errors.add(&quot;address&quot;,new ActionMessage(&quot;error.address.required&quot;));
      }
      if( getEmailAddress() == null || getEmailAddress().length() &lt; 1 ) {
        errors.add(&quot;emailaddress&quot;,new ActionMessage(&quot;error.emailaddress.required&quot;));
      }

      return errors;
  }

}

The above class populates the Address Form data and validates it. The validate() method is used to validate the inputs. If any or all of the fields on the form are blank, error messages are added to the ActionMapping object.  
&lt;i&gt;&lt;br /&gt;
Struts HTML Tags&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Struts provides HTML tag library for easy creation of user interfaces. In this lesson I will show you what all Struts HTML Tags are available to the JSP for the development of user interfaces.&lt;br /&gt;
&lt;br /&gt;
To use the Struts HTML Tags we have to include the following line in our JSP file:&lt;br /&gt;
&lt;br /&gt;
&lt;%@ taglib uri=&quot;/tags/struts-html&quot; prefix=&quot;html&quot; %&gt;&lt;br /&gt;
&lt;br /&gt;
above code makes available the tag to the jsp.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Struts HTML Tags&lt;br /&gt;
&lt;html:message key=&quot;thekey&quot;/&gt; 	Looks up the message corresponding to the given key in the message resources and displays it.&lt;br /&gt;
&lt;html:password property=&quot;prop&quot; size=&quot;10&quot;/&gt; 	Tag creates the password field. The string is stored in the property named prop in the form bean.&lt;br /&gt;
&lt;html:text property=&quot;text1&quot; size=&quot;5&quot;/&gt; 	Tag creates the text field. The string is retrieved from and later stored in the property named text1 in the form bean.&lt;br /&gt;
&lt;html:submit&gt;Submit&lt;/html:submit&gt; 	Tag creates a submit button with the provided content as the button text. &lt;br /&gt;
&lt;html:reset&gt;Reset&lt;/html:reset&gt; 	Tag creates a reset button with the provided content as the button text. &lt;br /&gt;
&lt;html:errors/&gt; 	Tag prints all the available error on the page.&lt;br /&gt;
&lt;html:file property=&quot;fileSelectionBox&quot;/&gt; 	Tag creates the file upload element on the form. The property must be of the type org.apache.struts.upload.FormFile.&lt;br /&gt;
&lt;html:checkbox property=&quot;myCheckBox&quot;/&gt; 	Tag creates check box on the form.&lt;br /&gt;
&lt;html:hidden property=&quot;hiddenfield&quot;/&gt; 	Tag creates the hidden html element on the form.&lt;br /&gt;
&lt;html:radio value=&quot;abc&quot; property=&quot;myCheckBox&quot;/&gt; 	Tag creates the check box on the form.&lt;br /&gt;
&lt;html:select multiple=&quot;true&quot; property=&quot;selectBox&quot;&gt; 	Tag creates list box on the form. The property selectBox must be an array of supported data-types, and the user may select several entries. Use &lt;html:options&gt; to specify the entries.&lt;br /&gt;
&lt;html:textarea property=&quot;myTextArea&quot; value=&quot;Hello Struts&quot; /&gt; 	Tag creates the text area on the form.&lt;br /&gt;
&lt;html:form action=&quot;/Address&quot; method=&quot;post&quot;&gt; 	Tag is used to create the HTML Form for posting the data on the server.&lt;br /&gt;
&lt;html:base/&gt; 	Tag generates the base tag. &lt;BASE ...&gt; tells the browser to pretend that the current page is located at some URL other than where the browser found it. Any relative reference will be calculated from the URL given by &lt;BASE HREF=&quot;...&quot;&gt; instead of the actual URL. &lt;BASE ...&gt; goes in the &lt;HEAD&gt; section.&lt;br /&gt;
&lt;html:html&gt; 	Tag renders an HTML &lt;html&gt; Element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3839156688419060972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3839156688419060972'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2011/01/struts-2-features.html' title='Struts 2 Features'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-4374296264894626510</id><published>2010-02-18T04:27:00.000-08:00</published><updated>2010-02-18T04:27:59.524-08:00</updated><title type='text'>MultiActionController in Spring Framework</title><content type='html'>MultiActionController is one of the types of Controllers in Spring. It extends AbstractController. (Somewhat similar to DispatchAction in Struts)  Why MultiActionController?: It aggregates multiple request handling methods into single controller, so related functionality can be kept together easily.&lt;br /&gt;
 &lt;br /&gt;
Spring in the use of the controller, and SimpleFormController AbstractController application is the highest.    AbstractController Controller is the most fundamental, and can give users maximum flexibility.  &lt;br /&gt;
&lt;br /&gt;
  SimpleFormController the typical form for editing and submission.    In a growing need, delete, change, the demand for search, add and modify expansion SimpleFormController completed, delete, and for the expansion of AbstractController completed.  &lt;br /&gt;
&lt;br /&gt;
Using Spring MultiActionController class you can group related actions into a single controller class. The handler method for each action should be in the following form.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;public (ModelAndView | Map | String | void) actionName(HttpServletRequest, HttpServletResponse [,HttpSession] [,CommandObject]);&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To group multiple actions your controller class should extend MultiActionController class. Here the UserController class extends the MultiActionController class and contains the add() and the remove() method &lt;br /&gt;
&lt;br /&gt;
  However, as the above as a complete object by business, delete, change, examination, and all belong to a class of related businesses.    Related to the operation of a distribution to the different classes to complete, breaching the &quot;high cohesion&quot; design principles.    This four operational need to complete four categories, resulting in too many types of documents, difficult to maintain and configure.  &lt;br /&gt;
&lt;br /&gt;
  So Struts from the Spring DispatchAction provides a similar function MultiActionController.    Can be achieved at the request of different paths corresponding MultiActionController in different ways, and this can be related to the operation of all the relevant categories in a complete method.    This makes this type of &quot;high cohesion&quot;, but also conducive to the maintenance of systems, but also to avoid the duplication of code.    Increase and revise the operation of data validation logic is very similar, after MultiActionController can use and modify operations to increase sharing of data validation logic code.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/4374296264894626510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/4374296264894626510'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2010/02/multiactioncontroller-in-spring.html' title='MultiActionController in Spring Framework'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-3301714575775445035</id><published>2010-02-18T02:00:00.000-08:00</published><updated>2010-02-18T02:01:45.732-08:00</updated><title type='text'>SiteMesh</title><content type='html'>SiteMesh is a web-page layout and decoration framework and web- application integration framework to aid in creating large sites consisting of many pages for which a consistent look/feel, navigation and layout scheme is required.&lt;br /&gt;
&lt;br /&gt;
SiteMesh intercepts requests to any static or dynamically generated HTML page requested through the web-server, parses the page, obtains properties and data from the content and generates an appropriate final page with modifications to the original. This is based upon the well-known GangOfFour Decorator design pattern.&lt;br /&gt;
&lt;br /&gt;
SiteMesh can also include entire HTML pages as a Panel within another page. This is similar to a Server-Side Include, except that the HTML document will be modified to create a visual window (using the document&#39;s Meta-data as an aid) within a page. Using this feature, Portal type web sites can be built very quickly and effectively. This is based upon the well-known GangOfFour Composite design pattern.&lt;br /&gt;
&lt;br /&gt;
SiteMesh is built using Java 2 with Servlet, JSP and XML technologies. This makes it ideal for use with J2EE applications, however it can be integrated with server-side web architectures that are not Java based such as CGI (Perl/Python/C/C++/etc), PHP, Cold Fusion, etc...&lt;br /&gt;
&lt;br /&gt;
SiteMesh is very extensible and is designed in a way in which it is easy to extend for custom needs. &lt;br /&gt;
&lt;br /&gt;
reffer this site:http: http://www.opensymphony.com/sitemesh/&lt;br /&gt;
 &lt;a href=&quot;http://www.opensymphony.com/sitemesh/&quot;&gt;&lt;/a&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3301714575775445035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3301714575775445035'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2010/02/sitemesh.html' title='SiteMesh'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-7333694255468265422</id><published>2010-02-16T20:03:00.000-08:00</published><updated>2010-02-18T04:24:25.267-08:00</updated><title type='text'>Spring Framework</title><content type='html'>Spring is an open source framework created to address the complexity of enterprise application development. One of the chief advantages of the Spring framework is its layered architecture, which allows you to be selective about which of its components you use while also providing a cohesive framework for J2EE application development. The Spring modules are built on top of the core container, which defines how beans are created, configured, and managed, as shown in the following figure. Each of the modules (or components) that comprise the Spring framework can stand on its own or be implemented jointly with one or more of the others. The functionality of each component is as follows:&lt;br /&gt;
&lt;br /&gt;
The core container: The core container provides the essential functionality of the Spring framework. A primary component of the core container is the BeanFactory, an implementation of the Factory pattern. The BeanFactory applies the Inversion of Control (IOC) pattern to separate an application’s configuration and dependency specification from the actual application code.&lt;br /&gt;
&lt;br /&gt;
Spring context: The Spring context is a configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as JNDI, EJB, e-mail, internalization, validation, and scheduling functionality.&lt;br /&gt;
&lt;br /&gt;
Spring AOP: The Spring AOP module integrates aspect-oriented programming functionality directly into the Spring framework, through its configuration management feature. As a result you can easily AOP-enable any object managed by the Spring framework. The Spring AOP module provides transaction management services for objects in any Spring-based application. With Spring AOP you can incorporate declarative transaction management into your applications without relying on EJB components.&lt;br /&gt;
&lt;br /&gt;
Spring DAO: The Spring JDBC DAO abstraction layer offers a meaningful exception hierarchy for managing the exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the amount of exception code you need to write, such as opening and closing connections. Spring DAO’s JDBC-oriented exceptions comply to its generic DAO exception hierarchy.&lt;br /&gt;
&lt;br /&gt;
Spring ORM: The Spring framework plugs into several ORM frameworks to provide its Object Relational tool, including JDO, Hibernate, and iBatis SQL Maps. All of these comply to Spring’s generic transaction and DAO exception hierarchies.&lt;br /&gt;
&lt;br /&gt;
Spring Web module: The Web context module builds on top of the application context module, providing contexts for Web-based applications. As a result, the Spring framework supports integration with Jakarta Struts. The Web module also eases the tasks of handling multi-part requests and binding request parameters to domain objects.&lt;br /&gt;
&lt;br /&gt;
Spring MVC framework: The Model-View-Controller (MVC) framework is a full-featured MVC implementation for building Web applications. The MVC framework is highly configurable via strategy interfaces and accommodates numerous view technologies including JSP, Velocity, Tiles, iText, and POI.&lt;br /&gt;
&lt;br /&gt;
Q. What is AOP? How does it relate with IOC? What are different tools to utilize AOP?&lt;br /&gt;
A:  Aspect-oriented programming, or AOP, is a programming technique that allows programmers to modularize crosscutting concerns, or behavior that cuts across the typical divisions of responsibility, such as logging and transaction management. The core construct of AOP is the aspect, which encapsulates behaviors affecting multiple classes into reusable modules. AOP and IOC are complementary technologies in that both apply a modular approach to complex problems in enterprise application development. In a typical object-oriented development approach you might implement logging functionality by putting logger statements in all your methods and Java classes. In an AOP approach you would instead modularize the logging services and apply them declaratively to the components that required logging. The advantage, of course, is that the Java class doesn&#39;t need to know about the existence of the logging service or concern itself with any related code. As a result, application code written using Spring AOP is loosely coupled. The best tool to utilize AOP to its capability is AspectJ. However AspectJ works at he byte code level and you need to use AspectJ compiler to get the aop features built into your compiled code. Nevertheless AOP functionality is fully integrated into the Spring context for transaction management, logging, and various other features.  In general any AOP framework control aspects in three possible ways:&lt;br /&gt;
&lt;br /&gt;
Joinpoints: Points in a program&#39;s execution. For example, joinpoints could define calls to specific methods in a class&lt;br /&gt;
Pointcuts: Program constructs to designate joinpoints and collect specific context at those points&lt;br /&gt;
Advices: Code that runs upon meeting certain conditions. For example, an advice could log a message before executing a joinpoint&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q. What are the advantages of spring framework?&lt;br /&gt;
A.  &lt;br /&gt;
&lt;br /&gt;
1. Spring has layed architecture. Use what you need and leave you don&#39;t need now.&lt;br /&gt;
2. Spring Enables POJO Programming. There is no behind the scene magic here. POJO programming enables continous integration and testability.&lt;br /&gt;
3. Dependency Injection and Inversion of Control Simplifies JDBC (Read the first question.)&lt;br /&gt;
4. Open source and no vendor lock-in.&lt;br /&gt;
&lt;br /&gt;
Q. Can you name a tool which could provide the initial ant files and directory structure for a new spring project.&lt;br /&gt;
A: Appfuse or equinox.&lt;br /&gt;
&lt;br /&gt;
Q. Explain BeanFactory in spring.&lt;br /&gt;
A: Bean factory is an implementation of the factory design pattern and its function is to create and dispense beans. As the bean factory knows about many objects within an application, it is able to create association between collaborating objects as they are instantiated. This removes the burden of configuration from the bean and the client. There are several implementation of BeanFactory. The most useful one is &quot;org.springframework.beans.factory.xml.XmlBeanFactory&quot; It loads its beans based on the definition contained in an XML file. To create an XmlBeanFactory, pass a InputStream to the constructor. The resource will provide the XML to the factory. BeanFactory  factory = new XmlBeanFactory(new FileInputStream(&quot;myBean.xml&quot;));&lt;br /&gt;
This line tells the bean factory to read the bean definition from the XML file. The bean definition includes the description of beans and their properties. But the bean factory doesn&#39;t instantiate the bean yet. To retrieve a bean from a &#39;BeanFactory&#39;, the getBean() method is called. When getBean() method is called, factory will instantiate the bean and begin setting the bean&#39;s properties using dependency injection. myBean bean1 = (myBean)factory.getBean(&quot;myBean&quot;);&lt;br /&gt;
&lt;br /&gt;
Q. Explain the role of ApplicationContext in spring.&lt;br /&gt;
A. While Bean Factory is used for simple applications, the Application Context is spring&#39;s more advanced container. Like &#39;BeanFactory&#39; it can be used to load bean definitions, wire beans together and dispense beans upon request. It also provide&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) a means for resolving text messages, including support for internationalization.&lt;br /&gt;
2) a generic way to load file resources.&lt;br /&gt;
3) events to beans that are registered as listeners.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because of additional functionality, &#39;Application Context&#39; is preferred over a BeanFactory. Only when the resource is scarce like mobile devices, &#39;BeanFactory&#39; is used. The three commonly used implementation of &#39;Application Context&#39; are&lt;br /&gt;
&lt;br /&gt;
1. ClassPathXmlApplicationContext : It Loads  context definition from an XML file located in the classpath, treating context definitions as classpath resources. The application context is loaded from the application&#39;s classpath by using the code&lt;br /&gt;
ApplicationContext    context = new ClassPathXmlApplicationContext(&quot;bean.xml&quot;);&lt;br /&gt;
2. FileSystemXmlApplicationContext : It loads context definition from an XML file in the filesystem. The application context is loaded from the file system by using the code&lt;br /&gt;
ApplicationContext    context = new FileSystemXmlApplicationContext(&quot;bean.xml&quot;);&lt;br /&gt;
3. XmlWebApplicationContext : It loads context definition from an XML file contained within a web application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q. How does Spring supports DAO in hibernate?&lt;br /&gt;
A. Spring’s HibernateDaoSupport class is a convenient super class for Hibernate DAOs. It has handy methods you can call to get a Hibernate Session, or a SessionFactory. The most convenient method is getHibernateTemplate(), which returns a HibernateTemplate. This template wraps Hibernate checked exceptions with runtime exceptions, allowing your DAO interfaces to be Hibernate exception-free.&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
public class UserDAOHibernate extends HibernateDaoSupport {&lt;br /&gt;
&lt;br /&gt;
public User getUser(Long id) {&lt;br /&gt;
return (User) getHibernateTemplate().get(User.class, id);&lt;br /&gt;
}&lt;br /&gt;
public void saveUser(User user) {&lt;br /&gt;
getHibernateTemplate().saveOrUpdate(user);&lt;br /&gt;
if (log.isDebugEnabled()) {&lt;br /&gt;
log.debug(“userId set to: “ + user.getID());&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
public void removeUser(Long id) {&lt;br /&gt;
Object user = getHibernateTemplate().load(User.class, id);&lt;br /&gt;
getHibernateTemplate().delete(user);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q. What are the id generator classes in hibernate?&lt;br /&gt;
A:  increment: It generates identifiers of type long, short or int that are unique only when no other process is inserting data into the same table. It should not the used in the clustered environment.&lt;br /&gt;
identity: It supports identity columns in DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL. The returned identifier is of type long, short or int.&lt;br /&gt;
sequence: The sequence generator uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in Interbase. The returned identifier is of type long, short or int&lt;br /&gt;
hilo: The hilo generator uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a table and column (by default hibernate_unique_key and next_hi respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database. Do not use this generator with connections enlisted with JTA or with a user-supplied connection.&lt;br /&gt;
seqhilo: The seqhilo generator uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a named database sequence.&lt;br /&gt;
uuid: The uuid generator uses a 128-bit UUID algorithm to generate identifiers of type string, unique within a network (the IP address is used). The UUID is encoded as a string of hexadecimal digits of length 32.&lt;br /&gt;
guid: It uses a database-generated GUID string on MS SQL Server and MySQL.&lt;br /&gt;
native: It picks identity, sequence or hilo depending upon the capabilities of the underlying database.&lt;br /&gt;
assigned: lets the application to assign an identifier to the object before save() is called. This is the default strategy if no &lt;generator&gt; element is specified.&lt;br /&gt;
select: retrieves a primary key assigned by a database trigger by selecting the row by some unique key and retrieving the primary key value.&lt;br /&gt;
foreign: uses the identifier of another associated object. Usually used in conjunction with a &lt;one-to-one&gt; primary key association.&lt;br /&gt;
&lt;br /&gt;
Q. How is a typical spring implementation look like?&lt;br /&gt;
A. For a typical Spring Application we need the following files&lt;br /&gt;
&lt;br /&gt;
1. An interface that defines the functions.&lt;br /&gt;
2. An Implementation that contains properties, its setter and getter methods, functions etc.,&lt;br /&gt;
3. A XML file called Spring configuration file.&lt;br /&gt;
4. Client program that uses the function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q. How do you define hibernate mapping file in spring?&lt;br /&gt;
A. Add the hibernate mapping file entry in mapping resource inside Spring’s applicationContext.xml file in the web/WEB-INF directory. &lt;br /&gt;
&lt;br /&gt;
&lt;property name=&quot;mappingResources&quot;&gt;&lt;br /&gt;
&lt;list&gt;&lt;br /&gt;
&lt;value&gt;org/appfuse/model/User.hbm.xml&lt;/value&gt;&lt;br /&gt;
&lt;/list&gt;&lt;br /&gt;
&lt;/property&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q. How do you configure spring in a web application?&lt;br /&gt;
A. It is very easy to configure any J2EE-based web application to use Spring. At the very least, you can simply add Spring’s ContextLoaderListener to your web.xml file:&lt;br /&gt;
&lt;br /&gt;
&lt;listener&gt;&lt;br /&gt;
&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;&lt;br /&gt;
&lt;/listener&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q. Can you have xyz.xml file instead of applicationcontext.xml?&lt;br /&gt;
A. ContextLoaderListener is a ServletContextListener that initializes when your webapp starts up. By default, it looks for Spring’s configuration file at WEB-INF/applicationContext.xml. You can change this default value by specifying a &lt;context-param&gt; element named “contextConfigLocation.” Example:&lt;br /&gt;
&lt;br /&gt;
&lt;listener&gt;&lt;br /&gt;
&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;br /&gt;
&lt;br /&gt;
&lt;context-param&gt;&lt;br /&gt;
&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;&lt;param-value&gt;/WEB-INF/xyz.xml&lt;/param-value&gt;&lt;/context-param&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/listener-class&gt;&lt;br /&gt;
&lt;/listener&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q. How do you configure your database driver in spring?&lt;br /&gt;
A. Using datasource &quot;org.springframework.jdbc.datasource.DriverManagerDataSource&quot;. Example:&lt;br /&gt;
&lt;br /&gt;
&lt;bean id=&quot;dataSource&quot; class=&quot;org.springframework.jdbc.datasource.DriverManagerDataSource&quot;&gt;&lt;br /&gt;
&lt;property name=&quot;driverClassName&quot;&gt;&lt;br /&gt;
&lt;value&gt;org.hsqldb.jdbcDriver&lt;/value&gt;&lt;br /&gt;
&lt;/property&gt;&lt;br /&gt;
&lt;property name=&quot;url&quot;&gt;&lt;br /&gt;
&lt;value&gt;jdbc:hsqldb:db/appfuse&lt;/value&gt;&lt;br /&gt;
&lt;/property&gt;&lt;br /&gt;
&lt;property name=&quot;username&quot;&gt;&lt;value&gt;sa&lt;/value&gt;&lt;/property&gt;&lt;br /&gt;
&lt;property name=&quot;password&quot;&gt;&lt;value&gt;&lt;/value&gt;&lt;/property&gt;&lt;br /&gt;
&lt;/bean&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q. How can you configure JNDI instead of datasource in spring applicationcontext.xml?&lt;br /&gt;
A. Using &quot;org.springframework.jndi.JndiObjectFactoryBean&quot;. Example:&lt;br /&gt;
&lt;br /&gt;
&lt;bean id=&quot;dataSource&quot; class=&quot;org.springframework.jndi.JndiObjectFactoryBean&quot;&gt;&lt;br /&gt;
&lt;property name=&quot;jndiName&quot;&gt;&lt;br /&gt;
&lt;value&gt;java:comp/env/jdbc/appfuse&lt;/value&gt;&lt;br /&gt;
&lt;/property&gt;&lt;br /&gt;
&lt;/bean&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q. What are the key benifits of Hibernate?&lt;br /&gt;
A:  These are the key benifits of Hibernate:&lt;br /&gt;
&lt;br /&gt;
* Transparent persistence based on POJOs without byte code processing &lt;br /&gt;
* Powerful object-oriented hibernate query language&lt;br /&gt;
* Descriptive O/R Mapping through mapping file.&lt;br /&gt;
* Automatic primary key generation &lt;br /&gt;
* Hibernate cache : Session Level, Query and Second level cache.&lt;br /&gt;
* Performance: Lazy initialization, Outer join fetching, Batch fetching&lt;br /&gt;
&lt;br /&gt;
Q. What is hibernate session and session factory? How do you configure sessionfactory in spring configuration file?&lt;br /&gt;
A. Hibernate Session is the main runtime interface between a Java application and Hibernate. SessionFactory allows applications to create hibernate session by reading hibernate configurations file hibernate.cfg.xml.&lt;br /&gt;
&lt;br /&gt;
// Initialize the Hibernate environment&lt;br /&gt;
Configuration cfg = new Configuration().configure();&lt;br /&gt;
// Create the session factory&lt;br /&gt;
SessionFactory factory = cfg.buildSessionFactory();&lt;br /&gt;
// Obtain the new session object&lt;br /&gt;
Session session = factory.openSession();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The call to Configuration().configure() loads the hibernate.cfg.xml configuration file and initializes the Hibernate environment. Once the configuration is initialized, you can make any additional modifications you desire programmatically. However, you must make these modifications prior to creating the SessionFactory instance. An instance of SessionFactory is typically created once and used to create all sessions related to a given context.&lt;br /&gt;
The main function of the Session is to offer create, read and delete operations for instances of mapped entity classes. Instances may exist in one of three states:&lt;br /&gt;
&lt;br /&gt;
transient: never persistent, not associated with any Session&lt;br /&gt;
persistent: associated with a unique Session&lt;br /&gt;
detached: previously persistent, not associated with any Session&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A Hibernate Session object represents a single unit-of-work for a given data store and is opened by a SessionFactory instance. You must close Sessions when all work for a transaction is completed. The following illustrates a typical Hibernate session:&lt;br /&gt;
Session session = null;&lt;br /&gt;
UserInfo user = null;&lt;br /&gt;
Transaction tx = null;&lt;br /&gt;
try {&lt;br /&gt;
session = factory.openSession();&lt;br /&gt;
tx = session.beginTransaction();&lt;br /&gt;
user = (UserInfo)session.load(UserInfo.class, id);&lt;br /&gt;
tx.commit();&lt;br /&gt;
} catch(Exception e) {&lt;br /&gt;
if (tx != null) {&lt;br /&gt;
try {&lt;br /&gt;
tx.rollback();&lt;br /&gt;
} catch (HibernateException e1) {&lt;br /&gt;
throw new DAOException(e1.toString()); }&lt;br /&gt;
} throw new DAOException(e.toString());&lt;br /&gt;
} finally {&lt;br /&gt;
if (session != null) {&lt;br /&gt;
try {&lt;br /&gt;
session.close();&lt;br /&gt;
} catch (HibernateException e) { }&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Q. What is the difference between hibernate get and load methods?&lt;br /&gt;
A. The load() method is older; get() was added to Hibernate’s API due to user request. The difference is trivial:&lt;br /&gt;
The following Hibernate code snippet retrieves a User object from the database:  User user = (User) session.get(User.class, userID);&lt;br /&gt;
The get() method is special because the identifier uniquely identifies a single instance of a class. Hence it’s common for applications to use the identifier as a convenient handle to a persistent object. Retrieval by identifier can use the cache when retrieving an object, avoiding a database hit if the object is already cached.&lt;br /&gt;
Hibernate also provides a load() method:  User user = (User) session.load(User.class, userID);&lt;br /&gt;
If load() can’t find the object in the cache or database, an exception is thrown. The load() method never returns null. The get() method returns&lt;br /&gt;
null if the object can’t be found. The load() method may return a proxy instead of a real persistent instance. A proxy is a placeholder instance of a runtime-generated subclass (through cglib or Javassist) of a mapped persistent class, it can initialize itself if any method is called that is not the mapped database identifier getter-method. On the other hand, get() never returns a proxy. Choosing between get() and load() is easy: If you’re certain the persistent object exists, and nonexistence would be considered exceptional, load() is a good option. If you aren’t certain there is a persistent instance with the given&lt;br /&gt;
identifier, use get() and test the return value to see if it’s null. Using load() has a further implication: The application may retrieve a valid reference (a proxy) to a&lt;br /&gt;
persistent instance without hitting the database to retrieve its persistent state. So load() might not throw an exception when it doesn’t find the persistent object&lt;br /&gt;
in the cache or database; the exception would be thrown later, when the proxy is accessed.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/7333694255468265422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/7333694255468265422'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2010/02/spring-framework.html' title='Spring Framework'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-7941565275867851005</id><published>2010-01-04T23:26:00.000-08:00</published><updated>2010-01-04T23:26:33.205-08:00</updated><title type='text'>Web Services</title><content type='html'>1.The next generation of distributed computing has arrived. A Web service is a unit of managed code that can be remotely invoked using HTTP, that is, it can be activated using HTTP requests.  &lt;br /&gt;
&lt;br /&gt;
2.Web services constitute a distributed computer architecture made up of many different computers trying to communicate over the network to form one system. They consist of a set of standards that allow developers to implement distributed applications - using radically different tools provided by many different vendors - to create applications that use a combination of software modules called from systems in disparate departments or from other companies. &lt;br /&gt;
&lt;br /&gt;
UDDI:&lt;br /&gt;
Universal Description, Discovery, and Integration (UDDI) is a protocol for describing available Web services components. This standard allows businesses to register with an Internet directory that will help them advertise their services, so companies can find one another and conduct transactions over the Web. This registration and lookup task is done using XML and HTTP(S)-based mechanisms. &lt;br /&gt;
&lt;br /&gt;
SOAP:&lt;br /&gt;
Simple Object Access Protocol (SOAP) is a protocol for initiating conversations with a UDDI Service. SOAP makes object access simple by allowing applications to invoke object methods or functions, residing on remote servers. A SOAP application creates a request block in XML, supplying the data needed by the remote method as well as the location of the remote object itself. &lt;br /&gt;
&lt;br /&gt;
WSDL:&lt;br /&gt;
Web Service Description Language (WSDL), the proposed standard for how a Web service is described, is an XML-based service IDL (Interface Definitition Language) that defines the service interface and its implementation characteristics. WSDL is referenced by UDDI entries and describes the SOAP messages that define a particular Web service. &lt;br /&gt;
&lt;br /&gt;
ebXML: (e-business XML) defines core components, business processes, registry and repository, messaging services, trading partner agreements, and security.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Definition&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Web services are the amalgamation of eXtensible Markup Language (XML) and HyperText Transfer Protocol HTTP that can convert your application into a Web-application, which publish its function or message to the rest of the world.&lt;br /&gt;
&lt;br /&gt;
In other words, we can say, web services are just Internet Application Programming Interfaces (API) that can be accessed over a network, such as Internet and intranet, and executed on a remote system hosting the requested services.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Why Web Services?&lt;/b&gt;&lt;br /&gt;
Connecting Different Applications: Web Services allows different applications to talk to each other and share data and services among themselves. Other applications can also use the services of the web services. For example VB or .NET application can talk to java web services and vice versa. So, Web services is used to make the application platform and technology independent.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Standardized Protocol&lt;/i&gt;: Web Services uses standardized industry standard protocol for the communication. All the four layers (Service Transport, XML Messaging, Service Description and Service Discovery layers) uses the well defined protocol in the Web Services protocol stack. This standardization of protocol stack gives the business many advantages like wide range of choices, reduction in the cost due to competition and increase in the quality.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Low Cost of communication&lt;/i&gt;: Web Services uses SOAP over HTTP protocol for the communication, so you can use your existing low cost internet for implementing Web Services. This solution is much less costly compared to proprietary solutions like EDI/B2B. &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Support for Other communication means&lt;/i&gt;: Beside SOAP over HTTP, Web Services can also be implemented on other reliable transport mechanisms. So, it gives flexibility use the communication means of your requirement and choice. For example Web Services can also be implemented using ftp protocol (Web services over FTP).&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Loosely Coupled Applications&lt;/i&gt;: Web Services are self-describing software modules which encapsulates discrete functionality. Web Services are accessible via standard Internet communication protocols like XML and SOAP. These Web Services can be developed in any technologies (like c++, Java, .NET, PHP, Perl etc.) and any application or Web Services can access these services. So, the Web Services are loosely coupled application and can be used by applications developed in any technologies. For example, I have heard of people developing Web Services using Java technologies and using the Web Services in VB or .NET applications.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Web Services Sharing&lt;/i&gt;: These days due to complexness of the business, organizations are using different technologies like EAI, EDI, B2B, Portals etc. for distributing computing. Web Services supports all these technologies, thus helping the business to use existing investments in other technologies.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Web Services are Self Describing&lt;/i&gt;: Web Services are self describing applications, which reduces the software development time. This helps the other business partners to quickly develop application and start doing business. This helps business to save time and money by cutting development time.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Automatic Discovery&lt;/i&gt;: Web Services automatic discovery mechanism helps the business to easy find the Service Providers. This also helps your customer to find your services easily. With the help of Web Services your business can also increase revenue by exposing their own Web Services available to others.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Business Opportunity&lt;/i&gt;: Web Services has opened the door to new business opportunities by making it easy to connect with partners.&lt;br /&gt;
&lt;b&gt;WebService with database Mysql - A database driven webservice&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
Software required to develop and run this example:&lt;br /&gt;
&lt;br /&gt;
JDK 1.6 &lt;br /&gt;
NetBeans 6.1 &lt;br /&gt;
MySQL Database 5 or above &lt;br /&gt;
click url::http://www.roseindia.net/webservices/web-services-database.shtml</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/7941565275867851005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/7941565275867851005'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2010/01/web-services.html' title='Web Services'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-3351560597699835873</id><published>2009-12-20T21:18:00.001-08:00</published><updated>2009-12-29T01:10:23.926-08:00</updated><title type='text'>website link</title><content type='html'>demo eclipse video:&lt;br /&gt;
http://www.mirror.in.th./osarchive/eclipse/technology/phoenix/demos/install-ve/install-ve.html&lt;br /&gt;
&lt;br /&gt;
http://sourceforge.net/projects/easyeclipse/files/&lt;br /&gt;
&lt;br /&gt;
all plugin updatesite:&lt;br /&gt;
http://eclipse-plugins.2y.net/eclipse/plugins.jsp;jsessionid=60179A11877482E70B290590C1B30146?category=Code+Generation&lt;br /&gt;
&lt;br /&gt;
appfuse updatesite&lt;br /&gt;
https://appfusegenerator.dev.java.net/&lt;br /&gt;
&lt;br /&gt;
spring- Hibernate integration sample application&lt;br /&gt;
&lt;br /&gt;
http://docs.huihoo.com/spring/Lightweight-Applications-with-Spring-Hibernate-and-Java-EE-5.pdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
adobe Flex3 demo &lt;br /&gt;
http://livedocs.adobe.com/flex/3/html/index.html&lt;br /&gt;
http://learn.adobe.com/wiki/display/Flex/Download+Projects</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3351560597699835873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/3351560597699835873'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2009/12/website-link.html' title='website link'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-8645657584419071</id><published>2009-12-20T10:50:00.000-08:00</published><updated>2009-12-20T10:58:31.183-08:00</updated><title type='text'>Appfuse 2.0 Review</title><content type='html'>Appfuse 2.0 Review&lt;br /&gt;&lt;br /&gt;AppFuse is an open source project and application that uses open source tools built on the Java platform to help you develop&lt;br /&gt;web applications quickly and efficiently.&lt;br /&gt;&lt;br /&gt;What is AppFuse?&lt;br /&gt;&lt;br /&gt;AppFuse is an application for “kickstarting” J2EE web application development. It consists of a set of libraries, jsp’s, templates and several build scripts. Running the ant new target in the AppFuse root directory will prompt for a few parameters of the target application, like database and package names. AppFuse then generates and copies a deployable web application that can serve as a starting point for further application development.&lt;br /&gt;&lt;br /&gt;How well does AppFuse work in practice?&lt;br /&gt;&lt;br /&gt;To find out how well AppFuse really works, I followed the QuickStart Guide, the Creating new DAOs and Objects in AppFuse, the Creating new Managers, the Creating Spring Controllers and JSPs and the Adding Validation and List Screen tutorials. I then tried to port the generated code to another RDBMS (Cloudscape 10.1). I also had a go at replacing the default two column page design with a three column design.&lt;br /&gt;&lt;br /&gt;These are my findings.&lt;br /&gt;&lt;br /&gt;Strengths&lt;br /&gt;&lt;br /&gt;    * Short startup time - I had a deployable, database driven, tested, 3-Tier J2EE application supporting authentication, authorization, logging, click through tracing etc. in less than 3 hours. Even taken into account that I already had a complete Java environment installed on my machine (JDK, Eclipse, MySQL, Ant), this is fast … very fast.&lt;br /&gt;    * Choose between IBatis and Hibernate - for persistence, AppFuse lets you chose between a DAO layer implemented using IBatis or Hibernate.&lt;br /&gt;    * Choose between Spring MVC, Tapestry, Webwork orJSF - for the Web Tier, you can chose between two Component based (Tapestry and JSF) or two Request based web frameworks (Spring MVC, Webwork).&lt;br /&gt;    * Support for Test Driven Development- apart from DAO, Manager and Web classes, AppFuse also generates Test Cases and the ant targets to run them, either individually or in logical groups (test-dao, test-web, etc.).&lt;br /&gt;    * Build script - the Ant build script consists of 1200 lines and 65 targets and covers everything from dropping, creating and populating the database to deploying to Tomcat and fixing CRLF for Unix Machines.&lt;br /&gt;    * Integration with Sitemesh - the JSP’s are build up using the the Sitemesh templating library, providing for clean separation between content and layout directives. Compared to for instance Tiles, Sitemesh is more powerfull and flexible.&lt;br /&gt;    * Released under the Apache License - it lets us freely use the software for company internal and commercial purposes and does not require us to submit changes that we make to the software back to the Apache Software Foundation.&lt;br /&gt;    * Documentation and community support - the tutorials and JavaDoc are quite good, and there is an active developer community using the software.&lt;br /&gt;&lt;br /&gt;Weaknesses&lt;br /&gt;&lt;br /&gt;    * MySQL only - the generated code is targeted at the MySQL database system. AppFuse does not support other RDBMS out of the box - manual adaptations of the generated code are necessary to achieve this.&lt;br /&gt;    * No clean dependency management - AppFuse relies on ant build scripts and properties files to configure its (50+) dependencies. Usage of a tool like Ivy, a simple to use but powerfull dependency manager would be nice instead.&lt;br /&gt;    * Heavy reliance on XDoclet for code generation - this leads to code that belongs in the Integration Layer (i.e. Hibernate mapping definitions and column names) being part of the Domain Layer.&lt;br /&gt;    * Large build scripts - although they do provide a lot of functionality, the large build scripts are difficult to understand and maintain. It is also not always clear what the different targets do and how they depend on each other.&lt;br /&gt;    * Usage of Business Keys as PKs - in general, when using Hibernate, it is a best practice to use Surrogate Keys as PKs for database tables representing Business Objects (”User”, “Car” etc.). AppFuse ignores this and uses the Business Keys as PKs.&lt;br /&gt;    * Small committer base - it is unclear to me how large the developer base is that actively maintains and develops the AppFuse project. This is something to investigate when planning any long running projects.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In a typical web application, it is common to have a login screen, registration screen, content storage in database, security and most importantly testing.&lt;br /&gt;&lt;br /&gt;When building a Java web application, we might start adding one jar file after another to implement a particular user story.&lt;br /&gt;&lt;br /&gt;For example, if i want to have ACEGI security for my web app, I might download ACEGI jar, map and configure it in web.xml and security.xml files.&lt;br /&gt;&lt;br /&gt;What if, there exists a toolkit that already provides these common features to us. ?&lt;br /&gt;For instance...&lt;br /&gt;&lt;br /&gt;    ACEGI security&lt;br /&gt;    Hibernate integration&lt;br /&gt;    AJAX templates&lt;br /&gt;    Switchable CSS framework&lt;br /&gt;    Unit test&lt;br /&gt;    Layout reuse&lt;br /&gt;    PDF support&lt;br /&gt;    Excel support and so on...&lt;br /&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Installing Appfuse is easy for people who have basic knowledge of Maven 2. We took the Spring MVC Basic archetype of Appfuse, as the team already had good expertise on Spring/Hibernate/Junit.&lt;br /&gt;&lt;br /&gt;The Spring MVC Basic archetype was made with excellent set of framework and libraries, some of them include Hibernate, JUnit, Spring MVC,DisplayTag, DWR and so on. The good thing is, its also supports most of commonly used databases.&lt;br /&gt;&lt;br /&gt;It took very short time to add a new spring-mvc jsp page, a spring controller and the related test cases.&lt;br /&gt;It took hardly no time to add our own language extension for internationalization, because Appfuse comes with ready made templates.&lt;br /&gt;&lt;br /&gt;At one point, we wanted to extend the user registration form, spring controller and the database. I was able to do it with the help of documentation provided on the Appfuse website.&lt;br /&gt;&lt;br /&gt;It takes a while to understand the whole structure of the project, but I dont feel it wasted my time on learning it&#39;s structure.&lt;br /&gt;Heavily based on many external jars files so you never know when they will become obsolete.One can also argue that is not the problem of Appfuse but the individual package. We faced some compatibility issues on using the jars but later we managed to correct them using our pom.xml&lt;br /&gt;&lt;br /&gt;I strongly recommend to the spring developers to look in to the Appfuse application before you start developing your own set of common features and requirements for your web application.&lt;br /&gt;This helps you not to re-invent wheel and saves time and effort.&lt;br /&gt;&lt;br /&gt;The mailing list/user community is very active in answering the queries. The Appfuse team is also very active in keeping their application at par with new changes in the technology.&lt;br /&gt;Apart from Spring MVC archetype, Appfuse also has its archetype for JSF, Struts and Tapestry. Checkout Appfuse website for more info about online demos, tutorials and release roadmap.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://appfuse.org/display/APF/Home&lt;br /&gt;&lt;br /&gt;http://appfuse.org/display/APF/Demos+and+Videos&lt;br /&gt;&lt;br /&gt;Conclusion&lt;br /&gt;AppFuse does what it promises to do, which is always nice: it kick starts a J2EE project in a very short period of time. In my opinion, this makes it a very good tool for Consultants that are assigned to small to medium sized, Proof of Concept like projects. Here AppFuse really shines and should be used to its full extent, meaning including all XDoclet code generation features and ant targets.&lt;br /&gt;&lt;br /&gt;For larger projects, that will be running over longer periods of time, that have to integrate with other RDBMS like Oracle and need a clean dependency management, AppFuse can serve as a starting point. In that case though, one really has to invest the time to refactor the generated code.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/8645657584419071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/8645657584419071'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2009/12/appfuse-20-review.html' title='Appfuse 2.0 Review'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-5453740056951510549</id><published>2009-12-13T08:25:00.000-08:00</published><updated>2009-12-20T11:02:41.081-08:00</updated><title type='text'>Hibernate 3.0</title><content type='html'>What is Hibernate?&lt;br /&gt;Hibernate 3.0, the latest Open Source persistence technology&lt;br /&gt;at the heart of J2EE EJB 3.0 is available for download from Hibernet.org.The Hibernate 3.0 core is 68,549 lines of Java code together with 27,948 lines of unit tests, all freely available under the LGPL, and has been in development for well over a year. Hibernate maps the Java classes to the database tables. It also provides the data query and retrieval facilities that significantly reduces the development time.  Hibernate is not the best solutions for data centric applications that only uses the stored-procedures to implement the business logic in database. It is most useful with object-oriented domain modes and business logic in the Java-based middle-tier. Hibernate allows transparent persistence that enables the applications to switch any database. Hibernate can be used in Java Swing applications, Java Servlet-based applications, or J2EE applications using EJB session beans.&lt;br /&gt;&lt;br /&gt;Features of Hibernate&lt;br /&gt;&lt;br /&gt;    * Hibernate 3.0 provides three full-featured query facilities: Hibernate Query Language, the newly enhanced Hibernate Criteria Query API, and enhanced support for queries expressed in the native SQL dialect of the database.&lt;br /&gt;        &lt;br /&gt;    * Filters for working with temporal (historical), regional or permissioned data.&lt;br /&gt;         &lt;br /&gt;    * Enhanced Criteria query API: with full support for projection/aggregation and subselects.&lt;br /&gt;        &lt;br /&gt;    * Runtime performance monitoring: via JMX or local Java API, including a second-level cache browser.&lt;br /&gt;        &lt;br /&gt;    * Eclipse support, including a suite of Eclipse plug-ins for working with Hibernate 3.0, including mapping editor, interactive query prototyping, schema reverse engineering tool.&lt;br /&gt;         &lt;br /&gt;    * Hibernate is Free under LGPL: Hibernate can be used to develop/package and distribute the applications for free.&lt;br /&gt;         &lt;br /&gt;    * Hibernate is Scalable: Hibernate is very performant and due to its dual-layer architecture can be used in the clustered environments.&lt;br /&gt;        &lt;br /&gt;    * Less Development Time: Hibernate reduces the development timings as it supports inheritance, polymorphism, composition and the Java Collection framework.&lt;br /&gt;        &lt;br /&gt;    * Automatic Key Generation: Hibernate supports the automatic generation of primary key for your.&lt;br /&gt;        &lt;br /&gt;    *  JDK 1.5 Enhancements: The new JDK has been released as a preview earlier this year and we expect a slow migration to the new 1.5 platform throughout 2004. While Hibernate3 still runs perfectly with JDK 1.2, Hibernate3 will make use of some new JDK features. JSR 175 annotations, for example, are a perfect fit for Hibernate metadata and we will embrace them aggressively. We will also support Java generics, which basically boils down to allowing type safe collections.&lt;br /&gt;    &lt;br /&gt;        &lt;br /&gt;    * Hibernate XML binding enables data to be represented as XML and POJOs interchangeably.    &lt;br /&gt;&lt;br /&gt;Detailed features are available at http://www.hibernate.org/About/RoadMap.&lt;br /&gt;&lt;br /&gt;In this lesson you will learn the architecture of Hibernate.  The following diagram describes the high level&lt;br /&gt; &lt;span style=&quot;font-weight:bold;&quot;&gt;architecture of hibernate&lt;/span&gt;: &lt;br /&gt;&lt;br /&gt;Hibernate architecture has three main components:&lt;br /&gt;&lt;br /&gt;    * Connection Management&lt;br /&gt;&lt;br /&gt;      Hibernate Connection management service provide efficient management of the database connections. Database connection is the most expensive part of interacting with the database as it requires a lot of resources of open and close the database connection.&lt;br /&gt;        &lt;br /&gt;    * Transaction management:&lt;br /&gt;&lt;br /&gt;      Transaction management service provide the ability to the user to execute more than one database statements at a time.&lt;br /&gt;        &lt;br /&gt;    * Object relational mapping:&lt;br /&gt;&lt;br /&gt;      Object relational mapping is technique of mapping the data representation from an object model to a relational data model. This part of the hibernate is used to select, insert, update and delete the records form the underlying table. When we pass an object to a Session.save() method, Hibernate reads the state of the variables of that object and executes the necessary query. &lt;br /&gt;&lt;br /&gt;Hibernate is very good tool as far as object relational mapping is concern, but in terms of connection management and transaction management, it is lacking in performance and capabilities. So usually hibernate is being used with other connection management and transaction management tools. For example apache DBCP is used for connection pooling with the Hibernate.&lt;br /&gt;&lt;br /&gt;Hibernate provides a lot of flexibility in use. It is called &quot;Lite&quot; architecture when we only uses the object relational mapping component. While in &quot;Full Cream&quot; architecture all the three component Object Relational mapping, Connection Management and Transaction Management) are used.&lt;br /&gt;&lt;br /&gt;Writing First Hibernate Code&lt;br /&gt;&lt;br /&gt;In this section I will show you how to create a simple program to insert record in MySQL database. You can run this program from Eclipse or from command prompt as well. I am assuming that you are familiar with MySQL and Eclipse environment.&lt;br /&gt;&lt;br /&gt;Configuring Hibernate&lt;br /&gt;In this application&lt;br /&gt;Hibernate provided connection pooling and transaction management is used for simplicity. Hibernate uses the hibernate.cfg.xml to create the connection pool and setup required environment.&lt;br /&gt;&lt;br /&gt;Here is the code:&lt;br /&gt;&lt;br /&gt;&lt;?xml version=&#39;1.0&#39; encoding=&#39;utf-8&#39;?&gt;&lt;br /&gt;&lt;!DOCTYPE hibernate-configuration PUBLIC&lt;br /&gt;&quot;-//Hibernate/Hibernate Configuration DTD//EN&quot;&lt;br /&gt;&quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;hibernate-configuration&gt;&lt;br /&gt;&lt;session-factory&gt;&lt;br /&gt;      &lt;property name=&quot;hibernate.connection.driver_class&quot;&gt;&lt;br /&gt;&lt;br /&gt;com.mysql.jdbc.Driver&lt;/property&gt;&lt;br /&gt;      &lt;property name=&quot;hibernate.connection.url&quot;&gt;&lt;br /&gt;&lt;br /&gt;jdbc:mysql://localhost/hibernatetutorial&lt;/property&gt;&lt;br /&gt;      &lt;property name=&quot;hibernate.connection.username&quot;&gt;root&lt;/property&gt;&lt;br /&gt;      &lt;property name=&quot;hibernate.connection.password&quot;&gt;&lt;/property&gt;&lt;br /&gt;      &lt;property name=&quot;hibernate.connection.pool_size&quot;&gt;10&lt;/property&gt;&lt;br /&gt;      &lt;property name=&quot;show_sql&quot;&gt;true&lt;/property&gt;&lt;br /&gt;      &lt;property name=&quot;dialect&quot;&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;&lt;br /&gt;      &lt;property name=&quot;hibernate.hbm2ddl.auto&quot;&gt;update&lt;/property&gt;&lt;br /&gt;      &lt;!-- Mapping files --&gt;&lt;br /&gt;      &lt;mapping resource=&quot;contact.hbm.xml&quot;/&gt;&lt;br /&gt;&lt;/session-factory&gt;&lt;br /&gt;&lt;/hibernate-configuration&gt;&lt;br /&gt;&lt;br /&gt;In the above configuration file we specified to use the &quot;hibernatetutorial&quot; which is running on localhost and the user of the database is root with no password. The dialect property  is org.hibernate.dialect.MySQLDialect which tells the Hibernate that we are using MySQL Database. Hibernate supports many database. With the use of the Hibernate (Object/Relational Mapping and Transparent Object Persistence for Java and SQL Databases),  we can use the following databases dialect type property:&lt;br /&gt;&lt;br /&gt;    * DB2 - org.hibernate.dialect.DB2Dialect&lt;br /&gt;    * HypersonicSQL - org.hibernate.dialect.HSQLDialect&lt;br /&gt;    * Informix - org.hibernate.dialect.InformixDialect&lt;br /&gt;    * Ingres - org.hibernate.dialect.IngresDialect&lt;br /&gt;    * Interbase - org.hibernate.dialect.InterbaseDialect&lt;br /&gt;    * Pointbase - org.hibernate.dialect.PointbaseDialect&lt;br /&gt;    * PostgreSQL - org.hibernate.dialect.PostgreSQLDialect&lt;br /&gt;    * Mckoi SQL - org.hibernate.dialect.MckoiDialect&lt;br /&gt;    * Microsoft SQL Server - org.hibernate.dialect.SQLServerDialect&lt;br /&gt;    * MySQL - org.hibernate.dialect.MySQLDialect&lt;br /&gt;    * Oracle (any version) - org.hibernate.dialect.OracleDialect&lt;br /&gt;    * Oracle 9 - org.hibernate.dialect.Oracle9Dialect&lt;br /&gt;    * Progress - org.hibernate.dialect.ProgressDialect&lt;br /&gt;    * FrontBase - org.hibernate.dialect.FrontbaseDialect&lt;br /&gt;    * SAP DB - org.hibernate.dialect.SAPDBDialect&lt;br /&gt;    * Sybase - org.hibernate.dialect.SybaseDialect&lt;br /&gt;    * Sybase Anywhere - org.hibernate.dialect.SybaseAnywhereDialect&lt;br /&gt;&lt;br /&gt;The &lt;mapping resource=&quot;contact.hbm.xml&quot;/&gt; property is the mapping for our contact table.&lt;br /&gt;&lt;br /&gt;Writing First Persistence Class&lt;br /&gt;Hibernate uses the Plain Old Java Objects (POJOs) classes to map to the database table. We can configure the variables to map to the database column. Here is the code for Contact.java:&lt;br /&gt;package roseindia.tutorial.hibernate;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * @author Deepak Kumar&lt;br /&gt; *&lt;br /&gt; * Java Class to map to the datbase Contact Table&lt;br /&gt; */&lt;br /&gt;public class Contact {&lt;br /&gt;  private String firstName;&lt;br /&gt;  private String lastName;&lt;br /&gt;  private String email;&lt;br /&gt;  private long id;&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * @return Email&lt;br /&gt;   */&lt;br /&gt;  public String getEmail() {&lt;br /&gt;    return email;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * @return First Name&lt;br /&gt;   */&lt;br /&gt;  public String getFirstName() {&lt;br /&gt;    return firstName;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /** &lt;br /&gt;   * @return Last name&lt;br /&gt;   */&lt;br /&gt;  public String getLastName() {&lt;br /&gt;    return lastName;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * @param string Sets the Email&lt;br /&gt;   */&lt;br /&gt;  public void setEmail(String string) {&lt;br /&gt;    email = string;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * @param string Sets the First Name&lt;br /&gt;   */&lt;br /&gt;  public void setFirstName(String string) {&lt;br /&gt;    firstName = string;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * @param string sets the Last Name&lt;br /&gt;   */&lt;br /&gt;  public void setLastName(String string) {&lt;br /&gt;    lastName = string;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * @return ID Returns ID&lt;br /&gt;   */&lt;br /&gt;  public long getId() {&lt;br /&gt;    return id;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * @param l Sets the ID&lt;br /&gt;   */&lt;br /&gt;  public void setId(long l) {&lt;br /&gt;    id = l;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Mapping the Contact Object to the Database Contact table&lt;br /&gt;The file contact.hbm.xml is used to map Contact Object to the Contact table in the database. Here is the code for contact.hbm.xml:&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;!DOCTYPE hibernate-mapping PUBLIC &lt;br /&gt;&quot;-//Hibernate/Hibernate Mapping DTD 3.0//EN&quot;&lt;br /&gt;&quot;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;hibernate-mapping&gt;&lt;br /&gt;  &lt;class name=&quot;roseindia.tutorial.hibernate.Contact&quot; table=&quot;CONTACT&quot;&gt;&lt;br /&gt;   &lt;id name=&quot;id&quot; type=&quot;long&quot; column=&quot;ID&quot; &gt;&lt;br /&gt;   &lt;generator class=&quot;assigned&quot;/&gt;&lt;br /&gt;  &lt;/id&gt;&lt;br /&gt;&lt;br /&gt;  &lt;property name=&quot;firstName&quot;&gt;&lt;br /&gt;     &lt;column name=&quot;FIRSTNAME&quot; /&gt;&lt;br /&gt;  &lt;/property&gt;&lt;br /&gt;  &lt;property name=&quot;lastName&quot;&gt;&lt;br /&gt;    &lt;column name=&quot;LASTNAME&quot;/&gt;&lt;br /&gt;  &lt;/property&gt;&lt;br /&gt;  &lt;property name=&quot;email&quot;&gt;&lt;br /&gt;    &lt;column name=&quot;EMAIL&quot;/&gt;&lt;br /&gt;  &lt;/property&gt;&lt;br /&gt; &lt;/class&gt;&lt;br /&gt;&lt;/hibernate-mapping&gt;&lt;br /&gt;&lt;br /&gt;Setting Up MySQL Database&lt;br /&gt;In the configuration file(hibernate.cfg.xml) we have specified to use hibernatetutorial database running on localhost.  So, create the databse (&quot;hibernatetutorial&quot;) on the MySQL server running on localhost.&lt;br /&gt;&lt;br /&gt;Developing Code to Test Hibernate example&lt;br /&gt;Now we are ready to write a program to insert the data into database. We should first understand about the Hibernate&#39;s Session. Hibernate Session is the main runtime interface&lt;br /&gt;between a Java application and Hibernate. First we are required to get the Hibernate Session.SessionFactory allows application to create the Hibernate Sesssion by reading the configuration from hibernate.cfg.xml file.  Then the save method on session object is used to save the contact information to the database:&lt;br /&gt;&lt;br /&gt;session.save(contact)&lt;br /&gt;&lt;br /&gt;Here is the code of FirstExample.java&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;package roseindia.tutorial.hibernate;&lt;br /&gt;&lt;br /&gt;import org.hibernate.Session;&lt;br /&gt;import org.hibernate.SessionFactory;&lt;br /&gt;import org.hibernate.cfg.Configuration;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * @author Deepak Kumar&lt;br /&gt; *&lt;br /&gt; * http://www.roseindia.net&lt;br /&gt; * Hibernate example to inset data into Contact table&lt;br /&gt; */&lt;br /&gt;public class FirstExample {&lt;br /&gt;  public static void main(String[] args) {&lt;br /&gt;    Session session = null;&lt;br /&gt;&lt;br /&gt;    try{&lt;br /&gt;      // This step will read hibernate.cfg.xml &lt;br /&gt;&lt;br /&gt;and prepare hibernate for use&lt;br /&gt;      SessionFactory sessionFactory = new &lt;br /&gt;&lt;br /&gt;Configuration().configure().buildSessionFactory();&lt;br /&gt;       session =sessionFactory.openSession();&lt;br /&gt;        //Create new instance of Contact and set &lt;br /&gt;&lt;br /&gt;values in it by reading them from form object&lt;br /&gt;         System.out.println(&quot;Inserting Record&quot;);&lt;br /&gt;        Contact contact = new Contact();&lt;br /&gt;        contact.setId(3);&lt;br /&gt;        contact.setFirstName(&quot;Deepak&quot;);&lt;br /&gt;        contact.setLastName(&quot;Kumar&quot;);&lt;br /&gt;        contact.setEmail(&quot;deepak_38@yahoo.com&quot;);&lt;br /&gt;        session.save(contact);&lt;br /&gt;        System.out.println(&quot;Done&quot;);&lt;br /&gt;    }catch(Exception e){&lt;br /&gt;      System.out.println(e.getMessage());&lt;br /&gt;    }finally{&lt;br /&gt;      // Actual contact insertion will happen at this step&lt;br /&gt;      session.flush();&lt;br /&gt;      session.close();&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;    &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;http://www.roseindia.net/struts/hibernate-spring/index.shtml&lt;br /&gt;}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/5453740056951510549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/5453740056951510549'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2009/12/introduction-to-hibernate-30.html' title='Hibernate 3.0'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5158645802029540923.post-4266690419654005761</id><published>2009-12-13T07:08:00.000-08:00</published><updated>2009-12-13T07:20:13.662-08:00</updated><title type='text'>MVC Architecture</title><content type='html'>The main aim of the MVC architecture  is to separate the business logic and application data from the presentation data to the user.&lt;br /&gt;&lt;br /&gt;M ---&gt;in MVC stands for the MODEL&lt;br /&gt;V ---&gt;in MVC stands for the VIEW&lt;br /&gt;C ---&gt;in MVC stands for the CONTROLLER&lt;br /&gt;&lt;br /&gt;Here are the reasons why we should use the MVC design pattern&lt;br /&gt;.&lt;br /&gt;&lt;br /&gt;   1. They are resuable : When the problems recurs, there is no need to invent a new solution, we just have to follow the pattern and adapt it as necessary.&lt;br /&gt;   2. They are expressive: By using the MVC design pattern our application becomes more expressive.&lt;br /&gt;&lt;br /&gt;1).  Model: The model object knows about all the data that need to be displayed. It is model who is aware about all the operations that can be applied to transform that object. It only represents the data of an application. The model represents enterprise data and the business rules that govern access to and updates of this data. Model is not aware about the presentation data and how that data will be displayed &lt;br /&gt;&lt;br /&gt;2).  View : The view represents the presentation of the application. The view object refers to the model. It uses the query methods of the model to obtain the contents and renders it. The view is not dependent on the application logic. It remains same if there is any modification in the business logic. In other words, we can say that it is the responsibility of the of the view&#39;s to maintain the consistency in its presentation when the model changes.&lt;br /&gt;&lt;br /&gt;3). Controller:  Whenever the user sends a request for something then it always go through the controller. The controller is responsible for intercepting the requests from view and passes it to the model for the appropriate action. After the action has been taken on the data, the controller is responsible for directing the appropriate view to the user. In  GUIs, the views and the controllers often work very closely together.&lt;br /&gt;&lt;br /&gt;Difference between Model 1 and Model 2 architecture:&lt;br /&gt;&lt;br /&gt;Features of MVC1:&lt;br /&gt;&lt;br /&gt;   1. Html or jsp files are used to code the presentation. To retrieve the data JavaBean can be used.&lt;br /&gt;   2. In mvc1 archictecture all the view, control elements are implemented using Servlets or Jsp.&lt;br /&gt;   3. In MVC1 there is tight coupling between page and model as data access is usually done using Custom tag or through java bean call.&lt;br /&gt;&lt;br /&gt;Features of MVC2:&lt;br /&gt;&lt;br /&gt;   1. The MVC2  architecture removes the page centric property of MVC1 architecture by separating Presentation, control logic and the application state.&lt;br /&gt;   2. In MVC2 architecture there is only one controller which receives all the request for the application and is responsible for taking appropriate action in response to each request.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/4266690419654005761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5158645802029540923/posts/default/4266690419654005761'/><link rel='alternate' type='text/html' href='http://neelakandan85.blogspot.com/2009/12/mvc-architecture.html' title='MVC Architecture'/><author><name>Neelu</name><uri>http://www.blogger.com/profile/05018775959658009967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='17' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzmotkqzvwe_ENaJon8lolSj-ZngLpNGe1hrGWXPAPB0qroVqN9NnTjDGtNjjG0Nmu0yvRREcBZtS7hiO5_s6fNDY4BTaA_iPi7dmY0orXxa2xj8FO5yzFdhhHm_wA_34/s220/neela.jpeg'/></author></entry></feed>