tag:blogger.com,1999:blog-3434050733444052942024-02-20T14:07:17.291+05:30Development Is NothingSubhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.comBlogger336125tag:blogger.com,1999:blog-343405073344405294.post-157619595311199712016-09-09T19:48:00.002+05:302016-09-09T19:51:35.190+05:30UTL_FILE and newline character<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<h3 class="post-title entry-title" itemprop="name" style="background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 22px; font-stretch: normal; margin: 0px; position: relative;">
</h3>
<div class="post-header" style="background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;">
<div class="post-header-line-1">
</div>
</div>
<div class="post-body entry-content" id="post-body-7467755018938301743" itemprop="description articleBody" style="background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px; position: relative; width: 756px;">
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">Two different objections:<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoListParagraph" style="text-indent: -0.25in;">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">1. 1.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">"The answer using CHR(10) is not correct as CHR(10) is not the platform-specific line terminator(s) on Windows and some other OSs".</span></div>
<div class="MsoListParagraph" style="text-indent: -0.25in;">
</div>
<div class="MsoListParagraph" style="text-indent: -0.25in;">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">2. 2.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">"The answers that put a newline after "abc" are not valid answers according to your specification."<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">We'll answer each objection in turn.<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;"><br /></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<b><span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">CHR(10)<o:p></o:p></span></b></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="color: black; font-family: "verdana" , sans-serif; font-size: 10pt;">We can certainly understand the response we got, since we felt the same way when it was initially brought to our attention. At that point, however, we took a closer look and discovered some very interesting behavior by Oracle and UTL_FILE regarding the handling of line terminators.</span><span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;"> </span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">It <i>is</i> correct that CHR(10) (LineFeed or LF) is not the platform-specific line terminator(s) on Windows (that would be CHR(13) || CHR(10) -- CarriageReturn + LineFeed or CF + LF) but the file is opened in text mode (default) so Oracle translates any LF to the platform-specific line terminator(s) on the platform of the host. So if it runs on Windows, LF is translated to CR + LF, if it runs on Linux, LF stays as LF.<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;"></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">This can be verified on Windows through the following code sample (assuming that the directory TEMP points to c:\temp):<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span style="font-family: "consolas"; font-size: 10pt;">host del c:\temp\quiz.txt<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">DECLARE<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">l_file UTL_FILE.file_type;<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">BEGIN<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">l_file := UTL_FILE.FOPEN('TEMP', 'quiz.txt', 'W');<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUT (l_file, 'First' || chr(10));<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUT (l_file, 'Second' || chr(13) || chr(10));<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUT (l_file, 'Third' || chr(10) || chr(13));<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUT_LINE (l_file, 'Fourth');<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUTF (l_file, 'Fifth\n');<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.FCLOSE (l_file);<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">END;<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">/<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">host debug c:\temp\quiz.txt<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">If you're on Windows Vista or newer, debug is no longer part of your Windows version. ). To get a hex dump of a file under Windows one can use a free utility called HexDump32:<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">This will demonstrate that the contents of the file is actually (OD = CR, 0A = LF):<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">00000000 46 69 72 73 74 <span style="background: none 0% 0% repeat scroll yellow;">0D 0A</span> 53-65 63 6F 6E 64 <span style="background: none 0% 0% repeat scroll yellow;">0D 0D 0A</span> First..Second...<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">00000010 54 68 69 72 64 <span style="background: none 0% 0% repeat scroll yellow;">0D 0A 0D</span>-46 6F 75 72 74 68 <span style="background: none 0% 0% repeat scroll yellow;">0D 0A</span> Third...Fourth..<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">00000020 46 69 66 74 68 <span style="background: none 0% 0% repeat scroll yellow;">0D 0A</span> - Fifth..<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">So when a file is opened in text mode, UTL_FILE does this:<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoListParagraph" style="text-indent: -0.25in;">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">1.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">First: CHR(10) is written as OD OA, CHR(13) + CHR(10).<o:p></o:p></span></div>
<div class="MsoListParagraph" style="text-indent: -0.25in;">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">2.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">Second: CHR(13) || CHR(10) is written as OD OD OA, CHR(13) + CHR(13) + CHR(10).<o:p></o:p></span></div>
<div class="MsoListParagraph" style="text-indent: -0.25in;">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">3.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">Third: CHR(10) || CHR(13) is written as OD OA OD, CHR(13) + CHR(10) + CHR(13).<o:p></o:p></span></div>
<div class="MsoListParagraph" style="text-indent: -0.25in;">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">4.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">Fourth: PUT_LINE correctly puts OD OA, CHR(13) + CHR(10).<o:p></o:p></span></div>
<div class="MsoListParagraph" style="text-indent: -0.25in;">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">5.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">Fifth: PUTF correctly puts \n as OD OA, CHR(13) + CHR(10).<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">On Linux, you can similarly verify the behavior (assuming that the directory TEMP points to /tmp):<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">host rm /tmp/quiz.txt<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">DECLARE<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">l_file UTL_FILE.file_type;<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">BEGIN<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">l_file := UTL_FILE.FOPEN('TEMP', 'quiz.txt', 'W');<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUT (l_file, 'First' || chr(10));<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUT (l_file, 'Second' || chr(13) || chr(10));<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUT (l_file, 'Third' || chr(10) || chr(13));<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUT_LINE (l_file, 'Fourth');<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUTF (l_file, 'Fifth\n');<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.FCLOSE (l_file);<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">END;<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">/<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">host hexdump –C /tmp/quiz.txt<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">Why does Oracle do this? Probably because UTL_FILE is implemented in C and this is how it's done in C's functions fopen and fprintf when a file is opened in text mode. Admittedly, it's not well described in the Oracle documentation.<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">You can also open files with UTL_FILE in byte mode but in this case you can only use procedures PUT_RAW and GET_RAW. If you use any of the other subprograms UTL_FILE will raise an UTL_FILE.INVALID_OPERATION exception. With byte mode, Oracle doesn't do any translation of newline characters, which is demonstrated in the following (to be run under Windows):<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span style="font-family: "consolas"; font-size: 10pt;">host del c:\temp\quiz.bin<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">DECLARE<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">l_file UTL_FILE.file_type;<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">BEGIN<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">l_file := UTL_FILE.FOPEN('TEMP', 'quiz.bin', 'wb');<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUT_RAW (l_file, utl_raw.cast_to_raw('First' || chr(10)));<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUT_RAW (l_file, utl_raw.cast_to_raw('Second' || chr(13) || chr(10)));<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.PUT_RAW (l_file, utl_raw.cast_to_raw('Third' || chr(10) || chr(13)));<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">UTL_FILE.FCLOSE (l_file);<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">END;<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">/<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">host debug c:\temp\quiz.bin<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">This demonstrates the following contents:<o:p></o:p></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">00000000 46 69 72 73 74 <span style="background: none 0% 0% repeat scroll yellow;">0A</span> 53 65-63 6F 6E 64 <span style="background: none 0% 0% repeat scroll yellow;">0D</span> 0A 54 68 First.Second..Th<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;">00000010 69 72 64 <span style="background: none 0% 0% repeat scroll yellow;">0A 0D</span> - ird..<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "consolas"; font-size: 10pt;"><br /></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<b><span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">Newline after "abc"<o:p></o:p></span></b></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;">We argue that the line terminator (= newline) is part of the line (like an End Of File is part of a file so is End Of Line part of a line) so as long as "abc" is put on a separate line (with optional line terminator), coming after 2 empty lines (with line terminator) the code meets the specification.<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;"><br /></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "verdana" , sans-serif; font-size: 10pt;"><br /></span></div>
</div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-15073621209634545042016-04-06T10:04:00.000+05:302016-04-06T10:04:04.742+05:30KILLING A WINDOWS SERVICE THAT IS KEEP ON "STOPPING"<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "verdana" , sans-serif;"><br /></span>
<span style="font-family: "verdana" , sans-serif;"><br /></span>
<br />
<h2 style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #4b4d4b; line-height: 1.5em; margin: 0px 0px 0.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: "verdana" , sans-serif; font-size: small;">Find out the Service Name</span></h2>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: "verdana" , sans-serif;">To do this, go in to services and double click on the service which has stuck. Make a note of the “Service Name”.</span></div>
<h2 style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #4b4d4b; line-height: 1.5em; margin: 0px 0px 0.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: "verdana" , sans-serif; font-size: small;">Find out the PID of the service</span></h2>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: "verdana" , sans-serif;">Open an elevated command prompt and type in:</span></div>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<code style="background: transparent; border: 0px; box-sizing: border-box; font-stretch: normal; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: pre-line; word-wrap: break-word;"><span style="font-family: "verdana" , sans-serif;"><i>sc queryex servicename</i></span></code></div>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: "verdana" , sans-serif;">(where <strong style="background: transparent; border: 0px; box-sizing: border-box; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">servicename</strong> is the name of the service you obtained from Step 1.)</span></div>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="background: transparent; border: 0px; box-sizing: border-box; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: "verdana" , sans-serif;">Make note of the PID</span></strong></div>
<h2 style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #4b4d4b; line-height: 1.5em; margin: 0px 0px 0.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: "verdana" , sans-serif; font-size: small;">Kill the PID</span></h2>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: "verdana" , sans-serif;">From the same command prompt type in:</span></div>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<code style="background: transparent; border: 0px; box-sizing: border-box; font-stretch: normal; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: pre-line; word-wrap: break-word;"><span style="font-family: "verdana" , sans-serif;"><i>taskkill /f /pid [PID]</i></span></code></div>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: "verdana" , sans-serif;">Where [PID] is the service number.</span></div>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="background: transparent; border: 0px; box-sizing: border-box; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: "verdana" , sans-serif;">If it is successful you should receive the following message:</span></strong></div>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: "verdana" , sans-serif;">SUCCESS: The process with PID XXXX has been terminated.</span></div>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; font-family: Raleway, arial, sans-serif; font-size: 15px; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; font-family: Raleway, arial, sans-serif; font-size: 15px; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="background: rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #636363; font-family: Raleway, arial, sans-serif; font-size: 15px; line-height: 25px; margin-bottom: 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com1tag:blogger.com,1999:blog-343405073344405294.post-38520522980552673632016-03-14T19:21:00.002+05:302016-03-14T19:47:20.199+05:30The constructor Service(URL, QName, WebServiceFeature[]) is undefined<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">You had produced code that needs JAX-WS 2.1. Version 2.0 does not have WebServiceFeature class, and as result also not constructor in Service with such a argument type.</span></div>
<b id="docs-internal-guid-cee80136-7564-e8f6-b9a9-541bf46a4971" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Additional option "-target 2.0" while using wsimport to generate source codes for JAX-WS 2.0 and so on.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Change your JAX-WS in the preferences. It is compatibility issue for Java 6 SE and Java EE</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Changing from Java 1.6 to Java 1.7 also solves this issue.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">You can manually add webservices-api.jar from JAX-WS 2.2 API</span><br />
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: white; color: #222426; font-family: "arial"; font-size: 15.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-65294877406793222032015-02-03T17:52:00.004+05:302015-02-03T17:52:56.500+05:30conversation history in “Pidgin Messenger” using Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
All the messenger logs will be stored under <code>.purple</code> directory located in your home directory.<br />
<br />
<pre><code>cd ~/.purple/logs/yahoo/</code></pre>
<pre><code> </code></pre>
this is the location where all your yahoo messenger chat logs will be stored.<br />
You can also view the logs by selecting <strong>"Conversation -> View Log</strong>" when you have the contact window opened.<br />
<br />
To send a message to a offline contact, use "Offline Message Emulation". Open "<strong>Tool->Plugins</strong>" and make sure you have selected "<strong>Offline Message Emulation</strong>". This will save the message you sent to a offline contact and the message will be delivered once he is online.<br />
<br />
If you are offline and a contact sends you a message that will be delivered to you when you come online.<br />
<br />
There are other good plugins for pidgin. To install the extra plugins use the command<br />
<br />
<pre><code> sudo apt-get install pidgin-plugin-pack </code></pre>
<pre><code> </code></pre>
<pre><code> </code></pre>
<pre><code> </code></pre>
<pre><code> </code></pre>
<pre><code> </code></pre>
<pre><code><span style="font-size: xx-small;"><i>source:askubuntu.com </i></span></code></pre>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-41339047278776763442014-08-20T13:03:00.001+05:302014-08-20T13:03:33.687+05:30Subhash kewat's invitation is awaiting your response<span style="display: none !important;font-size: 1px;visibility: hidden;opacity: 0;color: transparent;height: 0;width: 0;mso-hide: all;"></span> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; border-collapse:collapse; width:100% !important; font-family:Helvetica,Arial,sans-serif; margin:0; padding:0;" width="100%" bgcolor="#DFDFDF"> <tbody> <tr> <td colspan="3"> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="1"> <tbody> <tr> <td> <div style="height:5px;font-size:5px;line-height:5px;"> </div></td> </tr> </tbody> </table></td> </tr> <tr> <td> <table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="table-layout: fixed;"> <tbody> <tr> <td align="center"> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; min-width:290px;" width="600" class="responsive"> <tbody> <tr> <td style="font-family:Helvetica,Arial,sans-serif;"> <table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:8px;font-size:8px;line-height:8px"> </div></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif;" width="100%" bgcolor="#DDDDDD"> <tbody> <tr> <td align="left" valign="middle" width="95" height="21" id="base-header-logo"><a style="text-decoration:none;cursor:pointer;border:none;display:block;height:21px;width:100%;" href="http://www.linkedin.com/blink?simpleRedirect=3ANnT1UplZSrCAZqSkCcP4McChKqmRBsyRBrmZEnSZDrSMJoyRJtCVFnSRJrScJr6RBfmtKqmJzon9Q9D1JrzRQ9z0QbmVJsmpzcDFEbmdydnkMryQZpjYOtyZBbSRLoOVKqmhBqSVFr2VTtTsLbPFMt7hE&msgID=I7666161268_1&markAsRead="><img src="http://s.c.lnkd.licdn.com/scds/common/u/images/email/logos/logo_linkedin_tm_email_95x21_v1.png" width="95" height="21" alt="LinkedIn" style="border:none;text-decoration:none;" /></a></td> </tr> </tbody> </table> <table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:8px;font-size:8px;line-height:8px"> </div></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif;" width="100%" bgcolor="#333333"> <tbody> <tr> <td width="20" class="responsive-spacer"> <table width="20" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:0px;font-size:0px;line-height:0px"> </div></td> </tr> </tbody> </table></td> <td width="100%"> <table width="560" cellspacing="0" cellpadding="1" border="0" class="header-spacer" style="table-layout: fixed;"> <tbody> <tr> <td width="560"> <div style="height:12px;font-size:12px;line-height:12px;width:560px;"> </div></td> </tr> </tbody> </table></td> <td width="20" class="responsive-spacer"> <table width="20" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:0px;font-size:0px;line-height:0px"> </div></td> </tr> </tbody> </table></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%" bgcolor="#FFFFFF"> <tbody> <tr> <td width="20" class="res-width10"> <table width="20px" border="0" cellspacing="0" cellpadding="1" class="email-spacer res-width10"> <tbody> <tr> <td> <div style="height:0px;font-size:0px;line-height:0px"> </div></td> </tr> </tbody> </table></td> <td style="color: #333333; font-family: Helvetica,Arial,sans-serif; font-size: 15px; line-height: 18px;" align="left"> <table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer res-height10"> <tbody> <tr> <td> <div style="height:20px;font-size:20px;line-height:20px"> </div></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%" class="responsive"> <tbody> <tr> <td style="font-family:Helvetica,Arial,sans-serif;color:#333333;"><b>Subhash kewat</b> would like to connect on LinkedIn. How would you like to respond?</td> </tr> <tr> <td style="border-bottom-color: #E5E5E5;border-bottom-width: 1px; border-bottom-style: solid;"> <table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:20px;font-size:20px;line-height:20px"> </div></td> </tr> </tbody> </table></td> </tr> </tbody> </table> <table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:20px;font-size:20px;line-height:20px"> </div></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%"> <tbody> <tr> <td width="150" valign="top" style="vertical-align: top;" class="res-img100"><a href="http://www.linkedin.com/blink?simpleRedirect=3sNdzsUe3sOdzcPdj0ScPkMejkZh4BKrSBQonhFtCVF9CBQhDx8hnhyfnBBiShBsC5EsOoVclZMu6lvtCVFfmJB9D9Bp6VFrmlObnhMpmdzoiRLt6ZEs2RybmtSrCBvrmRLoORIrmkZpSVFqSdxsDgCpnhFtCV9pSlipn9Mfm4Cc3gJrCRNpCcOuCwJoS8Rtj1KbjRBfP9SbSkLrmZzbCVFp6lHrCBIbDtTtOYLeDdMt7hE&msgID=I7666161268_1&markAsRead=" style="text-decoration:none;cursor:pointer;"><img alt="Subhash kewat" src="http://m.c.lnkd.licdn.com/mpr/mpr/shrink_150_150/p/7/000/1b8/117/1a12993.jpg" width="150" height="150" border="0" class="res-img100" style="border:none;text-decoration:none;outline:hidden;display:block;" /></a></td> <td width="20"> <table width="20" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:0px;font-size:0px;line-height:0px"> </div></td> </tr> </tbody> </table></td> <td style="vertical-align: top; font-family: Helvetica,Arial,sans-serif;" width="100%"> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%"> <tbody> <tr> <td valign="top"><a href="http://www.linkedin.com/blink?simpleRedirect=0TcjoTe3wTczoPcPkMdzcRc3ARfkh9rCZFt65QqnpKqipFt4pUi4lQozRVpkJApn9xq7cCej5vs7xBnTpKqjRHpipOpmhKqmRBsyRQs6lzoS4JpmRxryRybmtSrCBvrmRLoORIrmkZpSVFqSdxsDgCpnhFtCV9pSlipn9Mfm4Cc3gJrCRNpCcOuCwJoS8Rtj1KbjRBfP9SbSkLrmZzbCVFp6lHrCBIbDtTtOYLeDdMt7hE&msgID=I7666161268_1&markAsRead=" style="font-size: 20px; font-weight: bold; color:#000000;text-decoration:none;">Subhash kewat</a></td> </tr> <tr> <td> <table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:3px;font-size:3px;line-height:3px"> </div></td> </tr> </tbody> </table></td> </tr> <tr> <td style="color: #666666; font-size: 15px;" class="res-font16">Senior Software Developer at UST Global</td> </tr> <tr> <td> <table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:10px;font-size:10px;line-height:10px"> </div></td> </tr> </tbody> </table></td> </tr> <tr> <td> <table border="0" cellpadding="0" cellspacing="0" align="left"> <tbody> <tr> <td align="center" height="30" valign="middle" bgcolor="#287BBC" background="http://s.c.lnkd.licdn.com/scds/common/u/img/email/bg_btn_katy_blue_medium.png" style="background:url(http://s.c.lnkd.licdn.com/scds/common/u/img/email/bg_btn_katy_blue_medium.png) repeat-x scroll bottom #287BBC;background-color:#287BBC;border:1px solid #1B5480;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px; cursor: pointer;"> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%" bgcolor="transparent"> <tbody> <tr> <td width="13"> <table width="13px" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:0px;font-size:0px;line-height:0px"> </div></td> </tr> </tbody> </table></td> <td><a href="http://www.linkedin.com/blink?simpleRedirect=dP4SdPwUdP8ScPcRc3oPdj0VdjR4imVLqnhxt6BSrCACqnh6u4x5t68Zumlbp6lOomxP9zANnT1UplZSrCAZqSkCsClArCBJpn8Jt71BoSdxbmVLt7hRoyRybmtSrCBvrmRLoORIrmkZpSVFqSdxsDgCpnhFtCV9pSlipn9Mfm4Cc3gJrCRNpCcOuCwJoS8Rtj1KbjRBfP9SbSkLrmZzbCVFp6lHrCBIbDtTtOYLeDdMt7hE&msgID=I7666161268_1&markAsRead=" style="text-decoration:none; font-size: 13px;font-family: Helvetica,Arial,sans-serif;font-weight: bold;color: white;white-space: nowrap;display: block;" target="_blank"><span style="font-size: 13px;font-family: Helvetica,Arial,sans-serif;font-weight: bold;color: white;white-space: nowrap;display: block;">Confirm you know Subhash</span></a></td> <td width="13"> <table width="13px" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:0px;font-size:0px;line-height:0px"> </div></td> </tr> </tbody> </table></td> </tr> </tbody> </table></td> </tr> </tbody> </table></td> </tr> </tbody> </table></td> </tr> </tbody> </table> <table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:20px;font-size:20px;line-height:20px"> </div></td> </tr> </tbody> </table></td> <td width="20" class="res-width10"> <table width="20px" border="0" cellspacing="0" cellpadding="1" class="email-spacer res-width10"> <tbody> <tr> <td> <div style="height:0px;font-size:0px;line-height:0px"> </div></td> </tr> </tbody> </table></td> </tr> </tbody> </table></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="600" class="responsive"> <tbody> <tr> <td align="left"> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%" class="responsive"> <tbody> <tr> <td> <table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:10px;font-size:10px;line-height:10px"> </div></td> </tr> </tbody> </table></td> </tr> <tr> <td align="left"> <table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; font-size:11px; font-family:Helvetica,Arial,sans-serif; color:#999999;" width="100%" class="responsive res-font10"> <tbody> <tr> <td>You are receiving Reminder emails for pending invitations. <a style="text-decoration:none;color:#0077B5;" href="http://www.linkedin.com/blink?simpleRedirect=6RLoQkO9n9BpStLr68Md2kMsClMrSNBtClAhj8BcmZOpnFEoDlPfmNFomRB9z0Sc30OfmhF9z5ve3oOcjoNdzoSdQAZp6BD9zANnT1UplZSrCAZqSkCoDlPrDkJpyRDtCVFnSRJrScJr6RBfmtKqmJzon9Q9CZLpPRQ9z0QbmVJsmpzcDFEbmdydnkMryQZpjYOtyZBbSRLoOVKqmhBqSVFr2VTtTsLbPFMt7hE&msgID=I7666161268_1&markAsRead=">Unsubscribe</a></td> </tr> <tr> <td></td> </tr> <tr> <td> <table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:10px;font-size:10px;line-height:10px"> </div></td> </tr> </tbody> </table></td> </tr> <tr> <td>© 2014, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043, USA</td> </tr> </tbody> </table></td> </tr> <tr> <td> <table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"> <tbody> <tr> <td> <div style="height:20px;font-size:20px;line-height:20px"> </div></td> </tr> </tbody> </table></td> </tr> </tbody> </table></td> </tr> </tbody> </table></td> </tr> </tbody> </table></td> </tr> </tbody> </table> <img src="http://www.linkedin.com/emimp/-n0u5bc-hz2cfqmn-40.gif" style="width:1px; height:1px;" /> Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-36368969000284337092014-08-13T22:05:00.001+05:302014-08-13T22:05:11.300+05:30I'd like to add you to my professional network on LinkedIn<span class="preheader" style="display: none !important; font-size: 1px;"></span><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%" bgcolor="#DFDFDF"><tbody><tr><td colspan="3"><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="1"><tbody><tr><td><div style="height:5px;font-size:5px;line-height:5px;"> </div></td></tr></tbody></table></td></tr><tr><td align="center" width="100%"><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; min-width:290px;" width="550" class="responsive"><tbody><tr><td style="font-family:Helvetica,Arial,sans-serif;"><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:8px;font-size:8px;line-height:8px"> </div></td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif;" width="100%" bgcolor="#DDDDDD"><tbody><tr><td align="left" valign="middle" width="95" height="21" id="base-header-logo"><a style="text-decoration:none;cursor:pointer;border:none;display:block;height:21px;width:100%;" href='http://www.linkedin.com/blink?simpleRedirect=1QsSlRpRZBt6BSrCAZqSkCrStLr2RBt6BSrCAJt7dBtmsJr6RBfmtKqmJzon9Q9D1JrzRQ9z0TbmIRumZSsTBEbmdydnkMryQZpjYOtyZBbSRLoOVKqmhBqSVFr2VTtTsLbPFMt7hE&msgID=I7666161268_1&markAsRead='><img src='http://s.c.lnkd.licdn.com/scds/common/u/images/email/logos/logo_linkedin_tm_email_95x21_v1.png' width="95" height="21" alt="LinkedIn" style="border:none;text-decoration:none;"/></a></td></tr></tbody></table><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:8px;font-size:8px;line-height:8px"> </div></td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif;" width="100%" bgcolor="#333333"><tbody><tr><td width="20" class="responsive-spacer"><table width="20" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:0px;font-size:0px;line-height:0px"> </div></td></tr></tbody></table></td><td width="100%"><span style="color:#FFF;"><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:18px;font-size:18px;line-height:18px"> </div></td></tr></tbody></table>Subhash kewat would like to stay in touch on LinkedIn.<table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:18px;font-size:18px;line-height:18px"> </div></td></tr></tbody></table></span></td><td width="20"><table width="20" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:0px;font-size:0px;line-height:0px"> </div></td></tr></tbody></table></td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%" bgcolor="#FFFFFF"><tbody><tr><td width="20" class="res-width10"><table width="20px" border="0" cellspacing="0" cellpadding="1" class="email-spacer res-width10"><tbody><tr><td><div style="height:0px;font-size:0px;line-height:0px"> </div></td></tr></tbody></table></td><td style="color: #333333; font-family: Helvetica,Arial,sans-serif; font-size: 15px; line-height: 18px;" align="left"><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer res-height10"><tbody><tr><td><div style="height:20px;font-size:20px;line-height:20px"> </div></td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%"><tbody><tr><td><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%"><tbody><tr><td style="font-family:Helvetica,Arial,sans-serif;color:#333333;font-size:15px;">Hi SubhBlog,</td></tr><tr><td><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:15px;font-size:15px;line-height:15px"> </div></td></tr></tbody></table></td></tr><tr><td style="font-family:Helvetica,Arial,sans-serif;color:#333333;font-size:15px;">I'd like to add you to my professional network on LinkedIn.</td></tr><tr><td><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:15px;font-size:15px;line-height:15px"> </div></td></tr></tbody></table></td></tr><tr><td>- Subhash</td></tr><tr><td><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:20px;font-size:20px;line-height:20px"> </div></td></tr></tbody></table></td></tr><tr><td><table border="0" cellpadding="0" cellspacing="0" align="left"><tbody><tr><td align="center" height="30" valign="middle" bgcolor="#287BBC" background="http://s.c.lnkd.licdn.com/scds/common/u/img/email/bg_btn_katy_blue_medium.png" style="background:url(http://s.c.lnkd.licdn.com/scds/common/u/img/email/bg_btn_katy_blue_medium.png) repeat-x scroll bottom #287BBC;background-color:#287BBC;border:1px solid #1B5480;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px; cursor: pointer;"><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%" bgcolor="transparent"><tbody><tr><td width="13"><table width="13px" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:0px;font-size:0px;line-height:0px"> </div></td></tr></tbody></table></td><td><a href="http://www.linkedin.com/blink?simpleRedirect=3sNdzsUe3sOdzcPdj0ScPkMejkZh4BKrSBQonhFtCVF9CBQhDx8hnhyfnBBiShBsC5EsOpQsSlRpRZBt6BSrCAZqSkConhzbmlQqnpKqiRQsSlRpORIrmkZpSVFqSdxsDgCpnhFtCV9pSlipn9Mfm4Cc3sJqPlVrTpPumwJoS8Rtj1KbjRBfP9SbSkLrmZzbCVFp6lHrCBIbDtTtOYLeDdMt7hE&msgID=I7666161268_1&markAsRead=" style="text-decoration:none; font-size: 13px;font-family: Helvetica,Arial,sans-serif;font-weight: bold;color: white;white-space: nowrap;display: block;" target="_blank"><span style="font-size: 13px;font-family: Helvetica,Arial,sans-serif;font-weight: bold;color: white;white-space: nowrap;display: block;">Confirm that you know Subhash</span></a></td><td width="13"><table width="13px" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:0px;font-size:0px;line-height:0px"> </div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%"><tbody><tr><td style="border-bottom:1px solid #e5e5e5;"><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:20px;font-size:20px;line-height:20px"> </div></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:20px;font-size:20px;line-height:20px"> </div></td></tr></tbody></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%"><tbody><tr><td width="120" valign="top" style="vertical-align: top;"><img alt="Subhash kewat" src="http://m.c.lnkd.licdn.com/mpr/mpr/shrink_60_60/p/7/000/1b8/117/1a12993.jpg" width="60" height="60" border="0" class="res-img120" style="border:none;outline:hidden;"/></td><td width="20"><table width="20" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:0px;font-size:0px;line-height:0px"> </div></td></tr></tbody></table></td><td style="vertical-align: top; font-family: Helvetica,Arial,sans-serif;" width="100%"><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%"><tbody><tr><td style="font-size: 20px; font-weight: bold; color:#333333;" valign="top">Subhash kewat</td></tr><tr><td style="color:#333333;font-size:15px;" class="res-font16">Senior Software Developer at UST Global</td></tr><tr><td style="color:#B3B3B3;font-size:13px;" class="res-font16">Bengaluru Area, India</td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:20px;font-size:20px;line-height:20px"> </div></td></tr></tbody></table></td></tr></tbody></table></td><td width="20" class="res-width10"><table width="20px" border="0" cellspacing="0" cellpadding="1" class="email-spacer res-width10"><tbody><tr><td><div style="height:0px;font-size:0px;line-height:0px"> </div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="550" class="responsive"><tbody><tr><td align="left"><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; " width="100%" class="responsive"><tbody><tr><td><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:10px;font-size:10px;line-height:10px"> </div></td></tr></tbody></table></td></tr><tr><td align="left"><table border="0" cellspacing="0" cellpadding="0" style="font-family:Helvetica,Arial,sans-serif; font-size:11px; font-family:Helvetica,Arial,sans-serif; color:#999999;" width="100%" class="responsive res-font10"><tbody><tr><td>You are receiving Invitation to Connect emails. <a style="text-decoration:none;color:#0077B5;" href="http://www.linkedin.com/blink?simpleRedirect=rmZzhj8BsClDpSZIoz0Q9j1Opn1Lr6lSpmh5cykNrT9BuCxytncZr6BxrmkCp71BpjAMcP1FtC4Sc6VJfmhFoioNdz0MczRAqioNbjRAqmQCc3sJqPlVrTpPumwJoS8Rtj1KbjRAqmkCt7dBtmtvpnhFtCVFfmJB9Clyqn9zsS9RsSVRbmlQqnpKqiRQsSlRpORIrmkZpSVFqSdxsDgCkjoPp4l7q5p6sCR6kk4ZrClHrRhAqmQCsSVRfngCc3sJqPlVrTpPumwJoS8Rtj1KbjRBfP9SbSkLrmZzbCVFp6lHrCBIbDtTtOYLeDdMt7hE&msgID=I7666161268_1&markAsRead=">Unsubscribe</a></td></tr><tr><td>This email was intended for SubhBlog Dev. <a style="text-decoration:none;color:#0077B5;" href="http://www.linkedin.com/blink?simpleRedirect=e3wTd3RAimlIoSBQsC4Ct7dBtmtvpnhFtCVFfmJB9CNOlmlzqnpOpldOpmRLt7dRoPRx9z0TbmIRumZSsTBEbmdydnkMryQZpjYOtyZBbSRLoOVKqmhBqSVFr2VTtTsLbPFMt7hE&msgID=I7666161268_1&markAsRead=">Learn why we included this.</a></td></tr><tr><td><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:10px;font-size:10px;line-height:10px"> </div></td></tr></tbody></table></td></tr><tr><td>© 2014, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043, USA</td></tr></tbody></table></td></tr><tr><td><table width="1" border="0" cellspacing="0" cellpadding="1" class="email-spacer"><tbody><tr><td><div style="height:20px;font-size:20px;line-height:20px"> </div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><img src="http://www.linkedin.com/emimp/-n0u5bc-hysvoy5k-70.gif" style="width:1px; height:1px;"/>Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-31091725920110100752014-08-05T18:45:00.001+05:302014-08-05T18:45:31.646+05:30DOM, SAX and StAX<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<h1 class="entry-title" style="background-color: white; color: #333333; font-size: 28px; font-weight: normal; line-height: 30px; margin: 0px 0px 10px; padding: 0px;">
<strong><span style="font-family: Verdana, sans-serif;">DOM, SAX and StAX</span></strong></h1>
<br />
<div class="entry entry-content" style="background-color: white; margin: 0px; padding: 0px;">
<h2 style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; font-weight: normal; line-height: 28.799999237060547px;">
</h2>
<div style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<b><br /></b></div>
<div style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<b>SAX </b>is a uni-directional, read only API and follows push model for reading. Read below to know about push reading. SAX and StAX are relatives compared to DOM as DOM uses a completely different approach for XML processing.</div>
<div style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<b>DOM </b>parser is created using the concept of trees. XML document object model will be completely constructed as a tree and stored in memory. Then the XML document can be parsed by traversing the tree. This requires lot of memory and processing power. When working with small documents are fine with this kind of DOM processing but when you have a long document and then we will have performance issues.<br />
<b>StAX </b>follows a streaming model, it can both read and write. Imagine feeding a whole XML document via a tube. At every moment one XML element will be the focus and then we move on to the next element either in forward or backward direction of our choice. This is kind of processing is not something new for us, we have seen ResultSet of JDBC API. Streaming has its advantage when we want to process large documents sequentially. Irrespective of size of the document the performance will be good. When mobile phones and apps are getting popular we also need to think of processing in terms of smaller scale compared to desktops and servers.</div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, 'Times New Roman', serif;">The sample XML considered in the examples is:</span></div>
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><employee id="111"><br /></employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <firstname>Rakesh</firstname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <lastname>Mishra</lastname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <location>Bangalore</location></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span></span></div>
</div>
<br />
<span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><employee id="112"><br /></employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <firstname>John</firstname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <lastname>Davis</lastname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <location>Delhi</location></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span><br />
<span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><employee id="113"><br /></employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <firstname>Rajesh</firstname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <lastname>Sharma</lastname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <location>Pune</location></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span><br />
<span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span><br />
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;">And the obejct into</span><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;"> </span><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;">which the XML content is to be extracted is defined as below:</span></span></div>
<h2 style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee{</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public String toString() {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName+" "+lastName+"("+id+")"+location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span></span></span><table style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-collapse: collapse !important; border-spacing: 0px; border: 0px !important; bottom: auto !important; float: none !important; font-family: Arial, serif; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background: none !important; border: 0px !important; bottom: auto !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border: 0px !important; bottom: auto !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background: none !important; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;"><br /></code></td><td class="content" style="background: none !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><br /></td></tr>
</tbody></table>
<span style="font-family: Georgia, Times New Roman, serif;">There are 3 main parsers for which I have given sample code:</span></h2>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">DOM Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">SAX Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">StAX Parser</span></li>
</ul>
<h3 style="color: #0a0a0a; font-size: 16px; line-height: 22.81999969482422px; margin: 10px 0px 20px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="https://www.blogger.com/null" name="dom" style="color: #326693;"></a>Using DOM Parser</span></h3>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">DOM parser implementation that comes with the JDK using JDK 7. The DOM Parser loads the complete XML content into a Tree structure. And we iterate through the Node and NodeList to get the content of the XML. The code for XML parsing using DOM parser is given below.</span></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public class DOMParserDemo {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public static void main(String[] args) throws Exception {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Get the DOM Builder Factory</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> DocumentBuilderFactory factory =</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> DocumentBuilderFactory.newInstance();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Get the DOM Builder</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> DocumentBuilder builder = factory.newDocumentBuilder();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Load and Parse the XML document</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //document contains the complete XML as a Tree.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Document document =</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> builder.parse(</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> ClassLoader.getSystemResourceAsStream("xml/employee.xml"));</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> List<employee> empList = new ArrayList<>();</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Iterating through the nodes and extracting the data.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> NodeList nodeList = document.getDocumentElement().getChildNodes();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for (int i = 0; i < nodeList.getLength(); i++) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //We have encountered an <employee> tag.</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Node node = nodeList.item(i);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if (node instanceof Element) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Employee emp = new Employee();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.id = node.getAttributes().</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> getNamedItem("id").getNodeValue();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> NodeList childNodes = node.getChildNodes();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for (int j = 0; j < childNodes.getLength(); j++) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Node cNode = childNodes.item(j);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Identifying the child tag of employee encountered.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if (cNode instanceof Element) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String content = cNode.getLastChild().</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> getTextContent().trim();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch (cNode.getNodeName()) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "firstName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.firstName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "lastName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.lastName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "location":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.location = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList.add(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Printing the Employee list populated.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for (Employee emp : empList) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> System.out.println(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee{</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> @Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> public String toString() {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName+" "+lastName+"("+id+")"+location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span></span></span></h2>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<b><span style="font-family: Georgia, Times New Roman, serif;">The output:</span></b></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rakesh Mishra(111)Bangalore</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><br /></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">John Davis(112) </span></span></span></span><span style="color: #333333; font-size: 14px; font-weight: normal; line-height: 22.81999969482422px;"><span style="font-family: Georgia, Times New Roman, serif;">Delhi</span></span><span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><br /></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rajesh Sharma(113)Pune</span></span></span></span></h2>
<div style="text-align: left;">
<span style="color: #0a0a0a; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22.81999969482422px;"><b>Using SAX Parser</b></span></div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">SAX Parser is different from the DOM Parser where SAX parser doesn’t load the complete XML into the memory, instead it parses the XML line by line triggering different events as and when it encounters different elements like: opening tag, closing tag, character data, comments and so on. This is the reason why SAX Parser is called an event based parser.</span></div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">Along with the XML source file, we also register a handler which extends the DefaultHandler class. The DefaultHandler class provides different callbacks out of which we would be interested in:</span></div>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;"><b>startElement()</b> – triggers this event when the start of the tag is encountered.</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;"><b>endElement()</b> – triggers this event when the end of the tag is encountered.</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;"><b>characters()</b> – triggers this event when it encounters some text data.</span></li>
</ul>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">The code for parsing the XML using SAX Parser is given below:</span></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.ArrayList;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.List;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.parsers.SAXParser;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.parsers.SAXParserFactory;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import org.xml.sax.Attributes;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import org.xml.sax.SAXException;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import org.xml.sax.helpers.DefaultHandler;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public class SAXParserDemo {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public static void main(String[] args) throws Exception {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> SAXParserFactory parserFactor = SAXParserFactory.newInstance();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> SAXParser parser = parserFactor.newSAXParser();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> SAXHandler handler = new SAXHandler();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> parser.parse(ClassLoader.getSystemResourceAsStream("xml/employee.xml"),</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> handler);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Printing the list of employees obtained from XML</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for ( Employee emp : handler.empList){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> System.out.println(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">/**</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> * The Handler for SAX Events.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> */</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class SAXHandler extends DefaultHandler {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">List<employee> empList = new ArrayList<>();</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Employee emp = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String content = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">//Triggered when the start of tag is found.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public void startElement(String uri, String localName,</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String qName, Attributes attributes)</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> throws SAXException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(qName){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Create a new Employee object when the start tag is found</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "employee":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp = new Employee();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.id = attributes.getValue("id");</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public void endElement(String uri, String localName,</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String qName) throws SAXException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(qName){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Add the employee to list once end tag is found</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "employee":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList.add(emp); </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //For all other end tags the employee has to be updated.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "firstName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.firstName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "lastName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.lastName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "location":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.location = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public void characters(char[] ch, int start, int length)</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> throws SAXException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> content = String.copyValueOf(ch, start, length).trim();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> @Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> public String toString() {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName + " " + lastName + "(" + id + ")" + location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span></span></span></h2>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<b><span style="font-family: Georgia, Times New Roman, serif;">The output:</span></b></div>
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rakesh Mishra(111)Bangalore</span></span></span></span><span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">John Davis(112)</span></span></span></span><span style="color: #333333; font-family: Georgia, 'Times New Roman', serif; font-size: 14px; font-weight: normal; line-height: 22.81999969482422px;">Delhi</span><span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rajesh Sharma(113)Pune</span></span></span></span></div>
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
</div>
<div style="text-align: left;">
<span style="color: #0a0a0a; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22.81999969482422px;"><b>Using StAX Parser</b></span></div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">StAX stands for Streaming API for XML and StAX Parser is different from DOM in the same way SAX Parser is. StAX parser is also in a subtle way different from SAX parser.</span></div>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">The SAX Parser pushes the data but StAX parser pulls the required data from the XML.</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">The StAX parser maintains a cursor at the current position in the document allows to extract the content available at the cursor whereas SAX parser issues events as and when certain data is encountered.</span></li>
</ul>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">XMLInputFactory and XMLStreamReader are the two class which can be used to load an XML file. And as we read through the XML file using XMLStreamReader, events are generated in the form of integer values and these are then compared with the constants inXMLStreamConstants. The below code shows how to parse XML using StAX parser:</span></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.ArrayList;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.List;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLInputFactory;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLStreamConstants;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLStreamException;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLStreamReader;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public class StaxParserDemo {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public static void main(String[] args) throws XMLStreamException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> List<employee> empList = null;</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Employee currEmp = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String tagContent = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> XMLInputFactory factory = XMLInputFactory.newInstance();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> XMLStreamReader reader =</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> factory.createXMLStreamReader(</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> ClassLoader.getSystemResourceAsStream("xml/employee.xml"));</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> while(reader.hasNext()){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> int event = reader.next();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(event){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.START_ELEMENT:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if ("employee".equals(reader.getLocalName())){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp = new Employee();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.id = reader.getAttributeValue(0);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if("employees".equals(reader.getLocalName())){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList = new ArrayList<>();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.CHARACTERS:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> tagContent = reader.getText().trim();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.END_ELEMENT:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(reader.getLocalName()){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "employee":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList.add(currEmp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "firstName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.firstName = tagContent;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "lastName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.lastName = tagContent;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "location":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.location = tagContent;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.START_DOCUMENT:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList = new ArrayList<>();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Print the employee list populated from XML</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for ( Employee emp : empList){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> System.out.println(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee{</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public String toString(){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName+" "+lastName+"("+id+") "+location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span></span></span></h2>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<b><span style="font-family: Georgia, Times New Roman, serif;">The output:</span></b></div>
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rakesh Mishra(111) Bangalore</span></span></span></span><span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">John Davis(112) </span></span></span></span><span style="color: #333333; font-family: Georgia, 'Times New Roman', serif; font-size: 14px; font-weight: normal; line-height: 22.81999969482422px;">Delhi</span><span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rajesh Sharma(113) Pune</span></span></span></span></div>
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
</div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;">With this I have covered parsing the same XML document and performing the same task of populating the list of </span><code style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); color: #333333; font-size: 13px; line-height: 1.3; margin: 0px; max-width: 100%; padding: 0px 5px; vertical-align: middle;">Employee</code><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;"> objects using all the three parsers namely:</span></span></div>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">DOM Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">SAX Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">StAX Parser</span></li>
</ul>
<div style="color: #333333; font-family: Arial, serif; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<br /></div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-46106817290782238762014-08-05T18:39:00.003+05:302014-08-05T18:39:32.113+05:30DOM, SAX and StAX Parser<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<h1 class="entry-title" style="background-color: white; color: #333333; font-size: 28px; font-weight: normal; line-height: 30px; margin: 0px 0px 10px; padding: 0px;">
<strong><span style="font-family: Verdana, sans-serif;">DOM, SAX and StAX Parser</span></strong></h1>
<br /><div class="entry entry-content" style="background-color: white; margin: 0px; padding: 0px;">
<h2 style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; font-weight: normal; line-height: 28.799999237060547px;">
<br /></h2>
<div style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<b><br /></b></div>
<div style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<b>SAX </b>is a uni-directional, read only API and follows push model for reading. Read below to know about push reading. SAX and StAX are relatives compared to DOM as DOM uses a completely different approach for XML processing.</div>
<div style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<b>DOM </b>parser is created using the concept of trees. XML document object model will be completely constructed as a tree and stored in memory. Then the XML document can be parsed by traversing the tree. This requires lot of memory and processing power. When working with small documents are fine with this kind of DOM processing but when you have a long document and then we will have performance issues.</div>
<div class="ads" style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px; margin: 20px 0px;">
<div class="adLabel" style="color: #777777; font-size: 0.9em;">
<span style="color: black; font-size: small;"><b>StAX </b>follows a streaming model, it can both read and write. Imagine feeding a whole XML document via a tube. At every moment one XML element will be the focus and then we move on to the next element either in forward or backward direction of our choice. This is kind of processing is not something new for us, we have seen ResultSet of JDBC API. Streaming has its advantage when we want to process large documents sequentially. Irrespective of size of the document the performance will be good. When mobile phones and apps are getting popular we also need to think of processing in terms of smaller scale compared to desktops and servers.</span></div>
</div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, 'Times New Roman', serif;">The sample XML considered in the examples is:</span></div>
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><employee id="111"><br /></employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <firstname>Rakesh</firstname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <lastname>Mishra</lastname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <location>Bangalore</location></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span></span></div>
</div>
</div>
<br /><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><employee id="112"><br /></employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <firstname>John</firstname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <lastname>Davis</lastname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <location>Chennai</location></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span><br /><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><employee id="113"><br /></employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <firstname>Rajesh</firstname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <lastname>Sharma</lastname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <location>Pune</location></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span><br /><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span><div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;">And the obejct into</span><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;"> </span><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;">which the XML content is to be extracted is defined as below:</span></span></div>
<h2 style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee{</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public String toString() {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName+" "+lastName+"("+id+")"+location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span></span><br /></span><table style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-collapse: collapse !important; border-spacing: 0px; border: 0px !important; bottom: auto !important; float: none !important; font-family: Arial, serif; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background: none !important; border: 0px !important; bottom: auto !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border: 0px !important; bottom: auto !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background: none !important; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;"><br /></code></td><td class="content" style="background: none !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><br /></td></tr>
</tbody></table>
<span style="font-family: Georgia, Times New Roman, serif;">There are 3 main parsers for which I have given sample code:</span></h2>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">DOM Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">SAX Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">StAX Parser</span></li>
</ul>
<h3 style="color: #0a0a0a; font-size: 16px; line-height: 22.81999969482422px; margin: 10px 0px 20px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="https://www.blogger.com/null" name="dom" style="color: #326693;"></a>Using DOM Parser</span></h3>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">DOM parser implementation that comes with the JDK using JDK 7. The DOM Parser loads the complete XML content into a Tree structure. And we iterate through the Node and NodeList to get the content of the XML. The code for XML parsing using DOM parser is given below.</span></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public class DOMParserDemo {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public static void main(String[] args) throws Exception {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Get the DOM Builder Factory</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> DocumentBuilderFactory factory =</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> DocumentBuilderFactory.newInstance();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Get the DOM Builder</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> DocumentBuilder builder = factory.newDocumentBuilder();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Load and Parse the XML document</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //document contains the complete XML as a Tree.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Document document =</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> builder.parse(</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> ClassLoader.getSystemResourceAsStream("xml/employee.xml"));</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> List<employee> empList = new ArrayList<>();</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Iterating through the nodes and extracting the data.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> NodeList nodeList = document.getDocumentElement().getChildNodes();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for (int i = 0; i < nodeList.getLength(); i++) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //We have encountered an <employee> tag.</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Node node = nodeList.item(i);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if (node instanceof Element) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Employee emp = new Employee();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.id = node.getAttributes().</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> getNamedItem("id").getNodeValue();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> NodeList childNodes = node.getChildNodes();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for (int j = 0; j < childNodes.getLength(); j++) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Node cNode = childNodes.item(j);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Identifying the child tag of employee encountered.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if (cNode instanceof Element) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String content = cNode.getLastChild().</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> getTextContent().trim();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch (cNode.getNodeName()) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "firstName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.firstName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "lastName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.lastName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "location":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.location = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList.add(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Printing the Employee list populated.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for (Employee emp : empList) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> System.out.println(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee{</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> @Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> public String toString() {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName+" "+lastName+"("+id+")"+location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span></span></span></h2>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<b><span style="font-family: Georgia, Times New Roman, serif;">The output:</span></b></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rakesh Mishra(111)Bangalore</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><br /></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">John Davis(112)Chennai</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><br /></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rajesh Sharma(113)Pune</span></span></span></span></h2>
<div style="text-align: left;">
<span style="color: #0a0a0a; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22.81999969482422px;"><b>Using SAX Parser</b></span></div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">SAX Parser is different from the DOM Parser where SAX parser doesn’t load the complete XML into the memory, instead it parses the XML line by line triggering different events as and when it encounters different elements like: opening tag, closing tag, character data, comments and so on. This is the reason why SAX Parser is called an event based parser.</span></div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">Along with the XML source file, we also register a handler which extends the DefaultHandler class. The DefaultHandler class provides different callbacks out of which we would be interested in:</span></div>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;"><b>startElement()</b> – triggers this event when the start of the tag is encountered.</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;"><b>endElement()</b> – triggers this event when the end of the tag is encountered.</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;"><b>characters()</b> – triggers this event when it encounters some text data.</span></li>
</ul>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">The code for parsing the XML using SAX Parser is given below:</span></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.ArrayList;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.List;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.parsers.SAXParser;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.parsers.SAXParserFactory;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import org.xml.sax.Attributes;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import org.xml.sax.SAXException;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import org.xml.sax.helpers.DefaultHandler;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public class SAXParserDemo {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public static void main(String[] args) throws Exception {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> SAXParserFactory parserFactor = SAXParserFactory.newInstance();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> SAXParser parser = parserFactor.newSAXParser();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> SAXHandler handler = new SAXHandler();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> parser.parse(ClassLoader.getSystemResourceAsStream("xml/employee.xml"),</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> handler);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Printing the list of employees obtained from XML</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for ( Employee emp : handler.empList){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> System.out.println(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">/**</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> * The Handler for SAX Events.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> */</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class SAXHandler extends DefaultHandler {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">List<employee> empList = new ArrayList<>();</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Employee emp = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String content = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">//Triggered when the start of tag is found.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public void startElement(String uri, String localName,</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String qName, Attributes attributes)</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> throws SAXException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(qName){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Create a new Employee object when the start tag is found</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "employee":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp = new Employee();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.id = attributes.getValue("id");</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public void endElement(String uri, String localName,</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String qName) throws SAXException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(qName){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Add the employee to list once end tag is found</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "employee":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList.add(emp); </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //For all other end tags the employee has to be updated.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "firstName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.firstName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "lastName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.lastName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "location":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.location = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public void characters(char[] ch, int start, int length)</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> throws SAXException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> content = String.copyValueOf(ch, start, length).trim();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> @Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> public String toString() {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName + " " + lastName + "(" + id + ")" + location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span></span></span></h2>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<b><span style="font-family: Georgia, Times New Roman, serif;">The output:</span></b></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rakesh Mishra(111)Bangalore</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">John Davis(112)Chennai</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rajesh Sharma(113)Pune</span></span></span></span></h2>
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
</div>
<div style="text-align: left;">
<span style="color: #0a0a0a; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22.81999969482422px;"><b>Using StAX Parser</b></span></div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">StAX stands for Streaming API for XML and StAX Parser is different from DOM in the same way SAX Parser is. StAX parser is also in a subtle way different from SAX parser.</span></div>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">The SAX Parser pushes the data but StAX parser pulls the required data from the XML.</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">The StAX parser maintains a cursor at the current position in the document allows to extract the content available at the cursor whereas SAX parser issues events as and when certain data is encountered.</span></li>
</ul>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">XMLInputFactory and XMLStreamReader are the two class which can be used to load an XML file. And as we read through the XML file using XMLStreamReader, events are generated in the form of integer values and these are then compared with the constants inXMLStreamConstants. The below code shows how to parse XML using StAX parser:</span></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.ArrayList;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.List;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLInputFactory;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLStreamConstants;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLStreamException;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLStreamReader;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public class StaxParserDemo {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public static void main(String[] args) throws XMLStreamException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> List<employee> empList = null;</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Employee currEmp = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String tagContent = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> XMLInputFactory factory = XMLInputFactory.newInstance();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> XMLStreamReader reader =</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> factory.createXMLStreamReader(</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> ClassLoader.getSystemResourceAsStream("xml/employee.xml"));</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> while(reader.hasNext()){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> int event = reader.next();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(event){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.START_ELEMENT:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if ("employee".equals(reader.getLocalName())){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp = new Employee();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.id = reader.getAttributeValue(0);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if("employees".equals(reader.getLocalName())){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList = new ArrayList<>();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.CHARACTERS:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> tagContent = reader.getText().trim();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.END_ELEMENT:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(reader.getLocalName()){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "employee":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList.add(currEmp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "firstName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.firstName = tagContent;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "lastName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.lastName = tagContent;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "location":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.location = tagContent;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.START_DOCUMENT:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList = new ArrayList<>();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Print the employee list populated from XML</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for ( Employee emp : empList){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> System.out.println(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee{</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public String toString(){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName+" "+lastName+"("+id+") "+location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span></span></span></h2>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<b><span style="font-family: Georgia, Times New Roman, serif;">The output:</span></b></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rakesh Mishra(111) Bangalore</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">John Davis(112) Chennai</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rajesh Sharma(113) Pune</span></span></span></span></h2>
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
</div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;">With this I have covered parsing the same XML document and performing the same task of populating the list of </span><code style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); color: #333333; font-size: 13px; line-height: 1.3; margin: 0px; max-width: 100%; padding: 0px 5px; vertical-align: middle;">Employee</code><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;"> objects using all the three parsers namely:</span></span></div>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">DOM Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">SAX Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">StAX Parser</span></li>
</ul>
<div style="color: #333333; font-family: Arial, serif; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<br /></div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-78673880157308083922014-08-05T18:39:00.001+05:302014-08-05T18:39:27.183+05:30DOM, SAX and StAX Parser<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<h1 class="entry-title" style="background-color: white; color: #333333; font-size: 28px; font-weight: normal; line-height: 30px; margin: 0px 0px 10px; padding: 0px;">
<strong><span style="font-family: Verdana, sans-serif;">DOM, SAX and StAX Parser</span></strong></h1>
<br /><div class="entry entry-content" style="background-color: white; margin: 0px; padding: 0px;">
<h2 style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; font-weight: normal; line-height: 28.799999237060547px;">
<br /></h2>
<div style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<b><br /></b></div>
<div style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<b>SAX </b>is a uni-directional, read only API and follows push model for reading. Read below to know about push reading. SAX and StAX are relatives compared to DOM as DOM uses a completely different approach for XML processing.</div>
<div style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<b>DOM </b>parser is created using the concept of trees. XML document object model will be completely constructed as a tree and stored in memory. Then the XML document can be parsed by traversing the tree. This requires lot of memory and processing power. When working with small documents are fine with this kind of DOM processing but when you have a long document and then we will have performance issues.</div>
<div class="ads" style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px; margin: 20px 0px;">
<div class="adLabel" style="color: #777777; font-size: 0.9em;">
<span style="color: black; font-size: small;"><b>StAX </b>follows a streaming model, it can both read and write. Imagine feeding a whole XML document via a tube. At every moment one XML element will be the focus and then we move on to the next element either in forward or backward direction of our choice. This is kind of processing is not something new for us, we have seen ResultSet of JDBC API. Streaming has its advantage when we want to process large documents sequentially. Irrespective of size of the document the performance will be good. When mobile phones and apps are getting popular we also need to think of processing in terms of smaller scale compared to desktops and servers.</span></div>
</div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, 'Times New Roman', serif;">The sample XML considered in the examples is:</span></div>
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><employee id="111"><br /></employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <firstname>Rakesh</firstname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <lastname>Mishra</lastname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <location>Bangalore</location></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span></span></div>
</div>
</div>
<br /><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><employee id="112"><br /></employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <firstname>John</firstname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <lastname>Davis</lastname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <location>Chennai</location></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span><br /><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><employee id="113"><br /></employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <firstname>Rajesh</firstname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <lastname>Sharma</lastname></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> <location>Pune</location></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span><br /><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"></span></span><div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;">And the obejct into</span><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;"> </span><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;">which the XML content is to be extracted is defined as below:</span></span></div>
<h2 style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee{</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public String toString() {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName+" "+lastName+"("+id+")"+location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span></span><br /></span><table style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-collapse: collapse !important; border-spacing: 0px; border: 0px !important; bottom: auto !important; float: none !important; font-family: Arial, serif; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background: none !important; border: 0px !important; bottom: auto !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border: 0px !important; bottom: auto !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background: none !important; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;"><br /></code></td><td class="content" style="background: none !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><br /></td></tr>
</tbody></table>
<span style="font-family: Georgia, Times New Roman, serif;">There are 3 main parsers for which I have given sample code:</span></h2>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">DOM Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">SAX Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">StAX Parser</span></li>
</ul>
<h3 style="color: #0a0a0a; font-size: 16px; line-height: 22.81999969482422px; margin: 10px 0px 20px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="https://www.blogger.com/null" name="dom" style="color: #326693;"></a>Using DOM Parser</span></h3>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">DOM parser implementation that comes with the JDK using JDK 7. The DOM Parser loads the complete XML content into a Tree structure. And we iterate through the Node and NodeList to get the content of the XML. The code for XML parsing using DOM parser is given below.</span></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public class DOMParserDemo {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public static void main(String[] args) throws Exception {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Get the DOM Builder Factory</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> DocumentBuilderFactory factory =</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> DocumentBuilderFactory.newInstance();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Get the DOM Builder</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> DocumentBuilder builder = factory.newDocumentBuilder();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Load and Parse the XML document</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //document contains the complete XML as a Tree.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Document document =</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> builder.parse(</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> ClassLoader.getSystemResourceAsStream("xml/employee.xml"));</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> List<employee> empList = new ArrayList<>();</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Iterating through the nodes and extracting the data.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> NodeList nodeList = document.getDocumentElement().getChildNodes();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for (int i = 0; i < nodeList.getLength(); i++) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //We have encountered an <employee> tag.</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Node node = nodeList.item(i);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if (node instanceof Element) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Employee emp = new Employee();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.id = node.getAttributes().</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> getNamedItem("id").getNodeValue();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> NodeList childNodes = node.getChildNodes();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for (int j = 0; j < childNodes.getLength(); j++) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Node cNode = childNodes.item(j);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Identifying the child tag of employee encountered.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if (cNode instanceof Element) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String content = cNode.getLastChild().</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> getTextContent().trim();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch (cNode.getNodeName()) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "firstName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.firstName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "lastName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.lastName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "location":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.location = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList.add(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Printing the Employee list populated.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for (Employee emp : empList) {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> System.out.println(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee{</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> @Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> public String toString() {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName+" "+lastName+"("+id+")"+location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span></span></span></h2>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<b><span style="font-family: Georgia, Times New Roman, serif;">The output:</span></b></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rakesh Mishra(111)Bangalore</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><br /></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">John Davis(112)Chennai</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"><br /></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rajesh Sharma(113)Pune</span></span></span></span></h2>
<div style="text-align: left;">
<span style="color: #0a0a0a; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22.81999969482422px;"><b>Using SAX Parser</b></span></div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">SAX Parser is different from the DOM Parser where SAX parser doesn’t load the complete XML into the memory, instead it parses the XML line by line triggering different events as and when it encounters different elements like: opening tag, closing tag, character data, comments and so on. This is the reason why SAX Parser is called an event based parser.</span></div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">Along with the XML source file, we also register a handler which extends the DefaultHandler class. The DefaultHandler class provides different callbacks out of which we would be interested in:</span></div>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;"><b>startElement()</b> – triggers this event when the start of the tag is encountered.</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;"><b>endElement()</b> – triggers this event when the end of the tag is encountered.</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;"><b>characters()</b> – triggers this event when it encounters some text data.</span></li>
</ul>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">The code for parsing the XML using SAX Parser is given below:</span></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.ArrayList;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.List;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.parsers.SAXParser;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.parsers.SAXParserFactory;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import org.xml.sax.Attributes;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import org.xml.sax.SAXException;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import org.xml.sax.helpers.DefaultHandler;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public class SAXParserDemo {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public static void main(String[] args) throws Exception {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> SAXParserFactory parserFactor = SAXParserFactory.newInstance();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> SAXParser parser = parserFactor.newSAXParser();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> SAXHandler handler = new SAXHandler();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> parser.parse(ClassLoader.getSystemResourceAsStream("xml/employee.xml"),</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> handler);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Printing the list of employees obtained from XML</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for ( Employee emp : handler.empList){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> System.out.println(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">/**</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> * The Handler for SAX Events.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> */</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class SAXHandler extends DefaultHandler {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">List<employee> empList = new ArrayList<>();</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Employee emp = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String content = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">//Triggered when the start of tag is found.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public void startElement(String uri, String localName,</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String qName, Attributes attributes)</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> throws SAXException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(qName){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Create a new Employee object when the start tag is found</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "employee":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp = new Employee();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.id = attributes.getValue("id");</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public void endElement(String uri, String localName,</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String qName) throws SAXException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(qName){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Add the employee to list once end tag is found</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "employee":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList.add(emp); </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //For all other end tags the employee has to be updated.</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "firstName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.firstName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "lastName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.lastName = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "location":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> emp.location = content;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public void characters(char[] ch, int start, int length)</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> throws SAXException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> content = String.copyValueOf(ch, start, length).trim();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> @Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> public String toString() {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName + " " + lastName + "(" + id + ")" + location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span></span></span></h2>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<b><span style="font-family: Georgia, Times New Roman, serif;">The output:</span></b></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rakesh Mishra(111)Bangalore</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">John Davis(112)Chennai</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rajesh Sharma(113)Pune</span></span></span></span></h2>
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
</div>
<div style="text-align: left;">
<span style="color: #0a0a0a; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22.81999969482422px;"><b>Using StAX Parser</b></span></div>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">StAX stands for Streaming API for XML and StAX Parser is different from DOM in the same way SAX Parser is. StAX parser is also in a subtle way different from SAX parser.</span></div>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">The SAX Parser pushes the data but StAX parser pulls the required data from the XML.</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">The StAX parser maintains a cursor at the current position in the document allows to extract the content available at the cursor whereas SAX parser issues events as and when certain data is encountered.</span></li>
</ul>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">XMLInputFactory and XMLStreamReader are the two class which can be used to load an XML file. And as we read through the XML file using XMLStreamReader, events are generated in the form of integer values and these are then compared with the constants inXMLStreamConstants. The below code shows how to parse XML using StAX parser:</span></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<span style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.ArrayList;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import java.util.List;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLInputFactory;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLStreamConstants;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLStreamException;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">import javax.xml.stream.XMLStreamReader;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public class StaxParserDemo {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public static void main(String[] args) throws XMLStreamException {</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> List<employee> empList = null;</employee></span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> Employee currEmp = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> String tagContent = null;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> XMLInputFactory factory = XMLInputFactory.newInstance();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> XMLStreamReader reader =</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> factory.createXMLStreamReader(</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> ClassLoader.getSystemResourceAsStream("xml/employee.xml"));</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> while(reader.hasNext()){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> int event = reader.next();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(event){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.START_ELEMENT:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if ("employee".equals(reader.getLocalName())){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp = new Employee();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.id = reader.getAttributeValue(0);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> if("employees".equals(reader.getLocalName())){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList = new ArrayList<>();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.CHARACTERS:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> tagContent = reader.getText().trim();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.END_ELEMENT:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> switch(reader.getLocalName()){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "employee":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList.add(currEmp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "firstName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.firstName = tagContent;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "lastName":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.lastName = tagContent;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case "location":</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> currEmp.location = tagContent;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> case XMLStreamConstants.START_DOCUMENT:</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> empList = new ArrayList<>();</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> break;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> //Print the employee list populated from XML</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> for ( Employee emp : empList){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> System.out.println(emp);</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> }</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> </span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">class Employee{</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String id;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String firstName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String lastName;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">String location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">@Override</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">public String toString(){</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;"> return firstName+" "+lastName+"("+id+") "+location;</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">}</span></span></span></span></h2>
<div style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<b><span style="font-family: Georgia, Times New Roman, serif;">The output:</span></b></div>
<h2 style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
<span style="font-weight: normal;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rakesh Mishra(111) Bangalore</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">John Davis(112) Chennai</span></span><span style="color: #333333;"><span style="font-size: 14px; line-height: 22.81999969482422px;">Rajesh Sharma(113) Pune</span></span></span></span></h2>
<div style="margin-bottom: 20px; margin-top: 10px; padding: 0px; text-align: left;">
</div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;">With this I have covered parsing the same XML document and performing the same task of populating the list of </span><code style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); color: #333333; font-size: 13px; line-height: 1.3; margin: 0px; max-width: 100%; padding: 0px 5px; vertical-align: middle;">Employee</code><span style="color: #333333; font-size: 14px; line-height: 22.81999969482422px;"> objects using all the three parsers namely:</span></span></div>
<ul style="color: #333333; font-size: 14px; line-height: 22.81999969482422px; list-style: square; margin: 20px 0px 20px 30px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">DOM Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">SAX Parser</span></li>
<li style="margin: 0px; padding: 0px;"><span style="font-family: Georgia, Times New Roman, serif;">StAX Parser</span></li>
</ul>
<div style="color: #333333; font-family: Arial, serif; font-size: 14px; line-height: 22.81999969482422px; margin-bottom: 20px; margin-top: 10px; padding: 0px;">
<br /></div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-73877542142472026672014-08-02T16:11:00.002+05:302016-03-14T19:50:28.978+05:30Java Featurs<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<h3 style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
</h3>
<h3 style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
New features in Java SE 8</h3>
<ul style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<li>Lambda Expressions</li>
<li>Pipelines and Streams</li>
<li>Date and Time API</li>
<li>Default Methods</li>
<li>Type Annotations</li>
<li>Nashhorn JavaScript Engine</li>
<li>Concurrent Accumulators</li>
<li>Parallel operations</li>
<li>PermGen Error Removed</li>
<li>TLS SNI</li>
</ul>
<h3 style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
New features in Java SE 7</h3>
<ul style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<li>Strings in switch Statement</li>
<li>Type Inference for Generic Instance Creation</li>
<li>Multiple Exception Handling</li>
<li>Support for Dynamic Languages</li>
<li>Try with Resources</li>
<li>Java nio Package</li>
<li>Binary Literals, underscore in literals</li>
<li>Diamond Syntax</li>
<li>Automatic null Handling</li>
</ul>
<h3 style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<span style="font-size: small;">New features in Java SE 6</span></h3>
<ul style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<li>Scripting Language Support</li>
<li>JDBC 4.0 API</li>
<li>Java Compiler API</li>
<li>Pluggable Annotations</li>
<li>Native PKI, Java GSS, Kerberos and LDAP support.</li>
<li>Integrated Web Services.</li>
<li>Lot more enhancements.</li>
</ul>
<div>
<span style="font-family: Segoe UI, Optima, Helvetica, Arial, sans-serif;"><span style="line-height: 28.799999237060547px;"><br /></span></span></div>
<div>
<ul>
<li><span style="font-family: Trebuchet MS, sans-serif;">Performance enhancements. Running a Java 5 app on Java 6 even without recompilation will run faster.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">Java Scripting - it's not just BeanShell anymore. The new package javax.scripting allows access to about 20 different languages from within a running JVM - some are Java based and run in-VM, others spawn external scripting processes. But the access is unified so you don't have to know how it works. Just ask for a "Scripting Engine" and feed it your (or, your users'!) scripts.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">XML SOAP-based Web Services (JAX-WS) supported directly in Java SE - just add a few annotations and go! Works with JAXB (Java API for XML Binding) which converts between objects and XML. JAX-WS and JAXB are also supported in Java EE 5.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">JDBC4 (enhancements) and bundled Java Database based on Apache Derby (great for in-JVM testing of database code without deploying a database, similar to HyperSonic or HSQL).</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">Compiler API exposed, for those needing to generate and compile code on the fly.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">Annotations plug-ins (added runtime support for annotation processing).</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">Many Swing GUI Improvements.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">A Console class, with readLine (prompting) and readPassword() - reads in "no echo" mode.</span></li>
</ul>
</div>
<div>
<span style="font-family: Segoe UI, Optima, Helvetica, Arial, sans-serif;"><span style="line-height: 28.799999237060547px;"><br /></span></span></div>
<span style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;"><b>New features in J2SE 5.0</b></span><br />
<ul style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<li>Generics</li>
<li>Enhanced for Loop</li>
<li>Autoboxing/Unboxing</li>
<li>Typesafe Enums</li>
<li>Varargs</li>
<li>Static Import</li>
<li>Metadata (Annotations)</li>
<li>Instrumentation</li>
</ul>
<div>
<span style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;"><b>New features in J2SE 1.4</b></span></div>
<ul style="font-family: 'Segoe UI', Optima, Helvetica, Arial, sans-serif; line-height: 28.799999237060547px;">
<li>XML Processing</li>
<li>Java Print Service</li>
<li>Logging API</li>
<li>Java Web Start</li>
<li>JDBC 3.0 API</li>
<li>Assertions</li>
<li>Preferences API</li>
<li>Chained Exception</li>
<li>IPv6 Support</li>
<li>Regular Expressions</li>
<li>Image I/O API</li>
</ul>
<div>
<span style="font-family: Segoe UI, Optima, Helvetica, Arial, sans-serif;"><span style="line-height: 28.799999237060547px;"><br /></span></span></div>
<div>
<span style="font-family: Segoe UI, Optima, Helvetica, Arial, sans-serif;"><span style="line-height: 28.799999237060547px;"><br /></span></span></div>
<div>
<span style="font-family: Segoe UI, Optima, Helvetica, Arial, sans-serif;"><span style="line-height: 28.799999237060547px;"><br /></span></span></div>
<div>
<span style="font-family: Segoe UI, Optima, Helvetica, Arial, sans-serif;"><span style="line-height: 28.799999237060547px;"><br /></span></span></div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-92148818211990681692014-07-09T20:14:00.001+05:302016-03-14T19:50:28.980+05:30Java 7 Features<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><b>#1 Strings in switch</b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><br /></b></span>
<span style="font-family: Verdana, sans-serif;"><b>#2 try-with-resources statement</b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><br /></b></span>
<span style="font-family: Verdana, sans-serif;"><b>#3 More precise rethrow</b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><br /></b></span>
<span style="font-family: Verdana, sans-serif;"><b>#4 Multi-catch</b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><br /></b></span>
<span style="font-family: Verdana, sans-serif;"><b>#5 Binary integral literals</b></span><br />
<span style="font-family: Verdana, sans-serif;">With Java 7, you can now create numerical literals using binary notation using the prefix “0b”</span><br />
<br />
<span style="font-family: Verdana, sans-serif;">int n = 0b100000;</span><br />
<span style="font-family: Verdana, sans-serif;">System.out.println("n = " + n);</span><br />
<br />
<span style="font-family: Verdana, sans-serif;">Output</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">n = 32</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><b>#6 Underscores in numeric literals</b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><br /></b></span>
<span style="font-family: Verdana, sans-serif;"><b>#7. Improved type inference for generic instance creation</b></span><br />
<span style="font-family: Verdana, sans-serif;"><b>With Java 5 and 6</b></span><br />
<span style="font-family: Verdana, sans-serif;">Map<string list="" tring="">> retVal = new HashMap<string list="" tring="">>();</string></string></span><br />
<br />
<span style="font-family: Verdana, sans-serif;">Note that the full type is specified twice and is therefore redundant. Unfortunately, this was a limitation of Java 5 and 6.</span><br />
<br />
<span style="font-family: Verdana, sans-serif;">With Java 7</span><br />
<span style="font-family: Verdana, sans-serif;">Java 7 tries to get rid of this redundancy by introducing a left to right type inference. You can now rewrite the same statement by using the <> construct.</span><br />
<span style="font-family: Verdana, sans-serif;">Map<string list="" tring="">> retVal = new HashMap<>();</string></span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><b>#8 More new I/O APIs for the Java platform (NIO.2)</b></span><br />
<span style="font-family: Verdana, sans-serif;">a) Package</span><br />
<span style="font-family: Verdana, sans-serif;">The most important package to look for is java.nio.file. </span><br />
<span style="font-family: Verdana, sans-serif;">b) The java.nio.file.Path interface</span><br />
<span style="font-family: Verdana, sans-serif;">Old Way</span><br />
<span style="font-family: Verdana, sans-serif;">File file = new File("hello.txt");</span><br />
<span style="font-family: Verdana, sans-serif;">System.out.println("File exists() == " + file.exists());</span><br />
<br />
<span style="font-family: Verdana, sans-serif;">New Way</span><br />
<span style="font-family: Verdana, sans-serif;">Path path = FileSystems.getDefault().getPath("hello.txt");</span><br />
<span style="font-family: Verdana, sans-serif;">System.out.println("Path exists() == " + Files.exists(path));</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">c) The java.nio.file.Files class</span><br />
<span style="font-family: Verdana, sans-serif;">d) WatchService API</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<br /></div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-46170465236917290242014-05-06T10:02:00.003+05:302016-03-14T19:50:28.971+05:3010 Unknown Features in Java 8 <div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<br />
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">1. Default Methods</strong></div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
A new addition to the Java language, you can now add method bodies to interfaces (called <em style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">default methods</em>). These methods are implicitly added to every class which implements the interface.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
This enables you to add functionality to existing libraries without breaking code. That’s definitely a plus. The flip side is that this seriously blurs the line between an interface, which is meant to serve as a contract, and a class which serves as its concrete implementation. In the right hands this can be an elegant way to make interfaces smarter, avoid repetition and extend libraries. In the wrong hands, we'll soon be seeing interface methods querying <em style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">this</em> and casting it to a concrete type. <a href="http://i.imgur.com/6Xchfik.jpg" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Shivers…</a>.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
</div>
<strong style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">2. Process Termination</strong><span style="background-color: white; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px;"> Launching an external process is one of those things you do half-knowing you'll come back to debug it when the process crashes, hangs or consumes 100% CPU. The Process class now comes equipped with two new methods to help you take control of unruly processes.</span><br />
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
The first one, <em style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">isAlive(), </em>lets you easily check if the process is still up without having to wait for it. The second and more powerful one is <em style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">destroyForcibly() </em>which lets you forcibly kill a process which has timed-out or is no longer necessary.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">3. StampedLocks</strong></div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Now here’s something to get excited about. Nobody likes to synchronize code. It's a sure-fire way of reducing your app's throughput (especially under scale), or worse - cause it to hang. Even so, sometime you just don't have a choice.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
There are plenty of idioms to synchronize multi-threaded access to a resource. One of the most venerated ones is ReadWriteLock and its associated implementations. This idiom is meant to reduce contention by allowing multiple threads to consume a resource while only blocking for threads that manipulate it. Sounds great in theory, but in reality this lock is sloooow, especially with a high number of writer threads.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
This got so bad that Java 8 is introducing a brand new RWLock called StampedLock. Not only is this lock faster, but it also offers a powerful API for optimistic locking, where you can obtain a reader lock at a very low cost, hoping that no write operation occurs during the critical section. At the end of the section you query the lock to see whether a write has occurred during that time, in which case you can decide whether to retry, escalate the lock or give up.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
This lock is a powerful tool and deserves a complete post by itself. I'm giddy with excitement about this new toy - well done!</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">4. Concurrent Adders</strong></div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
This is another little gem for anyone working on multi-threaded apps. A simple and efficient new API for reading and writing to counters from multiple threads, in a way that’s even faster than using AtomicIntegers. Pretty darn cool!</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">5. Optional Values</strong></div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Oh, NullPointers, the bane of all Java developers. Maybe the most popular of all exceptions, this has been around since the dawn of time. Or at least 1965.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Borrowing from Scala and Haskell, Java 8 has a new template named <strong style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Optional</strong> for wrapping references that may be null. It’s by no means a silver bullet to end nulls, but more a means for an API designer to signify at the code level (vs. the documentation) that a null value may be returned or passed to a method, and the caller should prepare for it. As such, this will only work for new APIs, assuming callers do not let the reference escape the wrapper where it can be unsafely dereferenced.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
I have to say I'm pretty ambivalent about this feature. On one hand, nulls remain a huge problem, so I appreciate anything done on that front. On the other hand I'm fairly skeptical this'll succeed. This is because employing Optional requires continuing company-wide effort, and with little immediate value. Unless enforced vigorously, chances are this will be left at the side of the road.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">6. Annotate Anything</strong></div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Another small improvement to the Java language is that annotations can now be added to almost everything in your code. Previously, annotations could only be added to things like class or method declarations. With Java 8 annotations can be added to variable and parameter declarations, when casting to a value to specific type, or even when allocating a new object. This is part of a concentrated effort (along with improvements to the Java doc tools and APIs) to make the language more friendly towards static analysis and instrumentation tools (e.g FindBugs). It's a nice feature, but much like<em style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">invokeDynamic</em> introduced in Java 7, its real value will depend on what the community does with it.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">7. Overflow Operations</strong></div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Now here’s a set of methods which should have been a part of the core library from day one. A favorite hobby of mine is to debug numeric overflows when ints exceed 2^32, and go on to create the nastiest and most random of bugs (i.e. “how did I get this weird value?”).</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Once again, no silver bullet here, but a set of functions to operate on numbers that throw when overflow in a less forgiving way than your standard +/ * operator which <em style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">implicitly</em> overflow. If it was up to me I'd have this be the default mode for the JVM, with explicit functions that <em style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">allow</em> arithmetic overflow.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">8. Directory Walking</strong></div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Iterating the contents of a directory tree has long been one of those go-to google searches (in which case you should probably be using Apache.FileUtils). Java 8 has given the Files class a face-lift, with ten new methods. My favorite one is <em style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">walk()</em> which creates a lazy stream (important for large file systems) to iterate the contents of a directory structure.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">9. Strong Random Generation</strong></div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
There’s no shortage of talk nowadays about password and key vulnerability. Programming security is a tricky business and prone to mistakes. That’s why I like the new SecureRandom.<em style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">getinstanceStrong()</em>method which automatically picks the strongest random generator available to the JVM. This reduces the chances of you failing to get, or defaulting to a weak generator, which will make keys and encrypted values more susceptible to hacking.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">10. Date.toInstant()</strong></div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Java 8 introduces a complete new date time API. This is fairly understandable, as the existing one isn't very good. Joda has essentially been the go-to Java date time API for years now. Still, even with the new API one big problem remains - there’s a TON of code and libraries using the old API.</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
And we all know they're here to stay. So what do you do?</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
For this Java 8 has done something pretty elegant, adding a new method to the Date class called <em style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">toInstant()</em> which converts it to the new API. This enables you to make a quick jump to the new API, even when working with code that uses the old Date API (and will continue to do so in the foreseeable future).</div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div dir="ltr" style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; line-height: 22.5px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-size: xx-small;"><i>source:dzone</i></span></div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-16598560995890472202014-04-07T20:36:00.000+05:302014-04-07T20:36:03.287+05:30Character Encoding<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
A character encoding system consists of a code that pairs each character from a given repertoire with something else—such as a bit pattern, sequence of natural numbers, octets, or electrical pulses—in order to facilitate the transmission of data (generally numbers or text) through telecommunication networks or for data storage. Other terms such as character set, character map, codeset, and code page are used almost interchangeably, but these terms have related but distinct meanings described below.<br />
<br />
<b>Code unit</b><br />
A code unit is a bit sequence used to encode the characters of a repertoire.<br />
With US-ASCII, code unit is 7 bits.<br />
With UTF-8, code unit is 8 bits.<br />
With EBCDIC, code unit is 8 bits.<br />
With UTF-16, code unit is 16 bits.<br />
With UTF-32, code unit is 32 bits.<br />
<br />
<br />
A character encoding tells the computer how to interpret raw zeroes and ones into real characters. It usually does this by pairing numbers with characters.<br />
<br />
There are many different types of character encodings floating around, but the ones we deal most frequently with are ASCII, 8-bit encodings, and Unicode-based encodings.<br />
<br />
<b>ASCII </b>is a 7-bit encoding based on the English alphabet.<br />
<br />
<b>8-bit encodings</b> are extensions to ASCII that add a potpourri of useful, non-standard characters like é and æ. They can only add 127 characters, so usually only support one script at a time. When you see a page on the web, chances are it's encoded in one of these encodings.<br />
<br />
<b>Unicode-based</b> encodings implement the Unicode standard and include UTF-8, UTF-16 and UTF-32/UCS-4. They go beyond 8-bits and support almost every language in the world. UTF-8 is gaining traction as the dominant international encoding of the web.<br />
<br />
The first step of our journey is to find out what the encoding of your website is. The most reliable way is to ask your browser:<br />
<br />
<b>Mozilla Firefox</b><br />
Tools > Page Info: Encoding<br />
<br />
<b>Internet Explorer</b><br />
View > Encoding: bulleted item is unofficial name<br />
<br />
Internet Explorer won't give you the MIME (i.e. useful/real) name of the character encoding, so you'll have to look it up using their description. Some common ones:<br />
<br />
<b>IE's Description<span class="Apple-tab-span" style="white-space: pre;"> </span>Mime Name</b><br />
<b><br /></b>
<b>Windows</b><br />
Arabic (Windows)<span class="Apple-tab-span" style="white-space: pre;"> </span>Windows-1256<br />
Baltic (Windows)<span class="Apple-tab-span" style="white-space: pre;"> </span>Windows-1257<br />
Central European (Windows)<span class="Apple-tab-span" style="white-space: pre;"> </span>Windows-1250<br />
Cyrillic (Windows)<span class="Apple-tab-span" style="white-space: pre;"> </span>Windows-1251<br />
Greek (Windows)<span class="Apple-tab-span" style="white-space: pre;"> </span>Windows-1253<br />
Hebrew (Windows)<span class="Apple-tab-span" style="white-space: pre;"> </span>Windows-1255<br />
Thai (Windows)<span class="Apple-tab-span" style="white-space: pre;"> </span>TIS-620<br />
Turkish (Windows)<span class="Apple-tab-span" style="white-space: pre;"> </span>Windows-1254<br />
Vietnamese (Windows)<span class="Apple-tab-span" style="white-space: pre;"> </span>Windows-1258<br />
Western European (Windows)<span class="Apple-tab-span" style="white-space: pre;"> </span>Windows-1252<br />
<br />
<b>ISO</b><br />
Arabic (ISO)<span class="Apple-tab-span" style="white-space: pre;"> </span>ISO-8859-6<br />
Baltic (ISO)<span class="Apple-tab-span" style="white-space: pre;"> </span>ISO-8859-4<br />
Central European (ISO)<span class="Apple-tab-span" style="white-space: pre;"> </span>ISO-8859-2<br />
Cyrillic (ISO)<span class="Apple-tab-span" style="white-space: pre;"> </span>ISO-8859-5<br />
Estonian (ISO)<span class="Apple-tab-span" style="white-space: pre;"> </span>ISO-8859-13<br />
Greek (ISO)<span class="Apple-tab-span" style="white-space: pre;"> </span>ISO-8859-7<br />
Hebrew (ISO-Logical)<span class="Apple-tab-span" style="white-space: pre;"> </span>ISO-8859-8-l<br />
Hebrew (ISO-Visual)<span class="Apple-tab-span" style="white-space: pre;"> </span>ISO-8859-8<br />
Latin 9 (ISO)<span class="Apple-tab-span" style="white-space: pre;"> </span>ISO-8859-15<br />
Turkish (ISO)<span class="Apple-tab-span" style="white-space: pre;"> </span>ISO-8859-9<br />
Western European (ISO)<span class="Apple-tab-span" style="white-space: pre;"> </span>ISO-8859-1<br />
<br />
<b>Other</b><br />
Chinese Simplified (GB18030)<span class="Apple-tab-span" style="white-space: pre;"> </span>GB18030<br />
Chinese Simplified (GB2312)<span class="Apple-tab-span" style="white-space: pre;"> </span>GB2312<br />
Chinese Simplified (HZ)<span class="Apple-tab-span" style="white-space: pre;"> </span>HZ<br />
Chinese Traditional (Big5)<span class="Apple-tab-span" style="white-space: pre;"> </span>Big5<br />
Japanese (Shift-JIS)<span class="Apple-tab-span" style="white-space: pre;"> </span>Shift_JIS<br />
Japanese (EUC)<span class="Apple-tab-span" style="white-space: pre;"> </span>EUC-JP<br />
Korean<span class="Apple-tab-span" style="white-space: pre;"> </span>EUC-KR<br />
Unicode (UTF-8)<span class="Apple-tab-span" style="white-space: pre;"> </span>UTF-8<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-28890886830859878962014-03-25T10:16:00.000+05:302016-03-14T19:50:28.964+05:30New in Java 8<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="-webkit-font-smoothing: antialiased; background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<span style="font-size: 14px; line-height: 21px;"><br /></span></div>
<div style="-webkit-font-smoothing: antialiased; background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<span style="font-size: 14px; line-height: 21px;">These changes include:</span></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; background-color: white; font-family: arial, helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/language/enhancements.html#javase8" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Java Programming Language</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Lambda Expressions, a new language feature, has been introduced in this release. They enable you to treat functionality as a method argument, or code as data. Lambda expressions let you express instances of single-method interfaces (referred to as functional interfaces) more compactly.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Method references provide easy-to-read lambda expressions for methods that already have a name.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Default methods enable new functionality to be added to the interfaces of libraries and ensure binary compatibility with code written for older versions of those interfaces.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Repeating Annotations provide the ability to apply the same annotation type more than once to the same declaration or type use.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Type Annotations provide the ability to apply an annotation anywhere a type is used, not just on a declaration. Used with a pluggable type system, this feature enables improved type checking of your code.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Improved type inference.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Method parameter reflection.</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/collections/changes8.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Collections</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Classes in the new <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.util.stream</code> package provide a Stream API to support functional-style operations on streams of elements. The Stream API is integrated into the Collections API, which enables bulk operations on collections, such as sequential or parallel map-reduce transformations.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Performance Improvement for HashMaps with Key Collisions</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/compactprofiles/" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Compact Profiles</a> contain predefined subsets of the Java SE platform and enable applications that do not require the entire Platform to be deployed and run on small devices.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/security/enhancements-8.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Security</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Client-side TLS 1.2 enabled by default</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
New variant of <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">AccessController.doPrivileged</code> that enables code to assert a subset of its privileges, without preventing the full traversal of the stack to check for other permissions</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Stronger algorithms for password-based encryption</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
SSL/TLS Server Name Indication (SNI) Extension support in JSSE Server</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Support for AEAD algorithms: The SunJCE provider is enhanced to support AES/GCM/NoPadding cipher implementation as well as GCM algorithm parameters. And the SunJSSE provider is enhanced to support AEAD mode based cipher suites. See Oracle Providers Documentation, JEP 115.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
KeyStore enhancements, including the new Domain KeyStore type<code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.security.DomainLoadStoreParameter</code>, and the new command option <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">-importpassword</code> for the keytool utility</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
SHA-224 Message Digests</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Enhanced Support for NSA Suite B Cryptography</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Better Support for High Entropy Random Number Generation</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
New <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.security.cert.PKIXRevocationChecker</code> class for configuring revocation checking of X.509 certificates</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
64-bit PKCS11 for Windows</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
New rcache Types in Kerberos 5 Replay Caching</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Support for Kerberos 5 Protocol Transition and Constrained Delegation</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Kerberos 5 weak encryption types disabled by default</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Unbound SASL for the GSS-API/Kerberos 5 mechanism</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
SASL service for multiple host names</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
JNI bridge to native JGSS on Mac OS X</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Support for stronger strength ephemeral DH keys in the SunJSSE provider</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Support for server-side cipher suites preference customization in JSSE</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/javase-clienttechnologies.htm" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">JavaFX</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The new Modena theme has been implemented in this release. For more information, see the blog at <a href="http://fxexperience.com/2013/03/modena-theme-update/" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">fxexperience.com</a>.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The new <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">SwingNode</code> class enables developers to embed Swing content into JavaFX applications. See the <a href="http://docs.oracle.com/javase/8/javafx/api/javafx/embed/swing/SwingNode.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">SwingNode</code></a> javadoc and <a href="http://docs.oracle.com/javase/8/javafx/interoperability-tutorial/embed-swing.htm" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Embedding Swing Content in JavaFX Applications</a>.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The new UI Controls include the <a href="http://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/DatePicker.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">DatePicker</code></a> and the <a href="http://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/TreeTableView.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">TreeTableView</code></a> controls.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javafx.print</code> package provides the public classes for the JavaFX Printing API. See the <a href="http://docs.oracle.com/javase/8/javafx/api/javafx/print/package-summary.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">javadoc</a> for more information.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The 3D Graphics features now include 3D shapes, camera, lights, subscene, material, picking, and antialiasing. The new <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">Shape3D</code> (<code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">Box</code>, <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">Cylinder</code>, <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">MeshView</code>, and <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">Sphere</code>subclasses), <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">SubScene</code>, <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">Material</code>, <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">PickResult</code>, <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">LightBase</code> (<code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">AmbientLight</code> and<code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">PointLight</code> subclasses) , and <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">SceneAntialiasing</code> API classes have been added to the JavaFX 3D Graphics library. The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">Camera</code> API class has also been updated in this release. See the corresponding class javadoc for <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javafx.scene.shape.Shape3D</code>,<code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javafx.scene.SubScene</code>, <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javafx.scene.paint.Material</code>,<code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javafx.scene.input.PickResult</code>, <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javafx.scene.SceneAntialiasing</code>, and the<a href="http://docs.oracle.com/javase/8/javafx/graphics-tutorial/javafx-3d-graphics.htm" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Getting Started with JavaFX 3D Graphics</a> document.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">WebView</code> class provides new features and improvements. Review <a href="http://docs.oracle.com/javase/8/javafx/embedded-browser-tutorial/index.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Supported Features of HTML5</a> for more information about additional HTML5 features including Web Sockets, Web Workers, and Web Fonts.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Enhanced text support including bi-directional text and complex text scripts such as Thai and Hindi in controls, and multi-line, multi-style text in text nodes.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Support for Hi-DPI displays has been added in this release.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The CSS Styleable* classes became public API. See the <a href="http://docs.oracle.com/javase/8/javafx/api/javafx/css/package-frame.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javafx.css</code></a> javadoc for more information.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The new <a href="http://docs.oracle.com/javase/8/javafx/api/javafx/concurrent/ScheduledService.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">ScheduledService</code></a> class allows to automatically restart the service.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
JavaFX is now available for ARM platforms. JDK for ARM includes the base, graphics and controls components of JavaFX.</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/tools/enhancements-8.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Tools</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">jjs</code> command is provided to invoke the Nashorn engine.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java</code> command launches JavaFX applications.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java</code> man page has been reworked.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">jdeps</code> command-line tool is provided for analyzing class files.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Java Management Extensions (JMX) provide remote access to diagnostic commands.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">jarsigner</code> tool has an option for requesting a signed time stamp from a Time Stamping Authority (TSA).</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/javac/index.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Javac tool</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">-parameters</code> option of the <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javac</code> command can be used to store formal parameter names and enable the Reflection API to retrieve formal parameter names.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The type rules for equality operators in the Java Language Specification (JLS) Section 15.21 are now correctly enforced by the <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javac</code> command.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javac</code> tool now has support for checking the content of <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javadoc</code> comments for issues that could lead to various problems, such as invalid HTML or accessibility issues, in the files that are generated when <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javadoc</code> is run. The feature is enabled by the new <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">-Xdoclint</code> option. For more details, see the output from running "<code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javac -X</code>". This feature is also available in the <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javadoc</code> tool, and is enabled there by default.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javac</code> tool now provides the ability to generate native headers, as needed. This removes the need to run the <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javah</code> tool as a separate step in the build pipeline. The feature is enabled in <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javac</code> by using the new <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">-h</code> option, which is used to specify a directory in which the header files should be written. Header files will be generated for any class which has either native methods, or constant fields annotated with a new annotation of type <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.lang.annotation.Native</code>.</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/whatsnew-8.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Javadoc tool</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javadoc</code> tool supports the new <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">DocTree</code> API that enables you to traverse Javadoc comments as abstract syntax trees.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javadoc</code> tool supports the new Javadoc Access API that enables you to invoke the Javadoc tool directly from a Java application, without executing a new process. See the <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/whatsnew-8.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">javadoc what's new</a> page for more information.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javadoc</code> tool now has support for checking the content of <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javadoc</code> comments for issues that could lead to various problems, such as invalid HTML or accessibility issues, in the files that are generated when <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javadoc</code> is run. The feature is enabled by default, and can also be controlled by the new <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">-Xdoclint</code> option. For more details, see the output from running "<code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javadoc -X</code>". This feature is also available in the <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">javac</code> tool, although it is not enabled by default there.</div>
</li>
</ul>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/intl/enhancements.8.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Internationalization</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Unicode Enhancements, including support for Unicode 6.2.0</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Adoption of Unicode CLDR Data and the java.locale.providers System Property</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
New Calendar and Locale APIs</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Ability to Install a Custom Resource Bundle as an Extension</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/jweb/enhancements-8.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Deployment</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
For sandbox applets and Java Web Start applications, <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">URLPermission</code> is now used to allow connections back to the server from which they were started. <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">SocketPermission</code>is no longer granted.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The Permissions attribute is required in the JAR file manifest of the main JAR file at all security levels.</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/datetime/index.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Date-Time Package</a> - a new set of packages that provide a comprehensive date-time model.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/enhancements.html#jdk8" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Scripting</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Nashorn</a> Javascript Engine</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/pack200/enhancements.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Pack200</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Pack200 Support for Constant Pool Entries and New Bytecodes Introduced by JSR 292</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
JDK8 support for class files changes specified by JSR-292, JSR-308 and JSR-335</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/io/enhancements.html#jdk8" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">IO and NIO</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
New <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">SelectorProvider</code> implementation for Solaris based on the Solaris event port mechanism. To use, run with the system property <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.nio.channels.spi.Selector</code>set to the value <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">sun.nio.ch.EventPortSelectorProvider</code>.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Decrease in the size of the <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;"><jdk_home>/jre/lib/charsets.jar</jdk_home></code> file</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Performance improvement for the <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.lang.String(byte[], *)</code> constructor and the<code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.lang.String.getBytes()</code> method.</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/lang/enhancements.html#jdk8" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">java.lang and java.util Packages</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Parallel Array Sorting</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Standard Encoding and Decoding Base64</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Unsigned Arithmetic Support</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">JDBC</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The JDBC-ODBC Bridge has been removed.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
JDBC 4.2 introduces new features.</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Java DB</div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
JDK 8 includes Java DB 10.10.</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/net/enhancements-8.0.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Networking</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The class <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.net.URLPermission</code> has been added.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
In the class <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.net.HttpURLConnection</code>, if a security manager is installed, calls that request to open a connection require permission.</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/concurrency/changes8.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Concurrency</a></div>
<ul class="obullets" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Classes and interfaces have been added to the <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.util.concurrent</code> package.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Methods have been added to the <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.util.concurrent.ConcurrentHashMap</code> class to support aggregate operations based on the newly added streams facility and lambda expressions.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Classes have been added to the <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.util.concurrent.atomic</code> package to support scalable updatable variables.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Methods have been added to the <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.util.concurrent.ForkJoinPool</code> class to support a common pool.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
The <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">java.util.concurrent.locks.StampedLock</code> class has been added to provide a capability-based lock with three modes for controlling read/write access.</div>
</li>
</ul>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/xml/enhancements.html" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Java XML</a> - JAXP</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/vm/" style="-webkit-font-smoothing: antialiased; color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">HotSpot</a></div>
</li>
<ul style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Hardware intrinsics were added to use Advanced Encryption Standard (AES). The<code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">UseAES</code> and <code style="-webkit-font-smoothing: antialiased; color: #666666; font-family: courier, 'courier new', monaco; list-style: none; margin: 0px; padding: 0px;">UseAESIntrinsics</code> flags are available to enable the hardware-based AES intrinsics for Intel hardware. The hardware must be 2010 or newer Westmere hardware. For example, to enable hardware AES, use the following flags:</div>
<pre class="oac_no_warn" style="-webkit-font-smoothing: antialiased; list-style: none; padding: 0px;" xml:space="preserve">-XX:+UseAES -XX:+UseAESIntrinsics
</pre>
<div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
To disable hardware AES use the following flags:</div>
<pre class="oac_no_warn" style="-webkit-font-smoothing: antialiased; list-style: none; padding: 0px;" xml:space="preserve">-XX:-UseAES -XX:-UseAESIntrinsics
</pre>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Removal of PermGen.</div>
</li>
<li style="-webkit-font-smoothing: antialiased; background-image: url(http://www.oracleimg.com/us/assets/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><div style="-webkit-font-smoothing: antialiased; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
Default Methods in the Java Programming Language are supported by the byte code instructions for method invocation.</div>
</li>
</ul>
</ul>
<div>
<span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 12px;"><br /></span></span></div>
<div>
<span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 12px;"><br /></span></span></div>
<div>
<span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 12px;"><br /></span></span></div>
<div>
<span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 12px;"><br /></span></span></div>
<div>
<span style="background-color: white; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px;"><b>Summary:</b></span><ul style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22.5px; margin: 15px 0px 15px 20px; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; margin: 0px 0px 10px; outline: 0px; padding: 0px; vertical-align: baseline;">Lambda expressions: a new language feature that enables you to treat functionality as a method argument, or code as data.</li>
<li style="border: 0px; font-family: inherit; margin: 0px 0px 10px; outline: 0px; padding: 0px; vertical-align: baseline;">Other significant enhancements and changes to the Java language and standard libraries including default methods, the new java.util.stream package, and the Date-Time API.</li>
<li style="border: 0px; font-family: inherit; margin: 0px 0px 10px; outline: 0px; padding: 0px; vertical-align: baseline;">Compact Profiles contain predefined subsets of the Java SE platform and enable applications that do not require the entire Platform to be deployed and run on small devices.</li>
<li style="border: 0px; font-family: inherit; margin: 0px 0px 10px; outline: 0px; padding: 0px; vertical-align: baseline;">Security enhancements include updates to the Java Cryptography Architecture; limited doPrivileged, a mechanism that enables code to assert a subset of its privileges; SSL/TLS Server Name Indication (SNI) Extension; and keystore enhancements.</li>
<li style="border: 0px; font-family: inherit; margin: 0px 0px 10px; outline: 0px; padding: 0px; vertical-align: baseline;">JavaFX documentation has been updated for this release.</li>
<li style="border: 0px; font-family: inherit; margin: 0px 0px 10px; outline: 0px; padding: 0px; vertical-align: baseline;">A new JavaScript engine, Nashorn, is included in JDK 8.</li>
<li style="border: 0px; font-family: inherit; margin: 0px 0px 10px; outline: 0px; padding: 0px; vertical-align: baseline;">Java Mission Control 5.3 is included in JDK 8.</li>
<li style="border: 0px; font-family: inherit; margin: 0px 0px 10px; outline: 0px; padding: 0px; vertical-align: baseline;">Decommission of the JVM Permanent Generation space and replaced by the Metaspace.</li>
</ul>
<div>
<span style="color: #222222; font-family: Helvetica, arial, verdana;"><span style="font-size: 15px; line-height: 22.5px;"><br /></span></span></div>
</div>
<div>
<span style="color: #222222; font-family: Helvetica, arial, verdana;"><span style="font-size: 15px; line-height: 22.5px;"><br /></span></span></div>
<div>
<span style="color: #222222; font-family: Helvetica, arial, verdana;"><span style="font-size: 15px; line-height: 22.5px;"><br /></span></span></div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-51712992245471464002014-02-12T18:05:00.002+05:302014-02-12T18:05:12.250+05:30Multi-tiered technical support<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<div class="MsoNormal">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">Technical support is often
subdivided into tiers, or levels, in order to better serve a business or
customer base.</span><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<h3 style="background: white; line-height: 14.4pt; margin-bottom: .05in; margin-left: 0in; margin-right: 0in; margin-top: 0in;">
<span class="mw-headline"><span style="font-family: Arial, sans-serif; font-size: 13pt;">Tier/Level
1 (T1/L1)</span></span><span style="-webkit-user-select: none; display: inline-block; unicode-bidi: -webkit-isolate;"><span style="font-family: Arial, sans-serif; font-size: 13pt;"><o:p></o:p></span></span></h3>
<div style="background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 14.4pt; margin: 4.8pt 0in 6pt;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;">This is
the initial support level responsible for basic customer issues. It is
synonymous with first-line support, level 1 support, front-end support, support
line 1, and various other headings denoting basic level technical support
functions.The first job of a Tier I specialist is to gather the customer’s
information and to determine the customer’s issue by analyzing the symptoms and
figuring out the underlying problem.<span class="apple-converted-space"> </span>When
analyzing the symptoms, it is important for the<span class="apple-converted-space"> </span><span style="color: #0b0080;">technician</span><span class="apple-converted-space"> </span>to
identify what the customer is trying to accomplish so that time is not wasted
on "attempting to solve a symptom instead of a problem."<span class="apple-converted-space"> <o:p></o:p></span></span></div>
<div style="background: white; line-height: 14.4pt; margin-bottom: 6.0pt; margin-left: 0in; margin-right: 0in; margin-top: 4.8pt;">
<br /></div>
<h3 style="background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 14.4pt; margin: 0in 0in 0.05in; overflow: hidden;">
<span id="Tier.2FLevel_2_.28T2.2FL2.29"><span class="mw-headline"><span style="font-family: Arial, sans-serif; font-size: 13pt;">Tier/Level
2 (T2/L2)</span></span></span><span style="-webkit-user-select: none; display: inline-block; unicode-bidi: -webkit-isolate;"><span style="font-family: Arial, sans-serif; font-size: 13pt;"><o:p></o:p></span></span></h3>
<div style="background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 14.4pt; margin: 4.8pt 0in 6pt;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;">This is a
more in-depth technical support level than Tier I and therefore costs more as
the techs are more experienced and knowledgeable on a particular product or
service. It is synonymous with level 2 support, support line 2, administrative
level support, and various other headings denoting advanced technical<span class="apple-converted-space"> </span><span style="color: #0b0080;">troubleshooting</span><span class="apple-converted-space"> </span>and analysis methods.<span style="color: #0b0080;">Technicians</span><span class="apple-converted-space"> </span>in
this realm of knowledge are responsible for assisting Tier I personnel in
solving basic technical problems and for investigating elevated issues by
confirming the validity of the problem and seeking for known solutions related
to these more complex issues.However, prior to the<span class="apple-converted-space"> </span><span style="color: #0b0080;">troubleshooting</span><span class="apple-converted-space"> </span>process, it is important that the
technician review the work order to see what has already been accomplished by
the Tier I technician and how long the technician has been working with the
particular customer. This is a key element in meeting both the customer and
business needs as it allows the technician to prioritize the troubleshooting
process and properly manage his or her time<o:p></o:p></span></div>
<h3 style="background: white; line-height: 14.4pt; margin-bottom: .05in; margin-left: 0in; margin-right: 0in; margin-top: 0in;">
<span class="mw-headline"><span style="font-family: Arial, sans-serif; font-size: 13pt;"> </span></span></h3>
<h3 style="background: white; line-height: 14.4pt; margin-bottom: .05in; margin-left: 0in; margin-right: 0in; margin-top: 0in;">
<span class="mw-headline"><span style="font-family: Arial, sans-serif; font-size: 13pt;">Tier/Level
3 (T3/L3)</span></span><span style="-webkit-user-select: none; display: inline-block; unicode-bidi: -webkit-isolate;"><span style="font-family: Arial, sans-serif; font-size: 13pt;"><o:p></o:p></span></span></h3>
<div style="background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 14.4pt; margin: 4.8pt 0in 6pt;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;">This is
the highest level of support in a three-tiered technical support model
responsible for handling the most difficult or advanced problems. It is
synonymous with level 3 support, back-end support, support line 3, high-end
support, and various other headings denoting expert level troubleshooting and
analysis methods. These individuals are experts in their fields and are
responsible for not only assisting both Tier I and Tier II personnel, but with
the research and development of solutions to new or unknown issues. Note that
Tier III technicians have the same responsibility as Tier II technicians in
reviewing the work order and assessing the time already spent with the customer
so that the work is prioritized and time management is sufficiently utilized.<span class="apple-converted-space"> </span>If
it is at all possible, the<span class="apple-converted-space"> </span><span style="color: #0b0080;">technician</span><span class="apple-converted-space"> </span>will
work to solve the problem with the customer as it may become apparent that the
Tier I and/or Tier II technicians simply failed to discover the proper
solution. Upon encountering new problems, however, Tier III personnel must
first determine whether or not to solve the problem and may require the
customer’s contact information so that the technician can have adequate time to
troubleshoot the issue and find a solution<o:p></o:p></span></div>
<div style="background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 14.4pt; margin: 4.8pt 0in 6pt;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;">This team
can analyze the code and data using information from Tier 1 and Tier 2.<o:p></o:p></span></div>
<h3 style="background: white; line-height: 14.4pt; margin-bottom: .05in; margin-left: 0in; margin-right: 0in; margin-top: 0in;">
<span class="mw-headline"><span style="font-family: Arial, sans-serif; font-size: 13pt;"> </span></span></h3>
<h3 style="background: white; line-height: 14.4pt; margin-bottom: .05in; margin-left: 0in; margin-right: 0in; margin-top: 0in;">
<span class="mw-headline"><span style="font-family: Arial, sans-serif; font-size: 13pt;">Tier/Level
4 (T4/L4)</span></span><span style="-webkit-user-select: none; display: inline-block; unicode-bidi: -webkit-isolate;"><span style="font-family: Arial, sans-serif; font-size: 13pt;"><o:p></o:p></span></span></h3>
<br />
<div style="background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 14.4pt; margin: 4.8pt 0in 6pt;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;">While not
universally used, a fourth level often represents an escalation point beyond
the organization. This is generally a hardware or software vendor. Within a
corporate incident management system it is important to continue to track
incidents even when they are being actioned by a vendor and the<span class="apple-converted-space"> </span><span style="color: #0b0080;">Service Level
Agreement</span><span class="apple-converted-space"> </span>(SLA) may
have specific provision for this. Within a manufacturing organization, the fourth
level might also represent the Research & Development.<o:p></o:p></span></div>
<div style="background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 14.4pt; margin: 4.8pt 0in 6pt;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;"><br /></span></div>
<div style="background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 14.4pt; margin: 4.8pt 0in 6pt;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;"><br /></span></div>
<div style="background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 14.4pt; margin: 4.8pt 0in 6pt;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;"><br /></span></div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-76869263301160442882014-02-11T17:22:00.000+05:302014-02-11T17:25:42.215+05:30Web Service Axis2 and Eclipse<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<h3 style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; margin: 0px; position: relative; text-align: justify;">
Setup the Development Environment</h3>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">First you need to set up the development environment. Following things are needed if you want to create Web Services using Axis2 and Eclipse IDE. </span><br />
<br />
<div style="background-color: #f8f8f8; color: red; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">
Some Eclipse versions have compatibility issues with Axis2. We tested with Apache Axis2 1.5.2, Eclipse Helios and Apache Tomcat 6.</div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">1) Apache Axis2 Binary Distribution</span><br />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">2) Apache Axis2 WAR Distribution</span><br />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">3) Apache Tomcat</span><br />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">4) Eclipse IDE</span><br />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">5) Java installed in your Computer</span><br />
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">1.2. Then you have to set the environment variables for Java and Tomcat. There following variables should be added.</span><br />
<pre class="brush: text;" style="background-color: #f8f8f8; color: #333333; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">JAVA_HOME :- Set the value to jdk directory (e.g. C:\Program Files\Java\jdk1.6.0_21)
TOMCAT_HOME :- Set the value to top level directory of your Tomcat install (e.g. D:\programs\apache-tomcat-6.0.29)
PATH :- Set the value to bin directory of your jdk (e.g. C:\Program Files\Java\jdk1.6.0_21\bin)
</pre>
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">1.3. Now you have to add runtime environment to eclipse. There go to Windows –-> Preferences and Select the Server --> Runtime Environments.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYer2uVDmS2IFtxv7hL5LdJ1G0b81ZN3ijX6c_VROmyq2Z1DY2cUnWVCUzJLeUe0oHOcFmiePxJGFnQsXVut-d9aB6Rv_qLEaVrz9sC41mUna3s-IIwDDm1JIlRLXGu7P7tfGdaEaux73_/s1600/1.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYer2uVDmS2IFtxv7hL5LdJ1G0b81ZN3ijX6c_VROmyq2Z1DY2cUnWVCUzJLeUe0oHOcFmiePxJGFnQsXVut-d9aB6Rv_qLEaVrz9sC41mUna3s-IIwDDm1JIlRLXGu7P7tfGdaEaux73_/s1600/1.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">There select Apache Tomcat v6.0 and in the next window browse your Apache installation directory and click finish.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRktuRseapMz5imG822uIFz5mT1EwUBQ8RXBIYywmkD3OIKzgymOj6JlJLQ-45r0KjU2ONHtWpTC2hb1QW4XUSYY1_dK1jYS25B9B8WU1y5eMGWa9sEoA2xZgUvhLUkTiM8NnQmf4puwMz/s1600/2.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRktuRseapMz5imG822uIFz5mT1EwUBQ8RXBIYywmkD3OIKzgymOj6JlJLQ-45r0KjU2ONHtWpTC2hb1QW4XUSYY1_dK1jYS25B9B8WU1y5eMGWa9sEoA2xZgUvhLUkTiM8NnQmf4puwMz/s1600/2.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">1.4. Then click on the Web Service –-> Axis2 Preferences and browse the top level directory of Apache Axis2 Binary Distribution.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9tsO2rPjrLT6XTE254bqcW5v4RXFhZ7VaViek5ccWUrKTPJfOi4Z25uj3LNvIvUCB2_qclyFTT8-B7Kf4oHNmB2215FH566_cPb9ox7KImU7r1GC0Slf1R5fO5aqpiFO9zRK73ztpkSmF/s1600/3.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9tsO2rPjrLT6XTE254bqcW5v4RXFhZ7VaViek5ccWUrKTPJfOi4Z25uj3LNvIvUCB2_qclyFTT8-B7Kf4oHNmB2215FH566_cPb9ox7KImU7r1GC0Slf1R5fO5aqpiFO9zRK73ztpkSmF/s1600/3.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<h3 style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; margin: 0px; position: relative; text-align: justify;">
Creating the Web Service Using Bottom-Up Approach</h3>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">2.1 First create a new Dynamic Web Project (File --> New –-> Other…) and choose Web --> Dynamic Web Project.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5FFv-FGFXM2clN4e1TV0AJkD2BrtL6jpXFjH-38eJT_yQabKnNrtCqX2t4eNOv8XXiP1gILAMaFN3Z1ps1Cfnd-dKlBPKyr8tzT3umKPRct8GVr2FvyCyPgFgc-1ZzDyIM45k7p5JLSj3/s1600/4.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5FFv-FGFXM2clN4e1TV0AJkD2BrtL6jpXFjH-38eJT_yQabKnNrtCqX2t4eNOv8XXiP1gILAMaFN3Z1ps1Cfnd-dKlBPKyr8tzT3umKPRct8GVr2FvyCyPgFgc-1ZzDyIM45k7p5JLSj3/s1600/4.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">2.2 Set Apache Tomcat as the Target Runtime and click Modify to install Axis2 Web Services project facet.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh65KXpz06RjT_09NMvaNyTtippL4n7VMskvSifFFpKGrzL7T_Efc58IDIbEEB9ZCHyAuhqiFzmbA7pOIuFompBHl08A9SvEHa2t8qPiI3yZtnO4q23Jib9wUvFWfUt_G44WjoNTPq-hG0x/s1600/5.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh65KXpz06RjT_09NMvaNyTtippL4n7VMskvSifFFpKGrzL7T_Efc58IDIbEEB9ZCHyAuhqiFzmbA7pOIuFompBHl08A9SvEHa2t8qPiI3yZtnO4q23Jib9wUvFWfUt_G44WjoNTPq-hG0x/s1600/5.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">2.3 Select Axis2 Web Services</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsuF6xHNrdiLIlU7DEYOgkg3pLtvViRbJbIe6eHmVHtrJh5oK3d9dJwnUo754RohnrcD51RQfvmOVSB00-lul3adhrSDI_MNOXRA7kdCsK2QWe2rdrXe0mXDKlBpBNJVeGUTSs60sPMGCv/s1600/6.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsuF6xHNrdiLIlU7DEYOgkg3pLtvViRbJbIe6eHmVHtrJh5oK3d9dJwnUo754RohnrcD51RQfvmOVSB00-lul3adhrSDI_MNOXRA7kdCsK2QWe2rdrXe0mXDKlBpBNJVeGUTSs60sPMGCv/s1600/6.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">2.4 Click OK and then Next. There you can choose folders and click Finish when you are done.</span><br />
<br />
<h3 style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; margin: 0px; position: relative; text-align: justify;">
Create Web Service Class</h3>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">Now you can create a Java class that you would want to expose as a Web Service. I’m going to create new class called FirstWebService and create public method called addTwoNumbers which takes two integers as input and return the addition of them.</span><br />
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">3.1 Right Click on MyFirstWebService in Project Explorer and select New –-> Class and give suitable package name and class name. I have given com.sencide as package name and FirstWebService as class name.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcdZvQpGXsQI4A20WTap8fv2RWLyrCqIo1ZoCtCis1kzSqTlT3VO3tTK8I3F6GYM7EW3BmxvBwDptOBMVwxiLgBCfbUxHQDlAZfJoDxT-W1FpqGClgE-XvNx3iLumSS66sCj7JDWeUoeC5/s1600/7.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcdZvQpGXsQI4A20WTap8fv2RWLyrCqIo1ZoCtCis1kzSqTlT3VO3tTK8I3F6GYM7EW3BmxvBwDptOBMVwxiLgBCfbUxHQDlAZfJoDxT-W1FpqGClgE-XvNx3iLumSS66sCj7JDWeUoeC5/s1600/7.jpg" style="border: none; position: relative;" /></a></div>
<pre class="brush: java;" style="background-color: #f8f8f8; color: #333333; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">package com.sencide;
public class FirstWebService {
public int addTwoNumbers(int firstNumber, int secondNumber){
return firstNumber + secondNumber;
}
}
</pre>
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">3.2 Then, select File --> New –-> Other and choose Web Service.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAdTD3j7l6hQX_3CmnP7FAbX0T6SO_BhZp2fsbzqoI9DqBmDHXCLBxi1uywmMNP9Re1YNxTMoc-rvoDjDj_jGLD9E8K1a5E0f2aS4k_JSYR1DcN0sHu3A8UPlIpiZVwk36ROLGm0eE6y1P/s1600/8.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAdTD3j7l6hQX_3CmnP7FAbX0T6SO_BhZp2fsbzqoI9DqBmDHXCLBxi1uywmMNP9Re1YNxTMoc-rvoDjDj_jGLD9E8K1a5E0f2aS4k_JSYR1DcN0sHu3A8UPlIpiZVwk36ROLGm0eE6y1P/s1600/8.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">3.3 Select the FirstWebService class as service implementation and to make sure that the Configuration is setup correctly click on Server runtime.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguRH_8oaoYV1OgyXlqVYOqvSQjgvi5C-MZucPHrrFI4f2HOoOG4jgsBVJLt_QcDyNzkT0bIcKiu5sJwPamoCoXxjYIfkXOML4hsMOyU5qKjxb1Rv-Id-UTj4XhwCjU6gAMe-XxhRbZ2hE9/s1600/9.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguRH_8oaoYV1OgyXlqVYOqvSQjgvi5C-MZucPHrrFI4f2HOoOG4jgsBVJLt_QcDyNzkT0bIcKiu5sJwPamoCoXxjYIfkXOML4hsMOyU5qKjxb1Rv-Id-UTj4XhwCjU6gAMe-XxhRbZ2hE9/s1600/9.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">3.4 There set the Web Service runtime as Axis2 (Default one is Axis) and click Ok.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2j5sgG9P0tKNF5SZrsTxxYvPEC_ed_ILHtXyCjAI7YGcMw1f4cciGNZZfr86LB3KhsbR_FlugA7lqAJ0NsGTn6SNxcFWuM2lSD38GHZbed-2GYndvgNoohJjUCQUccCNVPS7KjNfchtYU/s1600/10.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2j5sgG9P0tKNF5SZrsTxxYvPEC_ed_ILHtXyCjAI7YGcMw1f4cciGNZZfr86LB3KhsbR_FlugA7lqAJ0NsGTn6SNxcFWuM2lSD38GHZbed-2GYndvgNoohJjUCQUccCNVPS7KjNfchtYU/s1600/10.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">3.5 Click Next and make sure Generate a default service.xml file is selected. </span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNMRUgHVS-AuT2u8y1_P8Hj8_SKPdyoTPdCqKLk8rRA7Q2lTmWVFUWc-g2oZ-SAFBMB7_BxxYMZ71QLPWxLIvVDCE2JQPvoeYD3Yomo2R7ODd_t9hw1aSEDd0SlMTRxv41RT8gksrNfRrK/s1600/11.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNMRUgHVS-AuT2u8y1_P8Hj8_SKPdyoTPdCqKLk8rRA7Q2lTmWVFUWc-g2oZ-SAFBMB7_BxxYMZ71QLPWxLIvVDCE2JQPvoeYD3Yomo2R7ODd_t9hw1aSEDd0SlMTRxv41RT8gksrNfRrK/s1600/11.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">3.6 Click Next and Start the Server and after server is started you can Finish if you do not want to publish the Web service to a test UDDI repository.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_Ktwp3cqRA2Hvga6bqkrlrhVtV6tF_Vr-pJ8DyIwZdx6HD0WBGDPrFfPOncQGqvCbzQrAjclgk30GzY9ItyKQirAIwFSX9GUR_qKzXFa9HiHc1-LRiToBtuHd8BbjSdzspTnrglq0Xd3f/s1600/12.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_Ktwp3cqRA2Hvga6bqkrlrhVtV6tF_Vr-pJ8DyIwZdx6HD0WBGDPrFfPOncQGqvCbzQrAjclgk30GzY9ItyKQirAIwFSX9GUR_qKzXFa9HiHc1-LRiToBtuHd8BbjSdzspTnrglq0Xd3f/s1600/12.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">You can go to http://localhost:8888/MyFirstWebService/services/listServices to see your running service which is deployed by Axis2. You can see the WSDL by clicking the link FirstWebService.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEWS6BvJTLXaDVMzN0NgBsqO43tdQL3o6twWMma7AqvrhjcpL7LriPLi1v-owD2D04MjvPfiKXhFdIdiihdgeVhb5G8lDJuPetcpQ-XVSwPkFB07Ohe92dLDFkeA9HJKVA3Krn8Z_fhwci/s1600/13.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEWS6BvJTLXaDVMzN0NgBsqO43tdQL3o6twWMma7AqvrhjcpL7LriPLi1v-owD2D04MjvPfiKXhFdIdiihdgeVhb5G8lDJuPetcpQ-XVSwPkFB07Ohe92dLDFkeA9HJKVA3Krn8Z_fhwci/s1600/13.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">We have to use Eclipse every time when we want to run the service if we do not create .aar (Axis Archive) file and deploy it to the server. So let’s see how we can create it.</span><br />
<br />
<h3 style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; margin: 0px; position: relative; text-align: justify;">
Create .aar (Axis Archive) file and Deploying Service</h3>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">4.1 In your eclipse workspace and go to MyFirstWebService folder and there you can find our web service inside services folder. Go to that directory using command prompt and give following command. It will create the FirstWebService.aar file there.</span><br />
<pre class="brush: css;" style="background-color: #f8f8f8; color: #333333; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">jar cvf FirstWebService.aar com META-INF</pre>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh53wlxq7OuhQWucK2B8sFGIYoeTGCTiy25oQYQdycLffTJtmUzDtjy-wYIsxZPLtKtrVw7fKOtvnr88xJ0g2qWkNrdjSwi2bTEulYDJxuCY9o14sEWwfAYvBmVnxRu8dyrzUdntY5Q22Wc/s1600/14.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh53wlxq7OuhQWucK2B8sFGIYoeTGCTiy25oQYQdycLffTJtmUzDtjy-wYIsxZPLtKtrVw7fKOtvnr88xJ0g2qWkNrdjSwi2bTEulYDJxuCY9o14sEWwfAYvBmVnxRu8dyrzUdntY5Q22Wc/s1600/14.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6SCcFFxIoUXZ1CiHxgDHWAHruomAAMXVvVpnRc6p1eVnqitYoJVv1zViGEwkc5VBtF9QtJP8AhwIJ4YbT0rP7ycPGv0QFvSpah_pZjQKGLzFfnyjLYqJ55AG_Ts8FFeRS0JJyuIHKLq82/s1600/15.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6SCcFFxIoUXZ1CiHxgDHWAHruomAAMXVvVpnRc6p1eVnqitYoJVv1zViGEwkc5VBtF9QtJP8AhwIJ4YbT0rP7ycPGv0QFvSpah_pZjQKGLzFfnyjLYqJ55AG_Ts8FFeRS0JJyuIHKLq82/s1600/15.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">4.2 Then copy the axis2.war file you can find inside the Apache Axis2 WAR Distribution (You downloaded this at the first step) to the webapps directory of Apache Tomcat. Now stop the Apache Tomcat server which is running on Eclipse IDE. </span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg57KWHTJJd-W4JT2YpWJIB6nnSwA_uUhP5B0Kb1_Ko_-FEGRYEEBoM0eoO0YDeKc48He7VUdfP0UBrkZ2-UsPEMVAwij2-UM2FZ75fLBG_BLSgV4NwNOMJZ6vwTKNeKhRMHD26d_hNOzlL/s1600/16.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg57KWHTJJd-W4JT2YpWJIB6nnSwA_uUhP5B0Kb1_Ko_-FEGRYEEBoM0eoO0YDeKc48He7VUdfP0UBrkZ2-UsPEMVAwij2-UM2FZ75fLBG_BLSgV4NwNOMJZ6vwTKNeKhRMHD26d_hNOzlL/s1600/16.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">4.3 Using command prompt start the Apache Tomcat (Go to bin directory and run the file startup.bat). Now there will be new directory called axis2 inside the webapps directory. Now if you go to the http://localhost:8080/axis2/ you can see the home page of Axis2 Web Application.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsMiLQQGLl3iMXZMm1SrakUqviS0YfeGp21C8xCoYwan7gF1PU7Zs_nS7cKjgdpnTcEV3OephmBdwWr4r_K4kgg7IKxIGp-8RSFn2ufNrnB9NGWX8Gx4GLkLd-4lmTiyQQAw0lcJEfW4sL/s1600/17.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsMiLQQGLl3iMXZMm1SrakUqviS0YfeGp21C8xCoYwan7gF1PU7Zs_nS7cKjgdpnTcEV3OephmBdwWr4r_K4kgg7IKxIGp-8RSFn2ufNrnB9NGWX8Gx4GLkLd-4lmTiyQQAw0lcJEfW4sL/s1600/17.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">4.4 Then click the link Administration and login using username : admin and password : axis2. There you can see upload service link on top left and there you can upload the created FirstWebService.aar file. This is equal to manually copping the FirstWebService.aar to webapps\axis2\WEB-INF\services directory.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHy00W3yia49xZNpqwmwy7YCIQgAq9S6Y9mLulIbM3bwD53P7Z-_criZQ0AjxLd6ebFk3b-1bnElh7gVu-d0HfhZEvP1TwwMxe0knyxmezi3T8BfuWobhKtgffghVcuXbAomJP-G4hyV2W/s1600/18.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHy00W3yia49xZNpqwmwy7YCIQgAq9S6Y9mLulIbM3bwD53P7Z-_criZQ0AjxLd6ebFk3b-1bnElh7gVu-d0HfhZEvP1TwwMxe0knyxmezi3T8BfuWobhKtgffghVcuXbAomJP-G4hyV2W/s1600/18.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">4.5 Now when you list the services by going to http://localhost:8080/axis2/services/listServices you should be able to see our newly added service.</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp_5QY71PoVlloHLfE1BOFan4gFkfA-HSCq1dLQrZNHAdusA3adYL2krrdTx4o_7QpQ4eh1sv49cO0VxQNmiJZfS6yt8JI10DLYWKGxRvIROiauCQGZMuzNgHmB8op1uOKcjDJRkAMnCQ8/s1600/19.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp_5QY71PoVlloHLfE1BOFan4gFkfA-HSCq1dLQrZNHAdusA3adYL2krrdTx4o_7QpQ4eh1sv49cO0VxQNmiJZfS6yt8JI10DLYWKGxRvIROiauCQGZMuzNgHmB8op1uOKcjDJRkAMnCQ8/s1600/19.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<h3 style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; margin: 0px; position: relative; text-align: justify;">
Creating a Web service client</h3>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">5.1 Select File --> New --> Other… and choose Web Service Client</span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLTIlJyK6iCazmHUeN9VC3YxK6XBAmyI26-g8SAJo3HABN7ISM1VxM4v4m1MhB2Ey1DhPDoVyI-_bZcuA6WcJ4yib9QcAIrZkFT7ND19aYhrp0u08krmoqGqiHxoNfSZvUqbUCceh4ytJX/s1600/20.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLTIlJyK6iCazmHUeN9VC3YxK6XBAmyI26-g8SAJo3HABN7ISM1VxM4v4m1MhB2Ey1DhPDoVyI-_bZcuA6WcJ4yib9QcAIrZkFT7ND19aYhrp0u08krmoqGqiHxoNfSZvUqbUCceh4ytJX/s1600/20.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">5.2 Set he newly created Axis2 Web service (http://localhost:8080/axis2/services/FirstWebService?wsdl) as the Service definition. Then configure the Server runtime as previously and click finish. </span><br />
<br />
<div class="separator" style="background-color: #f8f8f8; clear: both; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhDntleLl_ITSZ6PR7OPWRB_DE_CCzA1gez6JO2sJts27q9C2F_PdBcEN_jCD8SdOKA7pSz13wZadgyWVkvcd84TUiGNrudi7L3M8MkKPJJYVG4GWcOUBrUMMf-gVZkzWWn4bKwEr2V1ul/s1600/21.jpg" imageanchor="1" style="color: #000077; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhDntleLl_ITSZ6PR7OPWRB_DE_CCzA1gez6JO2sJts27q9C2F_PdBcEN_jCD8SdOKA7pSz13wZadgyWVkvcd84TUiGNrudi7L3M8MkKPJJYVG4GWcOUBrUMMf-gVZkzWWn4bKwEr2V1ul/s1600/21.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;" />
<span style="background-color: #f8f8f8; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">5.3 This will generate two new classes called FirstWebServiceStub.java and FirstWebServiceCallbackHandler.java. Now we can create test class for client and use our web service. Create new class called TestClient.java and paste following code.</span><br />
<pre class="brush: java;" style="background-color: #f8f8f8; color: #333333; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;">package com.sencide;
import java.rmi.RemoteException;
import com.sencide.FirstWebServiceStub.AddTwoNumbers;
import com.sencide.FirstWebServiceStub.AddTwoNumbersResponse;
public class TestClient {
public static void main(String[] args) throws RemoteException {
FirstWebServiceStub stub = new FirstWebServiceStub();
AddTwoNumbers atn = new AddTwoNumbers();
atn.setFirstNumber(5);
atn.setSecondNumber(7);
AddTwoNumbersResponse res = stub.addTwoNumbers(atn);
System.out.println(res.get_return());
}
}</pre>
<pre class="brush: java;" style="background-color: #f8f8f8; color: #333333; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;"></pre>
<pre class="brush: java;" style="background-color: #f8f8f8; color: #333333; font-size: 15px; line-height: 20.790000915527344px; text-align: justify;"></pre>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-80744366719839121382014-02-10T18:16:00.004+05:302014-02-10T18:16:49.188+05:30Deploying Java Class as a Web Service in Axis2<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<br />
<h1>
<span style="font-size: small; font-weight: normal;">We assume that we want to publish the following <tt>HolaWorld</tt> class as a Web service<tt>HelloService</tt>.</span></h1>
<pre class="code" style="background-color: #eeeeee; border: 1px solid rgb(0, 0, 0); font-family: 'Courier New', Courier, mono; font-size: 0.8em; margin: 5px; padding: 5px;">public class HolaWorld {
public String sayHello(String name) {
return "Hello " + name;
}
}
</pre>
Our <tt>HelloService</tt> will provide one operation, <tt>sayHello</tt>, that takes <tt>name</tt> as the input and returns the "Hello ..." string as the output.<br />
There are two main steps involved in publishing a Web service from your Java code:<br />
<ol>
<li>Write a service description file (services.xml).</li>
<li>Create a service archive file.</li>
</ol>
<h2>
Writing the services.xml file</h2>
Once Axis2 receives a request to a Web service, it has to figure out which Java class can handle the Web service request. This "mapping" between a Web service and a Java class is described in<tt>services.xml</tt> file. Writing the <tt>services.xml</tt> file for our <tt>HelloService</tt> is quite simple. Essentially, the file should contain the following information:<br />
<ul>
<li>Fully qualified class name that handles the published Web service</li>
<li>Message receiver used by the Web service</li>
</ul>
For now, do not worry about the message receiver part, and look at the following <tt>services.xml</tt> file for our <tt>HelloService</tt>:<br />
<pre class="code" style="background-color: #eeeeee; border: 1px solid rgb(0, 0, 0); font-family: 'Courier New', Courier, mono; font-size: 0.8em; margin: 5px; padding: 5px;"><service name="HelloService">
<description>This is the HolaWorld service</description>
<parameter name="ServiceClass">HolaWorld</parameter>
<operation name="sayHello">
<messagereceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver">
</messagereceiver></operation>
</service>
</pre>
The second line in the above file provides a text description of the Web service and may be omitted.<br />
<strong>Service implementation class:</strong> The third line indicates that this Web service is handled by the <tt>HolaWorld</tt> class. Since our <tt>HolaWorld</tt> class does not belong to any package namespace, the class name is specified simply as <tt>HolaWorld</tt> here, but in general the class name should be the fully qualified class name (like <tt>edu.ucla.cs.cs144.DemoService</tt>).<br />
<strong>Message receiver:</strong> The fourth through sixth lines specify that the operation <tt>sayHello</tt> of this service should use the Axis2 Java class <tt>org.apache.axis2.rpc.receivers.RPCMessageReceiver</tt> as its message receiver class. A message receiver is the Axis2 Java class that processes the inputs to and outputs from the Web service, and pass them to/from our Java class. Axis2 provides a set of built-in message receiver classes depending on the message exchange pattern (MEP) of the Web service (e.g., input only? output only? input and output?) and the input/output encoding scheme used by the service; in our example, we are using <tt>org.apache.axis2.rpc.receivers.RPCMessageReceiver</tt> which is a common message receiver used for publishing an existing Java class.<br />
<h3>
Different way of specifying message receivers</h3>
In the above <tt>services.html</tt> file, we specified the Axis2 message receiver class at the operation level, associating a message receiver for <em>every</em> operation of our service. Axis2 also allows us to specify the message receivers at the service level, so that we can specify the message receiver <em>once for the entire service</em> as follows:<br />
<pre class="code" style="background-color: #eeeeee; border: 1px solid rgb(0, 0, 0); font-family: 'Courier New', Courier, mono; font-size: 0.8em; margin: 5px; padding: 5px;"><service name="HelloService">
<description>This is the HolaWorld service</description>
<parameter name="ServiceClass">HolaWorld</parameter>
<messagereceivers>
<messagereceiver class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" mep="http://www.w3.org/2004/08/wsdl/in-only">
<messagereceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" mep="http://www.w3.org/2004/08/wsdl/in-out">
</messagereceiver></messagereceiver></messagereceivers>
<operation name="sayHello">
</operation></service>
</pre>
Note that Axis2 has built-in support for all the eight MEPs (<u>M</u>essage <u>E</u>xchange <u>P</u>attern) defined in WSDL 2.0. In the <tt>services.xml</tt> file, we can specify the MEP and the corresponding message receiver, and then, Axis2 automatically picks up and uses the appropriate message receiver for each service operation. In the above file, we specify <tt>RPCInOnlyMessageReceiver</tt> as the message receiver for all input-only operations and <tt>RPCMessageReceiver</tt> as the message receiver for all input-and-output operations.<br />
In the second last line, the <tt>operation</tt> element for <tt>sayHello</tt> shows this operation will be available by the service. This line is optional; by default, Axis2 exposes all public methods in the service implementation class whether we specify them in <tt>services.xml</tt> or not. For all public methods in the implemenation class, Axis2 calculates the MEP of the operation by checking the return value of the Java method. If the method is void, the MEP will be in-only; else, it will be in-out, depending on which the appropriate MEP message receiver will be set.<br />
<h2>
Creating a service archive file</h2>
Once we create our service description file <tt>services.xml</tt>, the final step before deployment is to create a service archive file by putting together (1) our service implementation class, (2) all libraries that it depends on, and (3) the <tt>services.xml</tt> file. These files should be placed in the appropriate directories within the archive file. For example, the directory structure of our <tt>HelloService</tt> archive file should be as follows:<br />
<pre class="code" style="background-color: #eeeeee; border: 1px solid rgb(0, 0, 0); font-family: 'Courier New', Courier, mono; font-size: 0.8em; margin: 5px; padding: 5px;">HelloService.aar
+- META-INF
| +- services.xml
|
+- HolaWorld.class
</pre>
First note that the name of the archive file is <tt>HelloService.aar</tt>, which is the same as the <tt>name of the Web service</tt> that the archive file provides, followed by the extension <tt>.aar</tt>. If the name of our service were <tt>MyService</tt>, the file name would have been <tt>MyService.aar</tt>.<br />
The <tt>services.xml</tt> file that we created in the previous step should be placed in the <tt>META-INF</tt> subdirectory of the archive file.<br />
Depending on the namespace the class belongs to, the service impelementation class should be placed in the appropriate subdirectory of the archive file. In our example, the <tt>HolaWorld</tt> class does not belong to any package namespace, so it is simply placed at the root directory. All other classes that the implementation class depends on should also be placed at the appropriate directory.<br />
Finally, if the implementation class uses any external Java libraries, they should be placed in the <tt>lib</tt> subdirectory of the archive file.<br />
Here is a bit more complex example of the structure of an archive file:<br />
<pre class="code" style="background-color: #eeeeee; border: 1px solid rgb(0, 0, 0); font-family: 'Courier New', Courier, mono; font-size: 0.8em; margin: 5px; padding: 5px;">AnotherService.aar
+- META-INF
| +- services.xml
|
+- lib
| +- xxx.jar
|
+- edu
+- ucla
+- cs
+- cs144
+- AnotherClass.class
</pre>
Here, the archive file handles the Web service named <tt>AnotherService</tt> and the service is implemented by the Java class <tt>edu.ucla.cs.cs144.AnotherClass</tt>. Assuming the class depends on the <tt>xxx.jar</tt>library, we placed it in the <tt>lib</tt> subdirectory of the archive file.<br />
An archive file can be created using the jar command in the stadard Java Development Kit. For example, to create the above <tt>HolaWorld.aar</tt> file, first (1) create a temporary directory, (2) create the appropriate subdirectories within the temporary directory (like <tt>META-INF</tt>, <tt>lib</tt>, etc.), (3) place your class and library files at the appropriate subdirectories. Then inside the temporary directory, execute the following command:<br />
<pre class="code" style="background-color: #eeeeee; border: 1px solid rgb(0, 0, 0); font-family: 'Courier New', Courier, mono; font-size: 0.8em; margin: 5px; padding: 5px;">jar cvf HelloService.aar *</pre>
The above command will create the <tt>HelloService.aar</tt> file and add all files below the current directory to the file. Once the archive file is created, deploying the service is just a matter of dropping the service archive file into the services directory in our Axis2 server repository. We can also easily upload the service archive file by using axis2 Web administration console.<br />
<br />
<br /></div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-75046709243064980542014-01-30T15:24:00.002+05:302014-01-30T15:24:53.344+05:30Free Eclipse Plug-ins For Java Developers <div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<b style="background-color: white; font-family: verdana; font-size: small;"><i>Code Quality Plugins</i></b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">1.FindBugs –</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> This plug-in is utilized with eclipse IDE and is the software used for locating bugs in Java programs. It’s a free software licensed under Lesser GNU Public License. For further information you can go to -</span><a href="http://findbugs.sourceforge.net/" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">FindBugs</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">2.Checkstyle –</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> This plug-in can be integrated to IDE Eclipse ensuring the Java code follows the coding standards. For further information you can go to - </span><a href="http://eclipse-cs.sourceforge.net/" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">Checkstyle</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">3.ECLemma –</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> This is a free tool that can be taken via Eclipse Public License providing fast development and test cycles. You can make use of the “launch” in the code coverage mode that functions like actual run/debug mode. For further information you can go to - </span><a href="http://www.efytimes.com/e1/fullnews.asp?edid=128273" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;" www.eclemma.org="">ECLemma</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><i style="background-color: white; font-family: verdana; font-size: small;"><b>Text Editor Plugins</b></i><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">4. AnyEdit Tools -</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> The plug-in helps to add new editor to output consoles, toolbar, and it also help to import and export data. It is licensed under Eclipse Public License v1.0. For further information you can go to - </span><a href="http://andrei.gmxhome.de/anyedit/" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">AnyEdit Tools</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">5. Eclim -</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> Eclim helps to bring Eclipse functionality to one of the best editors - Vim, wherein development can be done in various languages and it also provides bug fixing provisions. It is released under GPLV3. For further information you can go to -</span><a href="http://eclim.org/" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">Eclim</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">6. Eclipse-rbe -</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> Eclipse-rbe is used for editing Java resources and its features include warnings for missing values, sorted keys, conversion from/to Unicode etc. It is licensed under GNU library or LGPL. For further information you can go to - </span><a href="http://sourceforge.net/projects/eclipse-rbe/" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">Eclipse-rbe</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;"><i>Dependency Management</i></b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">7.Apache IvyDE –</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> This is an Eclipse plug-in assisting in integrating Apache Ivy’s feature of dependency management to Eclipse. It also assists in managing dependencies in ‘ivy.xml’. For further information you can go to - </span><a href="http://ant.apache.org/ivy/ivyde/" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">Apache IvyDE</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">8.M2eclipse (Maven Plugin) –</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> This assist in managing both simple and multi module projects, and Maven integration for Eclipse (M2eclipise) that assists in launching maven from Eclipse. It offers features like dependency management and automatic downloading. For further information you can go to - </span><a href="http://www.sonatype.org/m2eclipse" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">M2eclipse (Maven Plugin)</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;"><i>Version Control Integration Plugins</i></b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">9.Subclipse - Subclipse is a SVN plug-in which offers support for subversion of Eclipse IDE and it is licensed under EPL 1.0. Subeclipse 1.6.x supports ColabNet Merge Client. Subclipse provides easy interface to use the features. For further information you can go to -</span><a href="http://subclipse.tigris.org/" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">Subclipse</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">10.EGit -</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> EGit plug-in provides support, synchronizes view, reading for .git/ exclude files, provides rebasing and has streamlined commands for pulling and pushing. For further information you can go to - </span><a href="http://www.eclipse.org/egit/" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">EGit</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">11.MercurialEclipse -</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> MercurialEclipse is one of the active Version Control System which gives you access on registration. It is a reliable plug-in which provides cloning repositories, push-pull synchronization and enables easy rollback. For further information you can go to -</span><a href="http://javaforge.com/project/HGE" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">MercurialEclipse</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;"><i>Framework Development </i></b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">12.Spring Tool Suite –</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> This offers development environment and tools like XML file wizards and graphical spring configuration editor that can be used for easy development. For further information you can go to - </span><a href="http://spring.io/tools/eclipse" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">Spring Tool Suite</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">13.Spring IDE –</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> This assists in developing Spring Application and offers interface for using the graphical editing framework. It display graphs of relationships and beans through the configuration files. </span><a href="http://springide.org/" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">Spring IDE</a><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">Continuous Integration Related Plugins</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">14.Hudson Status –</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> This is a simple plug-in displaying the status (red/green) of a application on Hudson build server. It is quite a powerful continuous integration server used in a number of large software development projects. For further information you can go to -</span><a href="http://marketplace.eclipse.org/content/hudson-status#.UuieSfvhXGg" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">Hudson Status</a><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">15.Sonar Plugin -</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> Sonar Plug-in for Eclipse provides powerful integration of Sonar with Eclipse. It highlights code quality problems as we browse the code. Since the code quality standards definition is centralized on Sonar server, it ensures all developers are following same quality standards. Sonar is a open source platform used for centrally controlling the source code quality of software projects. For further information you can go to - </span><a href="http://marketplace.eclipse.org/content/sonar" style="background-color: white; color: #008eb0; font-family: Arial, Helvetica, sans-serif; font-size: small; text-decoration: none;">Sonar Plugin</a><span style="background-color: white; font-family: verdana; font-size: x-small;"> </span><br />
<span style="background-color: white; font-family: verdana; font-size: x-small;"><br /></span>
<span style="background-color: white; font-family: verdana; font-size: x-small;"><br /></span></div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-41666995872553843832014-01-30T15:06:00.000+05:302014-01-30T15:06:03.807+05:30Webservice SOAP & REST<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 class="entry-title" style="background-color: white; border: 0px; clear: both; font-family: 'Helvetica Neue', Arial, Helvetica, 'Nimbus Sans L', sans-serif; font-size: 21px; line-height: 1.3em; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></h1>
<h1 class="entry-title" style="background-color: white; border: 0px; clear: both; font-family: 'Helvetica Neue', Arial, Helvetica, 'Nimbus Sans L', sans-serif; font-size: 21px; line-height: 1.3em; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></h1>
<div class="entry-content" style="background-color: white; border: 0px; clear: both; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px; margin: 0px; padding: 12px 0px 0px; vertical-align: baseline;">
<div style="background-color: transparent; border: 0px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<br /></div>
<h2 style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; clear: both; color: black; font-weight: normal; line-height: 1.5em; margin: 0px 0px 20px; padding: 0px; vertical-align: baseline;">
SOAP</h2>
<div style="background-color: transparent; border: 0px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
SOAP comes from the bowels of XML-RPC, which was done way back in 1998. SOAP once stood for <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Simple Object Access Protocol</em> but this was dropped with v1.3 of the standard, being blessed on June 24, 2003. SOAP was born of Microsoft, based on WSDL and UDDI. WSDL and UDDI have faded, but SOAP has much of its DNA in these specs. SOAP is currently owned by the W3C.</div>
<div style="background-color: transparent; border: 0px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<img alt="SOAP message model" src="http://upload.wikimedia.org/wikipedia/commons/5/59/SOAP.svg" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;" /></div>
<div style="background-color: transparent; border: 0px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
SOAP characteristics:</div>
<ul style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style: square; margin: 0px 0px 24px 1.5em; padding: 0px; vertical-align: baseline;">
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Exposes <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">operations</em> that represent <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">logic</em></li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">provides a loose coupling for integrating diverse systems</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">designed to be extensible with the raft of WS-* specifications</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Designed for distributed computing</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Has a standard error messaging and error types</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Aligns with EA requirements in that it supports various transports, e.g. HTTP, SMPT, UDP, JMS, etc.</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">supports enterprise security with WS-Security</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">supports language neutrality (you can use it with JAVA, Python, Ruby, Lisp, Perl, PHP, C, C#, etc.)</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">is ACID when using WS-AT</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">With WS-RM supports reliable messaging</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Has strong typing, so supports strong governance</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">broadly supported in the industry</li>
</ul>
<h2 style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; clear: both; color: black; font-weight: normal; line-height: 1.5em; margin: 0px 0px 20px; padding: 0px; vertical-align: baseline;">
REST</h2>
<div style="background-color: transparent; border: 0px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
REST was developed in parallel with HTTP/1.1. The largest implementation of a REST system is something called with WWW. REST works on a server-client conceptual basis, again, with clients initiating requests to servers, which process and return responses. This request / response paradigm is built upon the transfer of resource representations. A RESTFUL approach is not limited to HTTP, by the way. But, an example of HTTP yields the REST verbs (read methods from an OOP paradigm), URIs, Internet media types, request and response codes, etc. Here is a maintained list of REST examples.</div>
<div style="background-color: transparent; border: 0px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
Importantly, there are constraints on a design to maintain its RESTFUL nature. These are meant to be helpful, constraining forces:</div>
<ol style="background-color: transparent; border: 0px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 24px 1.5em; padding: 0px; vertical-align: baseline;">
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Client-server</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Stateless</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Cacheable</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Layered System</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Uniform interface – decouples architecture to allow client and server to evolve independently</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Code on demand (optional) – a server can pass logic to a client that may be executed, e.g. javascript or (shudder) applets.</li>
</ol>
<h2 style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; clear: both; color: black; font-weight: normal; line-height: 1.5em; margin: 0px 0px 20px; padding: 0px; vertical-align: baseline;">
Comparison</h2>
<ul style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style: square; margin: 0px 0px 24px 1.5em; padding: 0px; vertical-align: baseline;">
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">REST exposes <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">resources</em> that represent <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">data</em>, while SOAP exposes <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">operations</em> that represent <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">logic</em></li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">REST uses <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">VERBS</em> (Methods: GET/POST/DELETE) while SOAP uses the one verb<em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">POST</em></li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">REST emphasises simple p2p communication over HTTP, while SOAP emphasised loosely coupled distributed messaging</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">REST supports multiple data formats, while SOAP encodes everything in XML with data attachments</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">REST emphasises stateless communication while SOAP supports stateless and stateful operations</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">SOAP is better at asynchronous messaging, pub/sub and has strong typing (in the WSDL)</li>
</ul>
<h2 style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; clear: both; color: black; font-weight: normal; line-height: 1.5em; margin: 0px 0px 20px; padding: 0px; vertical-align: baseline;">
Strengths</h2>
<div style="background-color: transparent; border: 0px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
REST has benefits because:</div>
<ul style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style: square; margin: 0px 0px 24px 1.5em; padding: 0px; vertical-align: baseline;">
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">REST can be consumed by any client, even a web browser using Ajax and .js</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">REST is lightweight. Doesn’t require XML parsing, consumes less BW, doesn’t require a SOAP header for each message</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">REST is very widespread and highly adopted by many web resources</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">REST can be made very safe, since one can filter on anything that is not a <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">GET</em> verb.</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Great for web services, exposing data over the internet.</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Great for low BW and CPU requirements.</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Great for combining data from multiple sources in a browser.</li>
</ul>
<div style="background-color: transparent; border: 0px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
SOAP has benefits also:</div>
<ul style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style: square; margin: 0px 0px 24px 1.5em; padding: 0px; vertical-align: baseline;">
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">SOAP will allow for custom exception codes, will allow for client side artefacts from a WSDL, has strong support in many IDEs</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">SOAP is much easier to use for stateful, asynchronous designs</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">SOAP is considered more secure by many because parameters are encoded in the message, not the URI. SOAP has support for contracts, acquiring tokens, etc. Note that REST doesn’t require params in the URI, but it often happens. Many would argue that this is breaking REST.</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">SOAP has reliability as part of its contract, e.g. WS-RM</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">SOAP can be governed more easily, it can be discovered more easily</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Great for enterprise applications requiring contracts and reliability measures.</li>
<li style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">Great for asynch processing</li>
</ul>
<div style="background-color: transparent; border: 0px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="background-color: transparent; border: 0px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="background-color: transparent; border: 0px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<br /></div>
</div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-26288452519946527372014-01-27T18:55:00.003+05:302014-01-27T18:55:36.954+05:30SOAP UI : Error loading. java.lang.Exception: Failed to load url;<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<br />
<span style="background-color: #e0e0e0; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px;">I am trying to create a new project in SoapUI, and I keep getting the same error no matter what URL I try to load in there. In order to make sure it wasn't my local hosted web service causing the issue, I tried the URL from this page: </span><a class="postlink" href="http://www.soapui.org/SOAP-Recording/recording-soap-traffic.html" style="background-color: #e0e0e0; border-bottom-color: rgb(102, 102, 102); border-bottom-style: dotted; border-bottom-width: 1px; color: #5d8fbd; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px; margin: 0px; padding: 0px; text-decoration: none;">http://www.soapui.orgRecording/re ... affic.html</a><span style="background-color: #e0e0e0; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px;"> which uses </span><a class="postlink" href="http://www.webservicex.net/CurrencyConvertor.asmx?WSDL" style="background-color: #e0e0e0; border-bottom-color: rgb(102, 102, 102); border-bottom-style: dotted; border-bottom-width: 1px; color: #5d8fbd; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px; margin: 0px; padding: 0px; text-decoration: none;">http://www.webservicex.net/CurrencyConvertor.asmx?WSDL</a><span style="background-color: #e0e0e0; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px;"> as the example. </span><br style="background-color: #e0e0e0; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px; margin: 0px; padding: 0px;" /><br style="background-color: #e0e0e0; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px; margin: 0px; padding: 0px;" /><span style="background-color: #e0e0e0; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px;">When I create my project as follows:</span><br style="background-color: #e0e0e0; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px; margin: 0px; padding: 0px;" /><img alt="Image" src="http://www.soapui.org/images/stories/SOAP_Recording/NewSoapUIProject.png" style="background-color: #e0e0e0; border-width: 0px; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px; margin: 0px; padding: 0px;" /><br style="background-color: #e0e0e0; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px; margin: 0px; padding: 0px;" /><br style="background-color: #e0e0e0; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px; margin: 0px; padding: 0px;" /><span style="background-color: #e0e0e0; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px;">I get the following error:</span><br style="background-color: #e0e0e0; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px; margin: 0px; padding: 0px;" /><img alt="Image" src="http://www.k-dev.com/omok/stuff/images/soapui/soapui_error_loading_wsdl.png" style="background-color: #e0e0e0; border-width: 0px; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px; margin: 0px; padding: 0px;" /><br />
<br />
<br />
<b><span style="font-size: large;">Solution</span></b><br />
<span style="background-color: #eeeeee; color: #333333; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px;">Are you on a secured network? If so please configure the proxy settings on SoapUI. The Proxy settings is located here: File>Preferences>Proxy Settings. Click on File again, save preferences and you might even want to restart SoapUI.</span><br />
<br />
<br />
<br /></div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com2tag:blogger.com,1999:blog-343405073344405294.post-14567559642044487182014-01-16T11:55:00.000+05:302014-02-14T09:51:34.369+05:30Java Performance Checklist<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<h2 class="HeadA" style="background-color: white;">
<span style="font-size: small;">Most of these suggestions apply only after a bottleneck has been identified:</span></h2>
<ul style="background-color: white;">
<li class="ListBullet">Establish whether you have a memory problem.</li>
<br />
<li class="ListBullet">Reduce the number of temporary objects being used, especially in loops.</li>
<br />
<li class="FM-ListBullet">Avoid creating temporary objects within frequently called methods.</li>
<br />
<li class="FM-ListBullet">Presize collection objects.</li>
<br />
<li class="FM-ListBullet">Reuse objects where possible.</li>
<br />
<li class="FM-ListBullet">Empty collection objects before reusing them. (Do not shrink them unless they are very large.)</li>
<br />
<li class="FM-ListBullet">Use custom conversion methods for converting between data types (especially strings and streams) to reduce the number of temporary objects.</li>
<br />
<li class="FM-ListBullet">Define methods that accept reusable objects to be filled in with data, rather than methods that return objects holding that data. (Or you can return immutable objects.)</li>
<br />
<li class="FM-ListBullet">Canonicalize objects wherever possible. Compare canonicalized objects by identity.</li>
<br />
<li class="FM-ListBullet">Create only the number of objects a class logically needs (if that is a small number of objects).</li>
<br />
<li class="FM-ListBullet">Replace strings and other objects with integer constants. Compare these integers by identity.</li>
<br />
<li class="FM-ListBullet">Use primitive data types instead of objects as instance variables.</li>
<br />
<li class="FM-ListBullet">Avoid creating an object that is only for accessing a method.</li>
<br />
<li class="FM-ListBullet">Flatten objects to reduce the number of nested objects.</li>
<br />
<li class="FM-ListBullet">Preallocate storage for large collections of objects by mapping the instance variables into multiple arrays.</li>
<br />
<li class="FM-ListBullet">Use <code class="Literal">StringBuffer</code> rather than the string concatenation operator (+).</li>
<br />
<li class="FM-ListBullet">Use methods that alter objects directly without making copies.</li>
<br />
<li class="FM-ListBullet">Create or use specific classes that handle primitive data types rather than wrapping the primitive data types.</li>
<br />
<li class="ListBullet">Consider using a <code class="Literal">ThreadLocal</code> to provide threaded access to singletons with state.</li>
<br />
<li class="ListBullet">Use the <code class="Literal">final</code> modifier on instance-variable definitions to create immutable internally accessible objects.</li>
<br />
<li class="ListBullet">Use <code class="Literal">WeakReference</code>s to hold elements in large canonical lookup tables. (Use <code class="Literal">SoftReference</code>s for cache elements.)</li>
<br />
<li class="ListBullet">Reduce object-creation bottlenecks by targeting the object-creation process.</li>
<br />
<li class="FM-ListBullet">Keep constructors simple and inheritance hierarchies shallow.</li>
<br />
<li class="FM-ListBullet">Avoid initializing instance variables more than once.</li>
<br />
<li class="FM-ListBullet">Use the <code class="Literal">clone( )</code> method to avoid calling any constructors.</li>
<br />
<li class="FM-ListBullet">Clone arrays if that makes their creation faster.</li>
<br />
<li class="FM-ListBullet">Create copies of simple arrays faster by initializing them; create copies of complex arrays faster by cloning them.</li>
<br />
<li class="ListBullet">Eliminate object-creation bottlenecks by moving object creation to an alternative time.</li>
<br />
<li class="FM-ListBullet">Create objects early, when there is spare time in the application, and hold those objects until required.</li>
<br />
<li class="FM-ListBullet">Use lazy initialization when there are objects or variables that may never be used, or when you need to distribute the load of creating objects.</li>
<br />
<li class="FM-ListBullet">Use lazy initialization only when there is a defined merit in the design, or when identifying a bottleneck which is alleviated using lazy initialization.</li>
</ul>
<div>
<br />
<br />
<ul style="background-color: white; border: 0px; clear: left; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 10px 10px; padding: 0px;">
<li style="border: 0px; clear: none; float: none; margin: 0px 0px 0px 15px; padding: 0px;">No wildcard imports.</li>
<li style="border: 0px; clear: none; float: none; margin: 0px 0px 0px 15px; padding: 0px;">Overloads appear sequentially.</li>
<li style="border: 0px; clear: none; float: none; margin: 0px 0px 0px 15px; padding: 0px;">Braces are used even when the body is empty or contains a single statement.</li>
<li style="border: 0px; clear: none; float: none; margin: 0px 0px 0px 15px; padding: 0px;">2 spaces indentation.</li>
<li style="border: 0px; clear: none; float: none; margin: 0px 0px 0px 15px; padding: 0px;">Column limit can be 80 or 100 characters.</li>
<li style="border: 0px; clear: none; float: none; margin: 0px 0px 0px 15px; padding: 0px;">No C-style array declarations.</li>
<li style="border: 0px; clear: none; float: none; margin: 0px 0px 0px 15px; padding: 0px;">The default statement in switch statements are required.</li>
<li style="border: 0px; clear: none; float: none; margin: 0px 0px 0px 15px; padding: 0px;">Modifiers appear in the order recommended by the Java Language Specification.</li>
<li style="border: 0px; clear: none; float: none; margin: 0px 0px 0px 15px; padding: 0px;">Constants use CONSTANT_CASE. Note that every constant is a static final field, but not all static final fields are constants.</li>
</ul>
</div>
<div>
<br /></div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-46061248695833437712013-12-31T15:16:00.005+05:302014-01-14T17:37:10.299+05:30Databases Comparison<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-size: large;"><a href="http://database-management-systems.findthebest.com/compare/9-30-36-55/DB2-vs-MySQL-vs-Oracle-vs-Teradata">http://database-management-systems.findthebest.com/compare/9-30-36-55/DB2-vs-MySQL-vs-Oracle-vs-Teradata</a></span><br />
<br />
<br />
<h3 style="text-align: left;">
<span style="font-size: large;">DB Ranking 2013</span></h3>
<div>
<a href="http://db-engines.com/en/ranking"><span style="font-size: large;">http://db-engines.com/en/ranking</span></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Rank<span class="Apple-tab-span" style="white-space: pre;"> </span></b></div>
<div>
<b>Datbase<span class="Apple-tab-span" style="white-space: pre;"> </span></b></div>
<div>
<b>DatabaseModel</b><br />
<b><br /></b>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
1<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Oracle<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
2<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
MySQL<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
3<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Microsoft SQL Server<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
4<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
PostgreSQL<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
5<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
DB2<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
6<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
MongoDB<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Document store<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
7<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Microsoft Access<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
8<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
SQLite<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
9<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Sybase<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
10<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Cassandra<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Wide column store<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
11<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Teradata<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
12<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Solr<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Search engine<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
13<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Redis<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Key-value store<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
14<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
FileMaker<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
15<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Memcached<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Key-value store<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
16<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
HBase<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Wide column store<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
17<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Informix<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
18<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Hive<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
19<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
CouchDB<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Document store<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
20<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Netezza<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
Relational DBMS<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"></table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0px; width: 556px;"><colgroup><col style="mso-width-alt: 3072; mso-width-source: userset; width: 63pt;" width="84"></col><col style="mso-width-alt: 9764; mso-width-source: userset; width: 200pt;" width="267"></col><col style="mso-width-alt: 7497; mso-width-source: userset; width: 154pt;" width="205"></col></colgroup><tbody></tbody></table>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-41891327161246906832013-12-31T10:25:00.002+05:302016-03-14T19:50:28.969+05:30Java Based Content Management Systems<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<br />
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
CMS, or content management systems, are platforms for managing and administering website content. There is no denying that CMSes are important in today's web ecosystem. These content management systems not only provide an easy way to build and maintain websites, but they also lend a helping hand in updating and editing website content without the need to spend hours or days writing and altering codes and scripts.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Some of the leading CMSes are PHP-based, Ruby on Rails-based, ASP.NET-based, and Java-based. Among these, due to scalability, modernized architecture and open-source standards of a few, Java-based CMSs are getting quite a lot of attention lately, especially for enterprise websites, because of the scalable, modern, open source technology behind most of them. </div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
There are plenty of CMS tools based on Java to help developers create multi-lingual and multi-channel websites. But how do we decide on the best one for our use case?</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
we’re going to explore the top 21 content management systems based on Java. </div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.cygnet-infotech.com/all-you-need-to-know-about-alfresco-%E2%80%93-content-management-system" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="">Alfresco</a> </b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpaoaiPyFLfDvETaFGYo5d00rCdUPnDBFO_YW4eMypNqT8qtxYNgZUUFxTlEZqVSZ5JtTc8z0aWjcEM51hSfdo0omi8L3yqOkyybXtyNY_709iMUkdYLySj4OK1mgKZdFxwbKZ-9KJMXg/s1600/alfresco.jpg.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Alfresco is one of the top open-source content management systems of Java. It comes with enterprise repository and portlet capabilities along with document management, collaboration, records management, knowledge management, web content management, imaging, and a lot more.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Alfresco has a modular architecture and enables end users to efficiently manage websites across the cloud, mobile, hybrid and on-premise environments using open source Java technologies, such as Spring, Hibernate, Lucene and JSF.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.magnolia-cms.com/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Magnolia</a></b><b>: </b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJsWg7lFNffFO7u7uSla8h3kgcIRfpojCbsvnJdn1hGciZDKr-9hrZBoq4r79EpUOfrtNR6RpAL0BOu8OKZiaQ5ltMAhjTeA2taaxGruuOCuXfKO1ML2Jg-sft8K8fzUANGYrUnA3HTk4/s1600/magnolia.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Magnolia is a well-documented, easy to use, enterprise-grade open source CMS based on the Java Content Repository Standard. It is a highly popular CMS due to its out-of-the-box functionality and ease of use under an open source license. Moreover, Magnolia supports unique content delivery capabilities in a search-engine optimized manner and also follows W3C standards.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Magnolia CMS has been deployed by enterprises and governments in more than 100 countries across the world. Here's a case study on Magnolia-based website development </div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://wcm.asbrusoft.com/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Asbru</a></b><b>:</b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD_Zj5tly_ahAK2G-6gdPJPSg8JQkLK7wc2hioNR_SKGkWuyPJp-K_cAXPMc8cUIVJMcwilSzdCT1KRPp_MdkY58cTN1YzKN-y_RGoXYWd7Rni7Gyq2xMXFqGEhDqxD6FHvWbWzee_T84/s1600/asbru.gif" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Asbru is another powerful, fully-featured, easy to use content management system with database-driven capabilities. It is built on the Spring framework with integrated community, databases, eCommerce and statistics modules, which helps developers to create, publish and manage rich and user-friendly internet, extranet and intranet websites on the go.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Available in various editions, Asbru provides users with a simple, user-friendly platform to manage websites along with a host of other benefits and features such as custom templates and data, password protected content, multi-lingual content, communities, eCommerce and website analytics, a cutting-edge WYSIWYG content editor and a lot more.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.opencms.org/en/index.html" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">OpenCMS</a></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDrPDDUTLGcrwv3YrUmFyfWaCyFaxyF-FvVzB5Gzyw63ZVXNTEJWoeMbITMJvoQfpYqsdfyrR-dHH3XtBkegbJShNISCmJudilUaTT_bZnt5vNV_HenBcoBcch0mOfoMxNHnwRlLrgZLQ/s1600/opencms.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
OpenCMS is based on Java and XML technology that allows you to build highly customizable and interactive websites and portals. It comes integrated with a WYSIWYG editor and fully-featured Template Engine which is fully compliant with W3C standards.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
OpenCMS can be deployed both in an open-source environment (Linux, Apache, Tomcat, MySQL) as well as a commercial environment (Windows NT, IIS, BEA Weblogic, Oracle)</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://walrus.lt/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Walrus</a></b><b>:</b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIevPNBloRziP8kyvLLLuZWoGL6HKJmxJZdsDxirYAccgQwcLyOyAMxak2YmJERRNkgrH93NGdMrDVxgEqEum5-TFTCPqcSfmX9c11v8GF-F9CZeq8cTCqNga52lbidVxQJXO9ypwBwEY/s1600/walrus.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Walrus is yet another Spring-based CMS that provides unique and effective content management capabilities with a smart administrative interface and drag-and-drop facilities. Easy-to-setup and undo/redo features make Walrus a highly preferred and suitable CMS for government and non-profit enterprises.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://pulse.torweg.org/site/Pulsar/en_US.CMS.displayCMS.13./pulse---the-java-web-application-framework" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="">Pulse</a> : </b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicvPJ6HvF3v9y3_3Sc-O7hWVbYUe94cl0aL2LPOWlzWhYBeSxjSoj2WZ3BMmNe6gSiCRrYFyaCBYfD3wQ3i07NVEDsYbIae5b4YyEZRsGUiqrVRHeWI6elQM_GZRqSNEZk77F9Zu4Ij4o/s1600/pulse.jpg" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Pulse is a Java-based framework and portal solution that offers easy-to-use and extensible patterns for creating rich browser web applications and responsive websites. It brings a bunch of innovative and powerful components including content management, web shops, user management and more.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
A few of its key features include a WebDAV based virtual file system for digital asset management, mature user and role management, built-in internationalization, and more.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://sourceforge.net/projects/meshcms/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">MeshCMS</a></b><b>: </b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSoIVRRy_YzdjhoKwY_s_27v-Zo1ofDehALcZX5gmNa-ntPzUMljweRQiBxyuHz5gKYmSy7s6H6U0UYf1S4pT0rEW4ZTks6f7ITgGpkcsAhOnNkTr8ex1yoRsHTaDdJ6oCiODe2PqhAhk/s1600/meshcms.jpeg" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
MeshCMS is an easy to use online editing system written in Java. It comes with a host of features that you will find in any ideal content management system however, it uses a conventional approach in managing and editing website content.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
It is considered one of the fastest CMSes for editing files online, managing files, and building some very common components like menus, breadcrumbs, mail forms and so on.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
MeshCMS is accompanied by cross-browser capabilities, a WYSIWYG editor, hot-linking prevention, and tag-library that makes content management an interesting affair.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.liferay.com/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Liferay</a></b><b>:</b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhESd1SSDP6wJz1BIuDxfCsR6eRXNnggZG2AjE0Bsry9duFv7RylEhfFSRWEdmagyc0Jt7grtr_fw9dPeRcTtKvZSb8lEGw5xakWlUxgtGt9QjMZ2pDjJoibytOrMzDpVEmsdcDIcWW84U/s1600/liferay.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Liferay is one of the most popular CMSes based on <a href="http://www.cygnet-infotech.com/java/application-development" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="">Java, </a>and is recommended by many industry experts. It comes with awesome features that can make your content management tasks simple. Liferay is a very popular for developing personal as well as professional websites with ease.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://dotcms.com/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">DotCMS</a></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHakFeclalcjYkraXP2tmqMVU4W3PipMx_9jsWGIX8yAGkZYdZ2OqhMXLmPShbCeU49wUwbmAI13apdp3KKq8iV_lyTGOEwd5IvJDXjBbibzn2IftQfQ8I9N7S8Iyfj4ZnQHnIuYZbl9M/s1600/dotcms.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
DotCMS is a next-gen enterprise CMS that wears an open-source hat. It is highly popular and widely used CMS due to its open APIs, extensible and scalable architecture that it used to create personalized and engaging websites, intranets, extranets and applications with ease.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.jease.org/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Jease</a></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFpqiM2D_qGmLnz7jcI8JSdrBwShR9gixvtrsbhNJKyccprtj3VuOoPNNHju_gNZgiL0-smcT1ikw0pj8AqkAjjIOmFV6GBNiIrJV7YAvQZJSieuY5Qbg9-VG04_DNL9n6n3C9FPxmG74/s1600/jease.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Jease highly known as ‘Java with ease’ is another open source content management system that is built on popular Java technologies like db40, Perst, Lucence and ZK. It is an extremely lightweight CMS with excellent Ajax interface. Due to its intuitive and interactive interface, it is highly simple and easy to customize and deploy websites in Jease even for inexperienced Java developers.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.onehippo.org/7_8" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Hippo</a></b><b>:</b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk2gNPKEELk9T_q4gd6XIm0EjS2VeScP5CL3gnJiaDuHiALCGPlEwk7Al7OuU-uT7OSuN7dGXeRo-HCOjlsSWoiAULKv3F0H1hZ-BstgEfvsejk1vwfxlqAxnHw47SJ64pN09wa2ZCJS8/s1600/hippo.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Hippo is again a powerful open-source CMS made in Java that features enterprise level capabilities that helps in delivering personalized websites and channels. Hippo outlines its competitor by delivering outstanding customer experience through innovative solutions. Hippo has come a long way since 1999 serving medium to large organizations by offering a personalized multichannel content distribution platform including website, mobile, tablet, extranets and intranets.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Its major version update was in December 2012 and since then it is seeing minor updates every couple of months.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="https://lenya.apache.org/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Apache Lenya</a></b><b>:</b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2JazS4BblzElvlY_HxuAXLLH9mbtWkNaFUVm1EEqOxlxHLWmpMmDP_BOk6XYVR2HAVme0cbAjvE2pk4inYjJuxANku7d_ahKLMgppUG5XD7rGhyphenhyphenHVGudFRf2aVOwWipKGfXZrClrIzFA/s1600/lenya.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Apache Lenya is another open-source Java CMS that features revision control , multisite management, scheduling, search, WYSIWYG editors, and workflow which makes website development and management quite interesting and easy for developers. Available in a variety of languages, Apache Lenya is highly preferred CMS among enterprises that desire to develop multi-lingual websites.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.contelligent.com/contell/cms/c1web/contelligent/site/index.html" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Contelligent</a></b><b>:</b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi68MhQobl4vAZr317y0G75tllKl3d9kbXqAVMNfhZC7T1jZ0P0pBtcZg9JX-RJiJAvWL4j-cs4YDbMCc3lV8m3l6pEOCJGRaLXi8cBM9m2EgIBGcH6xdrgARdqENQDqN-McSz86vqbaQY/s1600/contelligent.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Conteligent is another smart CMS solution offered under Java technology stack. It is fully compliant with J2EE and offers great solution for creating and managing personalized websites.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.infoglue.org/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">InfoGlue</a></b><b>:</b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFOu5uZhJYCaYOMbg6RdYtiyrCQHN3uZqJn5XQnpK5y7zWynxRZTnD9aau4M04_C2I_UdQFLpMQqvCj30eCkIODc-JFa_4Hyo7hix31m1oeX_u-fEnFDNv5CzI0vfyRc_lxcNw2-0bkDs/s1600/infoglue.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
InfoGlue again is a Java-based CMS that is known for its advanced, scalable and robust open-source architecture. It is a highly flexible CMS built on JSR-168 and comes with full multi-language support, excellent information reuse and high integration capabilities.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.openedit.org/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">OpenEdit</a></b><b>:</b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbNMciQxEMvc7bppTnzWYvFie9KVUth26np-Z8jqDJxDGHALDr7ZNZN-fqYxOCIqudNG3SUEq4fQ-w51AiTkpS2LfDRaDucm9zLZC3Flz04xX8AivaAOVYk4SefMO7Q7JEMPsgC7Ry3eE/s1600/openedit.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
OpenEdit CMS is a dynamic tool for managing website content with online editing capabilities. Built in open-source architecture, OpenEdit provides facilities like user manager, file manager, version control and notification tools for managing media-rich websites.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
OpenCMS features enterprise grade plugins such as eCommerce, Content Management, Blog, Events Calendar, Social Networking Tools and more.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://atleap.dev.java.net/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">AtLeap</a></b><b>:</b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkTCQrub4twKShq_BS-bj4cmhOTgcr0YxbmtLm8Yzfmc0Sf43cMNZGV7E5covopIHzNdrYH3Zs1jMvM9PuCnqfF0F4X0Aibre2vjolRl1Wcu_fJ-BSlxlljoUyjNo1kkSMqXeaCnupIxw/s1600/atleap.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Atleap is a multi-lingual CMS based on Java which offers amazing content delivery assistance with SEO and full text search functionalities. AtLeap, a product of Blandware, is not only a CMS but a highly robust framework for developing website and web applications</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.weceem.org/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Weceem</a></b><b>:</b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLUSCrkYmw7JlMrksZPRg17UKdx91qHx-oa3t_eq1jzrwjeDmY04AmmTvdlTFou__Fflp4_SwlCp8vnvcbqPbu8JHhDnHTpgeoNPY8BX37yX14Ab4MNYtR3jXnjAQouGMuq26ushiMW90/s1600/weecem.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Weceem is yet another open source content management system, unlikely other CMS it is built upon well-known Java framework grails, spring and Java itself. Weceem has garner positive reviews and is an ideal CMS when it comes to grails, but faces tough competition in best Java CMS category.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
I came across a LinkedIn discussion which was enough for me to put this CMS in the Best Java CMS list.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.nuxeo.com/en" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Nuxeo</a></b>: </div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPVl_CBSEx5Z7e-MEyfe7uRdq0nHl0gJJKA_1zFrem-cHPS7Qsw5rmIhHQh2tOp-bXRcDmOj8t_SmOj9kvMseYxfBGKvDbZOkbpQaowFpSEZiRfpqBL_MMQMVvxQhHReNpbK3oDk_wcio/s1600/nuexeo.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Nuxeno is a powerful open source CMS built on Java-based architecture. It offers solutions related to document management, case management and digital asset management. It is free from licensing free but do costs you when reach out for support and maintenance help.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
It has strong groups of customers including Electronic Arts, U.S. Navy and as stated on the company website, it’s been used in over 145 countries across thousands of organizations.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.xperiencentral.com/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">XperienCentral</a></b>: </div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU8VVZY7Z0tfTl57TKE2HfnwjWqMZv3ltRs7Jp733ycHO-kQ9wJBeR8s07d8ZZ08aGcnw6wq25IIwK54SHoIzD1XYKwPxWnCDxvvueGSIRS-CCs_V0qwzPeIdskfQLekz5LvSFCj2Alas/s1600/xperien.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Xperien central is currently the only CMS that offers unique content to a visitor as per his earlier journey, so you can tailor the content to increase the conversion. It offers multi-channel content delivery across website, mobile social media channels and applications. It is built on Java and hence it is extremely scalable and agile.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.atex.com/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Atex</a></b><b>: </b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho3C-oh93kv6duUnEJVYYMh9Yc6OWZZhSBrmoSdm6yrHY9FpoLt58p6pLksHi4whmm3mZJssWVCh8kh7uqwCjUBagYDvsKJW-3i_K_v8fDkG7efZOOqefk-tCljBLNYJk2uRW6z6UMoUQ/s1600/atex.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /><b><br /></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Atex is a web CMS that uses polopoly technology to deliver content. As per claims, it is the only industry leading CMS with built in paywall. Atex again is one of the premium CMS that offers amazing solutions for managing websites and helps marketers deliver the right content to relevant audiences. It has rich set of clientele.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<b><a href="http://www.escenic.com/" style="border: 0px; color: #20328e; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">Escenic</a></b></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlx8TwkNPLjm6hjaCG3ph_m6Lbig4X2kbtEqJU43GDHcnxZnA_JiORM-ITT1xU9eIlXDQJ5YfksjYX0xR70k73zMlAT3HQULoi9p9mPuiL3733usMfOvIgadAhUSOm3SBSbS99r7urPFU/s1600/escenic.png" style="border: 0px; font-family: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" /></div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Customers of escenic include News of the World, The Sun, The Times, the Independent titles. It’s a closed source Java framework.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
Both Atex and Escenic are found to be highly popular in Sweden. Some of the biggest sites in Sweden use both these CMS. idg.se uses Atex and Aftonbladet.se uses Escenic </div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
This completes the list 21 top Java-based content management system. Hope after reading about all the CMS, you have got enough inferences and insight as to which CMS would be best for your website development project.</div>
<br />
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; outline: 0px; padding: 0px; vertical-align: baseline;">
</div>
<br />
<div style="-webkit-text-stroke-width: 0px; background-color: white; border: 0px; color: #222222; font-family: Helvetica, arial, verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22px; margin-bottom: 1.2em; margin-top: 0.6em; orphans: auto; outline: 0px; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: auto; word-spacing: 0px;">
<div style="margin: 0px;">
<br /></div>
<div style="margin: 0px;">
<br /></div>
<div style="margin: 0px;">
<br /></div>
</div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-31840219637602711512013-12-27T11:45:00.003+05:302013-12-27T11:45:20.834+05:30Commonly Questions About Multi Threading<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div>
<br /></div>
<div>
<b style="background-color: white; font-family: verdana; font-size: small;">1. What is synchronisation in respect to multi-threading in Java?</b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">This is the power to control access to multiple threads to shared resources. Without proper synchronisation, one Java thread may modify a shared variable while another thread may still be using it. This would in turn lead to errors and glitches in a program.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">2. Explain different ways of using threads?</b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">Java threads can be implemented using runnable interfaces or by extending the thread class itself. Of the two methods, the runnable interface is considered to be more advantageous, when the programmer is going with multiple inheritance. </span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">3. Difference between Thread.start() & Thread.run() method?</b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">The thread.start() method is a native method that runs the thread.run() method. Calling the thread.run() method will execute it in the same thread, which defeats the purpose of creating a new thread. </span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">4. Why do we need run() & start() method both? Can it be achieved by only the run method?</b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">The run() and start() methods are both needed for the Java Virtual Machine (JVM) to create a separate thread that can not be differentiated from normal method calls. This is the task performed by the start() method, which has to be called explicitly. The other advantage of having these two methods is that the programmer can run any object as a thread if it is implementing a runnable interface. This solves the multiple inheritance problems that you may face with Java.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">5. What is ThreadLocal class? How can it be used?</b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">The following points about ThreadLocal variables should help:</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- This variable gives a separate copy of its value to each thread that is using it.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- These variable are usually static fields in the classes that want to work with the thread.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- When multiple threads access the instance, each gets its own copy of the variable.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- The ThreadLocal variable is often used in the DAO pattern. In this, the DAO class can be kept as a singleton, but the database connection can be maintained for each thread separately. This is called Per Thread Singleton.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">6. When InvalidMonitorStateException is thrown? Why?</b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">The InvalidMonitorStateException is thrown when the user tries to call the wait(), notify() or notifyAll() methods for an Object. The Object needs to call the method(s) from a place in the program where you do not have a lock on the object. This means that you do not have a synchronised block or method of the object but are still trying to call the notify(), wait() or notifyAll() methods. They all throw the same IllegalMonitorStateException exception. The exception is a subclass of the RuntimeException.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">7. What is the difference between sleep(), suspend() and wait()?</b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">The sleep() method takes the currently running thread to the Not Runnable state for a specified amount of time. A sleeping thread can not be entered by another thread and if a thread is running a synchronised block or method when it is put to sleep, then no other thread will be able to call this block or method either. A sleeping thread can be woken up by a thread calling t.interrupt on it. Sleep() will always affect the current thread since it is a static method.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">Suspend() on the other hand is a deprecated method. It sends a thread into suspended state, which means that it keeps all its monitors and can not be interrupted. It has been deprecated since it may cause deadlocks.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">The wait() method also puts the current thread into the Not Runnable mode but it is invoked on a locked object and not a thread.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">Here is the sequence of operations you can think</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- A thread X is running a synchronised block with a lock on object A</span><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- Another thread Y comes to execute the synchronized block and finds that it’s already acquired.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- Now Y calls A.wait() method for waiting on the lock to be released the X thread.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- X thread finishes all its synchronised block work.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- X thread calls A.notifyAll() to notify all waiting threads that its done using the lock.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- Since Y thread is first in the queue of waiting it acquires the lock and starts processing.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">8. What happens when a static method is made synchronised?</b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">When a thread enters a synchronised static method, the class itself will get locked by the thread monitor. This is because synchronised static methods have a lock on the class they are in. So, no other thread can enter the synchronised static methods in that class anymore. </span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">9. Can a thread call a non-synchronized instance method of an Object when a synchronised method is being executed?</b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">Yes, non synchronised instance methods can be called always and no lock object check is performed for such methods. In fact, the method is called even when it is not declared if you are working with shared data.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">That is why it is important to be careful while working with this. You declare a method as synchronised based on the critical section access. If a method does not access a critical section, then it doesn’t need to be a synchronised method.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">10. What is a deadlock?</b><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">If two or more threads have been blocked forever, they are said to be in a deadlock and waiting for each other. This usually happens when the two threads, each of which has a lock on one resource, tries to get a lock on the others’ resource. </span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">The most common causes are:</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- When two threads call Thread.join() on each other.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><span style="background-color: white; font-family: verdana; font-size: x-small;">- When two threads use nested synchronised blocks to lock two objects and the blocks lock the same objects in different order.</span></div>
<div>
<span style="background-color: white; font-family: verdana; font-size: x-small;"><br /></span></div>
<div>
<span style="background-color: white; font-family: verdana; font-size: x-small;"><br /></span></div>
</div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0tag:blogger.com,1999:blog-343405073344405294.post-2492483784789114332013-12-27T11:33:00.003+05:302013-12-27T11:33:36.818+05:30Most Wanted Tech 2014<div dir="ltr" style="text-align: left;" trbidi="on">
<b style="background-color: white; font-family: verdana; font-size: small;"><br /></b>
<b style="background-color: white; font-family: verdana; font-size: small;"><br /></b>
<b style="background-color: white; font-family: verdana; font-size: small;"><br /></b>
<b style="background-color: white; font-family: verdana; font-size: small;">1. Application development and Programmer:</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> According to the survey, 49 per cent of the respondents want to hire programmers and application developers in 2014. This skill was also the most coveted last year.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">2. Technical support or Help Desk:</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> Last year’s number three, takes the second position for 2014. 37 per cent of the respondents told ComputerWorld that they will be hiring people skilled in this department in 2014.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">3. Networking:</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> This has come up five steps since yesterday. 31 per cent of ComputerWorld’s respondents said that they would be hiring in this department, making this the third most coveted hiring option for 2014.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">4. Mobile applications and device management:</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> Another skill that came up by five spots. Mobile apps and device management skills would apparently receive hiring calls from 27 per cent of ComputerWorld’s respondents.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">5. Project Management:</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> 25 per cent of the companies want to hire personnel skilled in the project management department. The skill though has dropped three places and was placed at number two in 2013.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">6. Database Administration:</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> Database administration wasn’t even ranked last year, but this year it is the sixth most favoured job option. 24 per cent of the companies are looking for employees in this department.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">7. Security Compliance/Governance:</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> While security experts are on a roll in 2013, it seems that the skill won’t be quite as coveted in 2014. Still, it makes the seventh spot on the list with 21 per cent votes. Perhaps because the best have all been hired in 2013.</span><br style="background-color: white; font-family: verdana; font-size: small;" /><br style="background-color: white; font-family: verdana; font-size: small;" /><b style="background-color: white; font-family: verdana; font-size: small;">8. Business Intelligence/Analytics:</b><span style="background-color: white; font-family: verdana; font-size: x-small;"> This is the last one on ComputerWorld’s top eight list. 18 per cent of the companies said that they would hire personnel in this department. </span></div>
Subhhttp://www.blogger.com/profile/01117656371557591422noreply@blogger.com0