tag:blogger.com,1999:blog-82589304899363595752024-03-05T00:36:15.390-08:00thinker's worldJust sharing my experience.thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.comBlogger65125tag:blogger.com,1999:blog-8258930489936359575.post-9498162040718730082015-06-17T02:56:00.000-07:002015-06-17T02:56:42.897-07:00Kill Multiple Instances of a running process in single linux command<div dir="ltr" style="text-align: left;" trbidi="on">
Day to day activity of a developer involved to work with deployment machine . Therefore its good to know basic commands .<br />
<br />
Find process id's and kill them with single command :<br />
<br />
Suppose , one need to find out process id of running tomcat and kill those process .<br />
<br />
<pre class="java" name="code"> for pid in $(ps -ef | grep apache-tomcat-7.0.50 | awk '{print $2}'); do kill -9 $pid; done
</pre>
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-50851304795229084652015-03-30T08:53:00.000-07:002015-03-30T08:59:17.372-07:00Resolve Bangla Font Problem in Debian/Linux<div dir="ltr" style="text-align: left;" trbidi="on">
Simply use apt-get to get things working :<br />
<br />
<pre class="sql" name="code"> apt-get install fonts-beng </pre>
if you face dependency problem use :<br />
<br />
<pre class="sql" name="code">apt-get -f install
</pre>
<br />
finally :
<br />
<pre class="sql" name="code">apt-get install ttf-brngali-fonts
</pre>
restart your browser and see the effect , my case browser is firefox<br />
<br />
this works for me fine. <br />
<br />
<br /></div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-19234584553023491542014-06-29T04:36:00.001-07:002014-06-29T04:47:49.415-07:00Servlet Note<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Reference : Servlet Spec 3.0<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b>Basic :</b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">A
servlet is a Java™ technology-based Web component, managed by a container,</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">that generates
dynamic content.</span></div>
<div class="MsoNormal">
<i><span style="font-family: "Calibri","sans-serif"; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi; mso-hansi-theme-font: minor-latin;">Multipurpose Internet Mail
Extensions</span></i><span class="st"> (</span><i><span style="font-family: "Calibri","sans-serif"; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi; mso-hansi-theme-font: minor-latin;">MIME</span></i><span class="st">)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">In
functionality, servlets lie somewhere between Common Gateway Interface (CGI)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">programs
and proprietary server extensions such as the Netscape Server API</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">(NSAPI) or Apache
Modules.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">Servlet Interface</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The
</span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Servlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface is the central abstraction of
the Java Servlet API. All servlets</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">implement
this interface either directly, or more commonly, by extending a class that</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">implements
the interface. The two classes in the Java Servlet API that implement the</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Servlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface are </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">GenericServlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">and </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">HttpServlet</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">. For
most purposes,</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">Developers will
extend </span><span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">HttpServlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">to implement their servlets.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">Request Handling:</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The
basic </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Servlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface defines a </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">service
</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">method for handling client requests.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">This
method is called for each request that the servlet container routes to an
instance</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">of
a servlet.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The
handling of concurrent requests to a Web application generally requires that
the</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">Web
Developer design servlets that can deal with multiple threads executing within</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">the
</span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">service </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">method at a particular time.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">Generally
the Web container handles concurrent requests to the same servlet by</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">concurrent
execution of the </span><span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">service </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">method on different threads. <span style="mso-tab-count: 1;"> </span></span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">HTTP SPECIIC </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The
</span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">HttpServlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">abstract subclass adds additional methods
beyond the basic</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Servlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface that are automatically called by the </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">service
</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">method in the</span></div>
<div class="MsoNormal">
<span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">HttpServlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">class to aid in processing HTTP-based
requests. These methods are:</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">doGet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">for handling HTTP </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">GET </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">requests</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">doPost </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">for handling HTTP </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">POST </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">requests</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">doPut </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">for handling HTTP </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">PUT </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">requests</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">doDelete </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">for handling HTTP </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">DELETE </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">requests</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">doHead </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">for handling HTTP </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">HEAD </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">requests</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">doOptions </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">for handling HTTP </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">OPTIONS </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">requests</span></div>
<div class="MsoNormal">
<span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">doTrace </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">for handling HTTP </span><span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">TRACE </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">requests</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;"> </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;"> </span>
</div>
<div class="MsoNormal">
<span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">SingleThreadModel </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">Interface is deprecated in this version of
the specification.<span style="mso-spacerun: yes;"> </span>V3</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">Life Cycle </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">This
life cycle is expressed in the API by the </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">init</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">, </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">service</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">, and
</span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">destroy</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">methods
of the </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">javax.servlet.Servlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface that
all servlets must implement</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">directly or
indirectly through the </span><span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">GenericServlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">or </span><span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">HttpServlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">abstract classes.</span></div>
<span style="font-family: "Palatino-Roman","serif"; font-size: 16.0pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;"> </span>
<br />
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;"><b>Loading and Instantiation </b> </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The
servlet container is responsible for loading and instantiating servlets. The</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">loading
and instantiation can occur when the container is started, or delayed until</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">the container
determines the servlet is needed to service a request</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">After loading the
</span><span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">Servlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">class, the container instantiates it for use.</span></div>
<div class="MsoNormal">
<br /></div>
<b>Initialization</b><br />
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">After
the servlet object is instantiated, the container must initialize the servlet
before</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">it
can handle requests from clients. Initialization is provided so that a servlet
can</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">read
persistent configuration data, initialize costly resources (such as JDBC™ APIbased</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">connections),
and perform other one-time activities. The container initializes</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">the
servlet instance by calling the </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">init </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">method
of the </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Servlet </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface with a</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">unique
(per servlet declaration) object implementing the </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletConfig
</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">This
configuration object allows the servlet to access name-value initialization</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">parameters
from the Web application’s configuration information. The configuration</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">object
also gives the servlet access to an object (implementing the </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletContext</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface)
that describes the servlet’s runtime environment. See Chapter 4, “Servlet</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">Context” for more
information about the </span><span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">ServletContext </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">interface.</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;"> </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;"> </span>
</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">A
typical sequence of</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">events
for asynchronous processing is:</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">1.
The request is received and passed via normal filters for authentication etc.
to the</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">servlet.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">2.
The servlet processes the request parameters and/or content to determine the</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">nature
of the request.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">3.
The servlet issues requests for resources or data, for example, sends a remote
web</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">service
request or joins a queue waiting for a JDBC connection.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">4.
The servlet returns without generating a response.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">5.
After some time, the requested resource becomes available, the thread handling</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">that
event continues processing either in the same thread or by dispatching to a</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">resource in the
container using the </span><span style="font-family: Courier; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Courier;">AsyncContext</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<b><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">Request path elements</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The
request path that leads to a servlet servicing a request is composed of many</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">important
sections. The following elements are obtained from the request URI path</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">and
exposed via the request object:</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: ZapfDingbats; font-size: 6.0pt; mso-bidi-font-family: ZapfDingbats; mso-hansi-font-family: Palatino-Roman;">■ </span><b><span style="font-family: "Palatino-Bold","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Bold;">Context Path: </span></b><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The path prefix associated with the </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletContext
</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">that this</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">servlet
is a part of. If this context is the “default” context rooted at the base of
the</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">Web
server’s URL name space, this path will be an empty string. Otherwise, if the</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">context
is not rooted at the root of the server’s name space, the path starts with a</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 9.5pt; mso-bidi-font-family: Courier;">/ </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">character but does not end with a </span><span style="font-family: Courier; font-size: 9.5pt; mso-bidi-font-family: Courier;">/ </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">character.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: ZapfDingbats; font-size: 6.0pt; mso-bidi-font-family: ZapfDingbats; mso-hansi-font-family: Palatino-Roman;">■ </span><b><span style="font-family: "Palatino-Bold","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Bold;">Servlet Path: </span></b><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The path section that directly corresponds to the mapping which</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">activated
this request. This path starts with a ’</span><span style="font-family: Courier; font-size: 9.5pt; mso-bidi-font-family: Courier;">/</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">’ character except in the case</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">where
the request is matched with the ‘</span><span style="font-family: Courier; font-size: 9.5pt; mso-bidi-font-family: Courier;">/*</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">’ or ““ pattern, in which case it is an</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">empty
string.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: ZapfDingbats; font-size: 6.0pt; mso-bidi-font-family: ZapfDingbats; mso-hansi-font-family: Palatino-Roman;">■ </span><b><span style="font-family: "Palatino-Bold","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Bold;">PathInfo: </span></b><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The part of the request path that is not part of the Context
Path or the</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">Servlet
Path. It is either null if there is no extra path, or is a string with a
leading</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">‘/’.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The
following methods exist in the </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">HttpServletRequest </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface to access this</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">information:</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: ZapfDingbats; font-size: 6.0pt; mso-bidi-font-family: ZapfDingbats; mso-hansi-font-family: Palatino-Roman;">■ </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">getContextPath</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: ZapfDingbats; font-size: 6.0pt; mso-bidi-font-family: ZapfDingbats; mso-hansi-font-family: Palatino-Roman;">■ </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">getServletPath</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: ZapfDingbats; font-size: 6.0pt; mso-bidi-font-family: ZapfDingbats; mso-hansi-font-family: Palatino-Roman;">■ </span><span style="font-family: Courier; font-size: 9.5pt; mso-bidi-font-family: Courier;">getPathInfo</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">It
is important to note that, except for URL encoding differences between the
request</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">URI
and the path parts, the following equation is always true:</span></div>
<div class="MsoNormal">
<span style="font-family: Courier; font-size: 9.0pt; line-height: 115%; mso-bidi-font-family: Courier;">requestURI = contextPath + servletPath +
pathInfo</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">To give a few
examples to clarify the above points, consider the following:</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<b><span style="font-family: "Helvetica-Bold","sans-serif"; font-size: 7.0pt; mso-bidi-font-family: Helvetica-Bold;">TABLE 3-1 </span></b><span style="font-family: "Palatino-Roman","serif"; font-size: 9.0pt; mso-bidi-font-family: Palatino-Roman;">Example Context
Set Up</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Context Path /catalog</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Servlet Mapping
Pattern: /lawn/*</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Servlet: LawnServlet</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Servlet Mapping
Pattern: /garden/*</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Servlet: GardenServlet</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Servlet Mapping
Pattern: *.jsp</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">Servlet: JSPServlet</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<b><span style="font-family: "Helvetica-Bold","sans-serif"; font-size: 7.0pt; mso-bidi-font-family: Helvetica-Bold;">TABLE 3-2 </span></b><span style="font-family: "Palatino-Roman","serif"; font-size: 9.0pt; mso-bidi-font-family: Palatino-Roman;">Observed Path
Element Behavior</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<b><span style="font-family: "Helvetica-Bold","sans-serif"; font-size: 7.0pt; mso-bidi-font-family: Helvetica-Bold;">Request Path Path Elements</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">/catalog/lawn/index.html
ContextPath: /catalog</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletPath: /lawn</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">PathInfo: /index.html</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">/catalog/garden/implements/
ContextPath: /catalog</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletPath: /garden</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">PathInfo: /implements/</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">/catalog/help/feedback.jsp
ContextPath: /catalog</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletPath: /help/feedback.jsp</span></div>
<div class="MsoNormal">
<span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">PathInfo: null</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 20.0pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">Path Translation
Methods</span><span style="font-family: ZapfDingbats; font-size: 6.0pt; mso-bidi-font-family: ZapfDingbats;"> </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br />
<span style="font-family: ZapfDingbats; font-size: 6.0pt; mso-bidi-font-family: ZapfDingbats;">■ </span><span style="font-family: Courier; font-size: 9.5pt; mso-bidi-font-family: Courier; mso-fareast-font-family: ZapfDingbats;">ServletContext.getRealPath</span></div>
<div class="MsoNormal">
<span style="font-family: ZapfDingbats; font-size: 6.0pt; line-height: 115%; mso-bidi-font-family: ZapfDingbats;">■ </span><span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier; mso-fareast-font-family: ZapfDingbats;">HttpServletRequest.getPathTranslated</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;"><b>Servlet Context</b> </span><br />
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The
</span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletContext </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface defines a servlet’s view of the
Web application within</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">which the servlet
is running.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">A
</span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletContext </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">is rooted at a known path within a Web
server. For example, a</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">servlet
context could be located at </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">http://www.mycorp.com/catalog</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">. All requests</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">that
begin with the </span><span style="font-family: Courier; font-size: 9.5pt; mso-bidi-font-family: Courier;">/catalog </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">request
path, known as the </span><i><span style="font-family: "Palatino-Italic","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Italic;">context path</span></i><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">, are routed to</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">the Web
application associated with the </span><span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">ServletContext</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">Scope :</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">There
is one instance object of the </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletContext </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface associated with each</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">Web
application deployed into a container. In cases where the container is</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">distributed
over many virtual machines, a Web application will have an instance of</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">the </span><span style="font-family: Courier; font-size: 8.5pt; line-height: 115%; mso-bidi-font-family: Courier;">ServletContext </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">for
each JVM.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">Servlets
in a container that were not deployed as part of a Web application are</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">implicitly
part of a “default” Web application and have a default </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletContext</span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">. In</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">a
distributed container, the default </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletContext </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">is non-distributable and must</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">only exist in one
JVM.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">Servlet
contexts can</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">not be shared
across virtual hosts.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;"><b>Resources </b> </span><br />
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">The
</span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletContext </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface provides direct access only to
the hierarchy of static</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">content
documents that are part of the Web application, including HTML, GIF, and</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">JPEG
files, via the following methods of the </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">ServletContext </span><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">interface:</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: ZapfDingbats; font-size: 6.0pt; mso-bidi-font-family: ZapfDingbats; mso-hansi-font-family: Palatino-Roman;">■ </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">getResource</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: ZapfDingbats; font-size: 6.0pt; mso-bidi-font-family: ZapfDingbats; mso-hansi-font-family: Palatino-Roman;">■ </span><span style="font-family: Courier; font-size: 8.5pt; mso-bidi-font-family: Courier;">getResourceAsStream</span></div>
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">Filtering </span></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">Filters
are Java components that allow on the fly transformations of payload and</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; mso-bidi-font-family: Palatino-Roman;">header
information in both the request into a resource and the response from a</span></div>
<div class="MsoNormal">
<span style="font-family: "Palatino-Roman","serif"; font-size: 9.5pt; line-height: 115%; mso-bidi-font-family: Palatino-Roman;">resource</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-12274407151656217332014-04-27T03:07:00.002-07:002014-04-27T03:10:33.384-07:00Consume Web Service Using PL/SQL<div dir="ltr" style="text-align: left;" trbidi="on">
Script to create package :
<br />
<pre class="sql" name="code">create or replace
PACKAGE WS_SOAP_CLIENT
AS
FUNCTION SOAP_REQUEST_META(
l_host_name VARCHAR2,
l_string_request VARCHAR2)
RETURN VARCHAR2;
END WS_SOAP_CLIENT;
</pre>
Script to create package body :
<br />
<pre class="sql" name="code">create or replace
PACKAGE BODY WS_SOAP_CLIENT AS
FUNCTION SOAP_REQUEST_META(l_host_name VARCHAR2,
l_string_request VARCHAR2) RETURN VARCHAR2 IS
l_http_request UTL_HTTP.req;
l_http_response UTL_HTTP.resp;
l_buffer_size NUMBER(10) := 1024;
l_substring_msg VARCHAR2(2048);
l_raw_data RAW(2048);
l_clob_response CLOB;
total_xml VARCHAR2(16384);
BEGIN
UTL_HTTP.set_transfer_timeout(60);
l_http_request := UTL_HTTP.begin_request(url => 'http://' || l_host_name || '/example-service/endpoints/example.wsdl',
method => 'POST',
http_version => 'HTTP/1.1');
UTL_HTTP.set_header(l_http_request,
'User-Agent',
'Apache-HttpClient/4.1.1');
UTL_HTTP.set_header(l_http_request, 'Connection', 'Keep-Alive');
UTL_HTTP.set_header(l_http_request,
'Content-Type',
'text/xml;charset=UTF-8');
UTL_HTTP.set_header(l_http_request,
'Content-Length',
LENGTH(l_string_request));
<<request_loop>>
FOR i IN 0 .. CEIL(LENGTH(l_string_request) / l_buffer_size) - 1 LOOP
l_substring_msg := SUBSTR(l_string_request,
i * l_buffer_size + 1,
l_buffer_size);
BEGIN
l_raw_data := utl_raw.cast_to_raw(l_substring_msg);
UTL_HTTP.write_raw(r => l_http_request, data => l_raw_data);
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT request_loop;
END;
END LOOP request_loop;
l_http_response := UTL_HTTP.get_response(l_http_request);
BEGIN
<<response_loop>>
LOOP
UTL_HTTP.read_raw(l_http_response, l_raw_data, l_buffer_size);
l_clob_response := l_clob_response ||
UTL_RAW.cast_to_varchar2(l_raw_data);
END LOOP response_loop;
EXCEPTION
WHEN UTL_HTTP.end_of_body THEN
UTL_HTTP.end_response(l_http_response);
END;
IF (l_http_response.status_code = 200) OR (l_http_response.status_code = 500) then
total_xml := l_clob_response;
ELSE
RETURN 'N';
end if;
IF l_http_request.private_hndl IS NOT NULL THEN
UTL_HTTP.end_request(l_http_request);
END IF;
RETURN total_xml;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20001, SQLERRM);
END SOAP_REQUEST_META;
END WS_SOAP_CLIENT;
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-67402617779868967142014-04-27T02:46:00.002-07:002014-04-29T05:38:12.518-07:00PL/SQL Global Temporary Tables (GTT)<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;">
Sometimes we need to store data temporarily in a table . From Oracle 8i onward, we can manage temporary tables can be delegated to the server by using Global Temporary Tables.</div>
<ul style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;"></ul>
<h2 style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt;">
Creation of Global Temporary Tables</h2>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;">
The data in a global temporary table is private, such that data inserted by a session can only be accessed by that session.</div>
<blockquote style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;">
<pre style="background-color: #f2f1f2; border: 1px solid rgb(224, 224, 224); padding: 10px;">CREATE GLOBAL TEMPORARY TABLE temp_test_gtt (
column1 NUMBER,
column2 NUMBER
) ON COMMIT DELETE ROWS;</pre>
</blockquote>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;">
In contrast, the <code>ON COMMIT PRESERVE ROWS</code> clause indicates that rows should be preserved until the end of the session.</div>
<blockquote style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;">
<pre style="background-color: #f2f1f2; border: 1px solid rgb(224, 224, 224); padding: 10px;">CREATE GLOBAL TEMPORARY TABLE temp_test_gtt (
column1 NUMBER,
column2 NUMBER
) ON COMMIT PRESERVE ROWS;</pre>
</blockquote>
<h2 style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt;">
Other Features</h2>
<ul style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;">
<li>If the TRUNCATE statement is issued against a temporary table, only the session specific data is trucated. There is no affect on the data of other sessions.</li>
<li>Data in temporary tables is stored in temp segments in the temp tablespace.</li>
<li>Data in temporary tables is automatically deleted at the end of the database session, even if it ends abnormally.</li>
<li>Indexes can be created on temporary tables. The content of the index and the scope of the index is the same as the database session.</li>
<li>Views can be created against temporary tables and combinations of temporary and permanent tables.</li>
<li>Temporary tables can have triggers associated with them.</li>
<li>Export and Import utilities can be used to transfer the table definitions, but no data rows are processed.</li>
<li>Statistics on temporary tables are common to all sessions. Oracle 12c allows session specific statistics.</li>
<li>There are a number of restrictions related to temporary tables but these are version specific.</li>
</ul>
Reference : http://www.oracle-base.com/articles/misc/temporary-tables.php <br />
<ul style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;">
</ul>
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-83689008624485320682014-04-27T01:24:00.000-07:002014-04-27T01:25:05.829-07:00Connect to remote oracle database from Sql Developer / TOAD by Tunneling<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://en.wikipedia.org/wiki/Computer_network" title="Computer network">Computer networks</a> use a <b>tunneling protocol</b> when one <a class="mw-redirect" href="http://en.wikipedia.org/wiki/Network_protocol" title="Network protocol">network protocol</a> (the <b>delivery protocol</b>) <a href="http://en.wikipedia.org/wiki/Encapsulation_%28networking%29" title="Encapsulation (networking)">encapsulates</a> a different <a href="http://en.wikipedia.org/wiki/IP_Payload_Compression_Protocol" title="IP Payload Compression Protocol">payload protocol</a>.
By using tunneling one can (for example) carry a payload over an
incompatible delivery-network, or provide a secure path through an
untrusted network.<br />
<b>Tunneling</b> typically contrasts with a layered protocol model such as those of <a href="http://en.wikipedia.org/wiki/Open_Systems_Interconnection" title="Open Systems Interconnection">OSI</a> or <a class="mw-redirect" href="http://en.wikipedia.org/wiki/TCP/IP" title="TCP/IP">TCP/IP</a>.
Typically, the delivery protocol operates at an equal or higher level
in the model than does the payload protocol, or at the same level.<br />
To understand a particular protocol stack, network engineers must understand both the payload and delivery protocol sets.<br />
As an example of network layer over network layer, <a href="http://en.wikipedia.org/wiki/Generic_Routing_Encapsulation" title="Generic Routing Encapsulation">Generic Routing Encapsulation</a> (GRE), a protocol running over IP (<a class="mw-redirect" href="http://en.wikipedia.org/wiki/IP_protocol" title="IP protocol">IP Protocol Number</a> 47), often serves to carry IP packets, with <a class="external mw-magiclink-rfc" href="http://tools.ietf.org/html/rfc1918" rel="nofollow">RFC 1918</a>
private addresses, over the Internet using delivery packets with public
IP addresses. In this case, the delivery and payload protocols are
compatible, but the payload addresses are incompatible with those of the
delivery network.<br />
In contrast, an IP payload might believe it sees a data link layer delivery when it is carried inside the <a href="http://en.wikipedia.org/wiki/Layer_2_Tunneling_Protocol" title="Layer 2 Tunneling Protocol">Layer 2 Tunneling Protocol</a> (L2TP), which appears to the payload mechanism as a protocol of the <a href="http://en.wikipedia.org/wiki/Data_link_layer" title="Data link layer">data link layer</a>. L2TP, however, actually runs over the transport layer using <a href="http://en.wikipedia.org/wiki/User_Datagram_Protocol" title="User Datagram Protocol">User Datagram Protocol</a> (UDP) over IP. The IP in the delivery protocol could run over any data-link protocol from <a href="http://en.wikipedia.org/wiki/IEEE_802.2" title="IEEE 802.2">IEEE 802.2</a> over <a href="http://en.wikipedia.org/wiki/IEEE_802.3" title="IEEE 802.3">IEEE 802.3</a> (i.e., standards-based <a href="http://en.wikipedia.org/wiki/Ethernet" title="Ethernet">Ethernet</a>) to the <a href="http://en.wikipedia.org/wiki/Point-to-Point_Protocol" title="Point-to-Point Protocol">Point-to-Point Protocol</a> (PPP) over a dialup modem link.<br />
Tunneling protocols may use data encryption to transport insecure
payload protocols over a public network (such as the Internet), thereby
providing <a class="mw-redirect" href="http://en.wikipedia.org/wiki/VPN" title="VPN">VPN</a> functionality. <a href="http://en.wikipedia.org/wiki/IPsec" title="IPsec">IPsec</a> has an end-to-end Transport Mode, but can also operate in a tunneling mode through a trusted security gateway.<br />
<br />
<br />
A secure shell (SSH) tunnel consists of an encrypted tunnel created through an <a href="http://en.wikipedia.org/wiki/Secure_Shell" title="Secure Shell">SSH protocol</a> connection. Users may set up SSH tunnels to transfer <a class="mw-redirect" href="http://en.wikipedia.org/wiki/Unencrypted" title="Unencrypted">unencrypted</a> traffic over a network through an <a class="mw-redirect" href="http://en.wikipedia.org/wiki/Encrypted" title="Encrypted">encrypted</a> channel. For example, Microsoft Windows machines can share files using the <a href="http://en.wikipedia.org/wiki/Server_Message_Block" title="Server Message Block">Server Message Block</a>
(SMB) protocol, a non-encrypted protocol. If one were to mount a
Microsoft Windows file-system remotely through the Internet, someone
snooping on the connection could see transferred files. To mount the
Windows file-system securely, one can establish a SSH tunnel that routes
all SMB traffic to the remote fileserver through an encrypted channel.
Even though the SMB protocol itself contains no encryption, the
encrypted SSH channel through which it travels offers security.<br />
<div class="thumb tright">
<div class="thumbinner" style="width: 222px;">
<a class="image" href="http://en.wikipedia.org/wiki/File:Reverse_ssh_tunnel.jpg"><img alt="" class="thumbimage" data-file-height="353" data-file-width="956" height="81" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Reverse_ssh_tunnel.jpg/220px-Reverse_ssh_tunnel.jpg" width="220" /></a>
<div class="thumbcaption">
<div class="magnify">
<a class="internal" href="http://en.wikipedia.org/wiki/File:Reverse_ssh_tunnel.jpg" title="Enlarge"><img alt="" height="11" src="http://bits.wikimedia.org/static-1.24wmf1/skins/common/images/magnify-clip.png" width="15" /></a></div>
Reverse ssh tunnel</div>
</div>
</div>
To set up an SSH tunnel, one configures an SSH client to <a href="http://en.wikipedia.org/wiki/Port_forwarding" title="Port forwarding">forward</a>
a specified local port to a port on the remote machine. Once the SSH
tunnel has been established, the user can connect to the specified local
port to access the network service. The local port need not have the
same port number as the remote port.<br />
SSH tunnels provide a means to bypass <a href="http://en.wikipedia.org/wiki/Firewall_%28computing%29" title="Firewall (computing)">firewalls</a>
that prohibit certain Internet services — so long as a site allows
outgoing connections. For example, an organization may prohibit a user
from accessing Internet web pages (port 80) directly without passing
through the organization's <a class="mw-redirect" href="http://en.wikipedia.org/wiki/Proxy_filter" title="Proxy filter">proxy filter</a>
(which provides the organization with a means of monitoring and
controlling what the user sees through the web). But users may not wish
to have their web traffic monitored or blocked by the organization's
proxy filter. If users can connect to an external SSH <a href="http://en.wikipedia.org/wiki/Server_%28computing%29" title="Server (computing)">server</a>,
they can create a SSH tunnel to forward a given port on their local
machine to port 80 on a remote web-server. To access the remote
web-server, users would point their <a href="http://en.wikipedia.org/wiki/Web_browser" title="Web browser">browser</a> to the local port at http://localhost/.<br />
Some SSH clients support dynamic <a href="http://en.wikipedia.org/wiki/Port_forwarding" title="Port forwarding">port forwarding</a> that allows the user to create a <a href="http://en.wikipedia.org/wiki/SOCKS" title="SOCKS">SOCKS</a>
4/5 proxy. In this case users can configure their applications to use
their local SOCKS proxy server. This gives more flexibility than
creating a SSH tunnel to a single port as previously described. SOCKS
can free the user from the limitations of connecting only to a
predefined remote port and server. If an application doesn't support
SOCKS, one can use a "socksifier" to redirect the application to the
local SOCKS proxy server. Some "socksifiers", such as Proxycap, support
SSH directly, thus avoiding the need for a SSH client.<br />
<br />
Reference : http://en.wikipedia.org/wiki/Tunneling_protocol<br />
<br />
Practical Situation :<br />
Suppose your machine IP is : A and you have access to server B but not in server C . But , you can connect to server C from server B .<br />
<br />
Now , you want to connect your local sql developer to oracle server which is in C through B.<br />
<br />
Download Putty (http://www.putty.org/)<br />
<br />
open it and you will find something like :<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBxYIe2k7TDB07z-Af20vfjba-Khd3g92YV_xdQNJOFRoLnzsKG9NVNsccTxclcp4uVJWerW4J_uYTKkON2Gq5CKEUVFLuOCZAddPt_L_UwTDt1r9ZICl9MendHc3qn-_4mTYWQV19fpcW/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBxYIe2k7TDB07z-Af20vfjba-Khd3g92YV_xdQNJOFRoLnzsKG9NVNsccTxclcp4uVJWerW4J_uYTKkON2Gq5CKEUVFLuOCZAddPt_L_UwTDt1r9ZICl9MendHc3qn-_4mTYWQV19fpcW/s1600/1.png" height="295" width="320" /></a></div>
<br />
<br />
<br />
<br />
Now , in read marked section put machine address or ip address of server B .<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC2jhv0Fu6MLPLnDTgk1H8o9AZ4iL2lQsbOf2Z9PCVPVdQ9Dv9w3hWVzHmi8FVy4DM16hoEQYMVLSfUygJ6DnEveURtWHRq1GecsDOW0AA0qmKQzsWcOZ8BPzElQDHBjjwBOwZltUBxA1U/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC2jhv0Fu6MLPLnDTgk1H8o9AZ4iL2lQsbOf2Z9PCVPVdQ9Dv9w3hWVzHmi8FVy4DM16hoEQYMVLSfUygJ6DnEveURtWHRq1GecsDOW0AA0qmKQzsWcOZ8BPzElQDHBjjwBOwZltUBxA1U/s1600/2.png" height="303" width="320" /></a></div>
<br />
<br />
<br />
Now , take a look to left section of the window and select Tunnels , after that check the read box which will allow local port to connect to other host .In source port put any custom port and in Destination put remote machine / server ip or as example ip of machine C with oracle port , Example : 10.20.20.21:1521 and click add button .<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxPBvo4IYA5t7wwjl5PJJiTUjWT-8vlkwqzO9itZr1ZJVPulCFQ_Re2OLK_fA-zoP3l8vyf7B4AsoByxznguUAsUniiqeeVLbPjncT5z_4qkm-jcAdui72_ey38vAoZ5OzxOIhCHtAPDpJ/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxPBvo4IYA5t7wwjl5PJJiTUjWT-8vlkwqzO9itZr1ZJVPulCFQ_Re2OLK_fA-zoP3l8vyf7B4AsoByxznguUAsUniiqeeVLbPjncT5z_4qkm-jcAdui72_ey38vAoZ5OzxOIhCHtAPDpJ/s1600/3.png" height="304" width="320" /></a></div>
Now, you are ready to open the session , click to session section and click to open :<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizaKaVw_0dFI6KCgEsgT4afru3bInZRXPCWCVZ2kZH6B4Ffaftb5swXw5g__SmKcuZI_8WTtqUc4nzkUW_Otv-3PBZ9nGTS8yereQnqNjikWOAe_NRIFIiD0R_wd8oRtJv-IsPar6yAL8P/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizaKaVw_0dFI6KCgEsgT4afru3bInZRXPCWCVZ2kZH6B4Ffaftb5swXw5g__SmKcuZI_8WTtqUc4nzkUW_Otv-3PBZ9nGTS8yereQnqNjikWOAe_NRIFIiD0R_wd8oRtJv-IsPar6yAL8P/s1600/6.png" height="300" width="320" /></a></div>
<br />
now , a command window will open , now log in to server B with your user name and password , this will open the required session and tunnel for us as configured before,and you are ready to connect your SQL developer with remote oracle namely in server C .<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqgzXYSeYd1m7Z8rZQOSNeD92-OmBFPKb4DTbQEMYh37yFu118ow84Lc-XTxJLUctn8JaVHLaXWKuAeBO7BPwkVZmQhXHFY2DnjanaEHo9-FyHHr_2PkZiEfrQ8vwQkqwdOKl7boO7r159/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqgzXYSeYd1m7Z8rZQOSNeD92-OmBFPKb4DTbQEMYh37yFu118ow84Lc-XTxJLUctn8JaVHLaXWKuAeBO7BPwkVZmQhXHFY2DnjanaEHo9-FyHHr_2PkZiEfrQ8vwQkqwdOKl7boO7r159/s1600/4.png" height="198" width="320" /></a></div>
<br />
<br />
<br />
<br />
Now, open sql server and put user name , password of remote oracle server .<br />
In hostname put : localhost<br />
In port number : source port as given earlier<br />
In SID : SID of remote oracle<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsCep5ZO3NkvEvgWImOO_ZttDRmhc5t5Gc6hbDfuvuXtER1KeVE0pu5fDhb6fL_-SnHTvNzxZtJswKuJLrKfZjm7h0GK0ISyLbqrig2cOOEivRmE-mtZand3i2Q6kc1d1aO_B9ocQMArVe/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsCep5ZO3NkvEvgWImOO_ZttDRmhc5t5Gc6hbDfuvuXtER1KeVE0pu5fDhb6fL_-SnHTvNzxZtJswKuJLrKfZjm7h0GK0ISyLbqrig2cOOEivRmE-mtZand3i2Q6kc1d1aO_B9ocQMArVe/s1600/5.png" height="135" width="320" /></a></div>
<br />
<br />
<br />
<br />
<br />
Finally click to connect . If you configure everything as above you will get connected to remote oracle server from your local machine . Good Luck .<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com1tag:blogger.com,1999:blog-8258930489936359575.post-80681933018256904312014-03-13T01:57:00.000-07:002014-03-13T02:00:58.350-07:00DBMS Network ACL of HTTP call using UTL_HTTP in oracle<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;">Oracle allows access to external network services using several PL/SQL APIs (</span><code style="background-color: white; font-size: 13px;">UTL_TCP</code><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;">, </span><code style="background-color: white; font-size: 13px;">UTL_SMTP</code><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;">, </span><code style="background-color: white; font-size: 13px;">UTL_MAIL</code><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;">, </span><code style="background-color: white; font-size: 13px;">UTL_HTTP</code><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"> and </span><code style="background-color: white; font-size: 13px;">UTL_INADDR</code><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;">), all of which are implemented using the TCP protocol. In previous versions of the database, access to external services was effectively an on/off switch based on whether a user was granted execute permissions on a specific package or not. Oracle 11g introduces fine grained access to network services using access control lists (ACL) in the XML DB repository, allowing control over which users access which network resources, regardless of package grants.</span><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"><br /></span>
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;">Access control lists are manipulated using the </span><code style="background-color: white; font-size: 13px;">DBMS_NETWORK_ACL_ADMIN</code><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"> package. </span><a href="http://www.oracle-base.com/articles/11g/fine-grained-access-to-network-services-11gr1.php" style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;" target="_blank">reference</a><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><span style="background-color: white;"><b>Scripts :</b></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><span style="background-color: white;"><b><br /></b></span></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><span style="background-color: white;"><br /></span></span>
<br />
<pre class="xml" name="code">begin
dbms_network_acl_admin.create_acl (
acl => 'networkacl.xml',
description => 'Allow Network Connectivity',
principal => 'PUBLIC',
is_grant => TRUE,
privilege => 'connect',
start_date => SYSTIMESTAMP,
end_date => NULL);
dbms_network_acl_admin.assign_acl (
acl => 'networkacl.xml',
host => '*',
lower_port => NULL,
upper_port => NULL);
commit;
end;
</pre>
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-77875961591925598762013-12-02T03:59:00.000-08:002013-12-02T04:02:28.196-08:00Parse SOAP Message Using PL/SQL<div dir="ltr" style="text-align: left;" trbidi="on">
Suppose we want to parse bellow SOAP message :<br />
<pre class="xml" name="code"><soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:header>
<soap-env:body>
<soap-env:fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring xml:lang="en">The security token could not be authenticated or authorized; nested exception is org.apache.ws.security.WSSecurityException: The security token could not be authenticated or authorized</faultstring>
</soap-env:fault>
</soap-env:body>
</soap-env:header></soap-env:envelope>
</pre>
To parse this SOAP we can write script like :
<br />
<pre class="sql" name="code">CREATE TABLE XMLMESSAGE(
message XMLTYPE
serial number,
)
--before running bellow script insert the message in previously created table
select atts.faultcode,atts.faultstring
from XMLMESSAGE,
xmltable(xmlnamespaces('http://schemas.xmlsoap.org/soap/envelope/' as
"SOAP-ENV"
),
'/SOAP-ENV:Envelope/SOAP-ENV:Body/SOAP-ENV:Fault'
passing XMLMESSAGE.MESSAGE columns
faultcode varchar2(1000) path ''faultcode',
faultstring varchar2(1000) path ''faultstring'
) atts where serial = 1;
</pre>
<br /></div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-35566984849908508552013-11-30T02:26:00.002-08:002013-11-30T02:27:11.190-08:00PL/SQL Custom Exception Handaling<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<pre class="sql" name="code">DECLARE
v_Return VARCHAR2(5000);
custom_exception EXCEPTION;
BEGIN
v_Return := 'A';
IF v_Return = 'A' THEN
RAISE custom_exception;
END IF;
EXCEPTION
WHEN custom_exception THEN
DBMS_OUTPUT.PUT_LINE('error');
END;
</pre>
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-29147060330438020322013-11-28T03:10:00.004-08:002013-11-28T03:22:09.823-08:00Script to Create PL/SQL Pakcgage<div dir="ltr" style="text-align: left;" trbidi="on">
Creating pl/sql package has two simple step . First create package name and needed function/procedure declaration .<br />
<pre class="sql" name="code">
CREATE OR REPLACE PACKAGE XML_PARSER AS
FUNCTION PARSE_ACCOUNT_INFO RETURN VARCHAR2;
END XML_PARSER;
/
</pre>
Second Step : Creating package body with actual implementation of function/procedure previously defined in creation of package.
<pre class="sql" name="code">
CREATE OR REPLACE PACKAGE BODY XML_PARSER AS
FUNCTION PARSE_ACCOUNT_INFO RETURN VARCHAR2 IS
TEMP VARCHAR2(10);
BEGIN
NULL;
END;
END XML_PARSER;
/
</pre>
<br /></div>thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-17400566201493082062013-11-18T21:51:00.001-08:002015-08-11T23:38:00.788-07:00The TCS Story and Beyond<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
<span class="boldtext" style="border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Author:</span> <a href="http://www.flipkart.com/author/s-ramadorai" style="border: 0px; color: #666666; cursor: pointer; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">S. Ramadorai</a></div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
<span class="boldtext" style="border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Publisher:</span> Portfolio (2013) </div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
On the last moment before leaving chennai of my official visit to there i bough this book , but my traveler mate take the book for reading in flight . Very next day i started reading the book .<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br /></div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
Experience after reading 30 page : I was mad to complete the book.</div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
Whatever ! content of this book is based on real life experience of a CEO who joined in a small growing company at India while has had good opportunity at west with good salary . He joined and finally retired as a CEO of that company and along this long journey that company became one of the large IT enabled service provider in market.</div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
What one can find this book :</div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
A young job seeker will know about the right decision about job and getting married and taking challenges.</div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
A young engineer will know how to interact with potential clients and adopt new technology.</div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
Its a must read book for any new entrepreneur.</div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
A must book read book for software engineer .</div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
The story of IT market expansion and adoption of new technology and solution are represented here with beauty.</div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
One can find design strategy and industry collaboration effect and impotence of R&D in every sector of technology and business towards progress.</div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div class="secondary-info" style="background-color: white; border: 0px; color: #848484; font-family: arial, tahoma, verdana, sans-serif; font-size: 13px; line-height: 20px; margin: 0px; padding: 0px; vertical-align: baseline;">
</div>
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-22728019178145147642013-11-18T21:11:00.003-08:002013-11-18T21:25:53.457-08:00Create New Schema in Oracle <div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
<b>Step One : Create Table Space</b></h3>
<br />
<pre class="sql" name="code" style="text-align: left;">CREATE TABLESPACE SPR_DATA DATAFILE
'location in local hard disk\SPR_DATA_01.DBF'
SIZE 1000M EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE
MANAGEMENT AUTO;
</pre>
<h3 style="text-align: left;">
<span style="font-family: 'Times New Roman'; white-space: normal;">Step Two: Create User</span></h3>
<pre class="java" name="code" style="text-align: left;">CREATE USER sprora IDENTIFIED BY "sprora" DEFAULT TABLESPACE SPR_DATE;
</pre>
<h3 style="text-align: left;">
<span style="font-family: 'Times New Roman'; white-space: normal;">Step Three: Giving Permission</span></h3>
<pre class="sql" name="code" style="text-align: left;">GRANT CONNECT TO sprora;
ALTER USER SPRORA QUOTA UNLIMITED ON SPR_DATA;
GRANT CREATE TABLE TO SPRORA;
GRANT DBA TO SPRORA;
GRANT CREATE SESSION,CREATE TABLE,CREATE SEQUENCE,CREATE VIEW TO sprora;
GRANT EXECUTE ON DBMS_SQLHASH TO sprora;
GRANT EXECUTE ON DBMS_LOCK TO sprora;
GRANT DEBUG CONNECT SESSION TO sprora;
GRANT DEBUG ANY PROCEDURE TO sprora;
</pre>
<h3 style="text-align: left;">
<span style="font-family: 'Times New Roman'; white-space: normal;">Step Four: Connect as new user and create test table</span></h3>
<pre class="sql" name="code">CONNECT sprora/sprora
CREATE TABLE TEST (CITY varchar2(32), POPULATION number);
INSERT INTO TEST (CITY, POPULATION) values ('edmonton', 10);
INSERT INTO TEST (CITY, POPULATION) values ('vancouver', 20);
COMMIT;
</pre>
Now test newly created table using select query :
<br />
<pre class="sql" name="code">SELECT * FROM TEST
</pre>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2JIrZ2oncCO0S7QnA_BS1cbh8XE_Y51_zqhNaOvjB-znOPeI5T81ziLsv2SPYvveR9y_fyLjCrP-ZqU3c-0ZAMV3EAlvy-ckpHhyU4q05Pp_zdO6kMKr7aFFVTaS_gx0JLsW1uq2nHURY/s1600/select.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2JIrZ2oncCO0S7QnA_BS1cbh8XE_Y51_zqhNaOvjB-znOPeI5T81ziLsv2SPYvveR9y_fyLjCrP-ZqU3c-0ZAMV3EAlvy-ckpHhyU4q05Pp_zdO6kMKr7aFFVTaS_gx0JLsW1uq2nHURY/s400/select.png" width="400" /></a></div>
<br /></div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-9481834822081048232013-07-03T00:14:00.000-07:002013-07-08T02:32:38.283-07:00Writing Resume for Software Company <div dir="ltr" style="text-align: left;" trbidi="on">
Fresh graduate has to write resume to represent himself/herself as a potential candidate for a job. Initially it seems a easy task to do , yes it is easy in terms of typing in a key board by enough tricky.<br />
<br />
To Do or Not To Do :<br />
-Write your objective as simple as possible , i recommend one - two lines .<br />
-Must use formal English and use simple words.<br />
-Do not put your personal information : such as --- race , moms name etc.<br />
-Focus on your achievement rather responsibility in previous position<br />
-Put only those technical skill you know properly , never put something super special but you have no idea with that.<br />
-Highlight your academic performance.<br />
-In top : Write name , address and contact number properly<br />
-Two page is enough to represent you , may up to three page , but not more then that . All are busy in these day they don't have much time to read your long story .<br />
-Always use PDF format while sending resume.-Send your resume to your known ones and ask for review and comments on that , this will help you to overcome silly mistake.<br />
-Hey! you resume if not a polish diamond , share it with others , don't be poor minded.<br />
-Highlight research experience , if you have any but not mandatory .<br />
-<br />
<br />
<br />
<br /></div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-85126198582426412072013-07-01T05:21:00.000-07:002013-07-01T05:23:58.441-07:00Example of Advanced Encryption Standard (AES) using JAVA<div dir="ltr" style="text-align: left;" trbidi="on">
Example of <a href="https://en.wikipedia.org/wiki/Advanced_Encryption_Standard" target="_blank">AES</a> using JAVA :
<br />
<br />
<span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">Note : For base64 related method </span><a href="http://gonithethinker.blogspot.com/2013/07/convert-base64-to-byte-and-byte-to.html" style="background-color: white; color: #888888; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none;" target="_blank">visit this post</a><span style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;">.</span></span><br />
<pre class="java" name="code">import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.SecureRandom;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
/**
*
* @author : ThinkTank
*
*
*/
public class AESEncryption {
private KeyGenerator keyGenerator;
private SecureRandom secureRandom;
private byte[] randomBytes = new byte[100];
private byte[] encryptedData = new byte[20000];
private byte[] decryptedData = new byte[20000];
private String encryptedDataAsBase64String;
private SecretKey secretKey;
private SecretKeySpec secretKeySpec;
private Cipher cipher;
private String originalData;
/**
* This method will encrypt data as our desired level
*
* @param data data to be encrypted
* @param encryptionLevel level of encryption
* @param secureRandomSeed seed value
* @return encrypted string
*/
public String encrypt(byte[] data,int encryptionLevel,int secureRandomSeed) {
try {
keyGenerator = KeyGenerator.getInstance("AES");
keyGenerator.init(encryptionLevel);
secureRandom = SecureRandom.getInstance("SHA1PRNG", "SUN");
secureRandom.setSeed(secureRandomSeed);
secureRandom.nextBytes(randomBytes);
secretKey = keyGenerator.generateKey();
byte[] primaryEncodedKey = secretKey.getEncoded();
secretKeySpec = new SecretKeySpec(primaryEncodedKey, "AES");
cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
encryptedData = cipher.doFinal(data);
encryptedDataAsBase64String = Util.byteToBase64(encryptedData);
} catch (NoSuchProviderException e) {
e.getStackTrace();
} catch (NoSuchAlgorithmException e) {
e.getStackTrace();
} catch (NoSuchPaddingException e) {
e.getStackTrace();
} catch (InvalidKeyException e) {
e.getStackTrace();
} catch (BadPaddingException e) {
e.getStackTrace();
} catch (IllegalBlockSizeException e) {
e.getStackTrace();
}
return encryptedDataAsBase64String;
}
/**
* This method will return decrypted data
*
* @return decrypted data as string
*/
public String decrypt(byte[] encryptedData) {
try {
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
decryptedData = cipher.doFinal(encryptedData);
originalData = new String(decryptedData);
} catch (InvalidKeyException e) {
e.getStackTrace();
} catch (IllegalBlockSizeException e) {
e.getStackTrace();
} catch (BadPaddingException e) {
e.getStackTrace();
}
return originalData;
}
}
</pre>
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-49416198788371684272013-07-01T05:06:00.002-07:002013-07-01T05:10:05.426-07:00Ready to use One way Digest util class in JAVA or Example of SHA-512 Digest Using Java <div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
Ready to use One way digest Java Class<br />
<br />
<br />
Note : For base64 related method <a href="http://gonithethinker.blogspot.com/2013/07/convert-base64-to-byte-and-byte-to.html" target="_blank">visit this post</a> :<br />
<br />
<br /></div>
<pre class="java" name="code">import java.security.MessageDigest;
import java.security.SecureRandom;
/**
*
* @author : ThinkTank
*
*/
public class PasswordDigest {
/**
* This method will compute hash as string for given password
*
* @param salt salt value
* @param passDigest password digest
* @param password password which will digested
* @param iterationNumber number of iteration
* @return password hash value
* @throws Exception
*/
public static String recomputeHash(byte[] salt, String passDigest,String password,int iterationNumber) throws Exception {
byte regeneratedHash[] = PasswordDigest.getHash(iterationNumber, password, salt);
return Util.byteToBase64(regeneratedHash);
}
/**
* @param iterationNumber
* @param password
* @param salt
* @return hash digest as byte array
* @throws Exception
*/
public static byte[] getHash(int iterationNumber, String password, byte[] salt) throws Exception {
MessageDigest digest = MessageDigest.getInstance("SHA-512");
digest.reset();
digest.update(salt);
byte[] input = digest.digest(password.getBytes("UTF-8"));
for (int i = 0; i < iterationNumber; i++) {
digest.reset();
input = digest.digest(input);
}
return input;
}
/**
* This method will generate salt value and return it as byte array
*
* @return salt value as byte array
* @throws Exception
*/
public static byte[] getSalt() throws Exception {
SecureRandom secureRandom;
byte[] bSalt = new byte[8];
secureRandom = SecureRandom.getInstance("SHA1PRNG","SUN");
secureRandom.nextBytes(bSalt);
return bSalt;
}
}
</pre>
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-47506295004018552752013-07-01T04:53:00.002-07:002013-07-01T05:07:16.184-07:00Convert Base64 to Byte and Byte to Base64 in Java<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Simple Ready to use utility class to convert : base64 -> byte and byte -> base64
<br />
<pre class="java" name="code">import org.apache.commons.codec.binary.Base64;
public class Util {
/**
*
* This method take base64 type string as input and
* convert it to byte[] array
*
* @param data base64 type string
* @return byte array
* @throws Exception
*
*/
@SuppressWarnings("unused")
public static byte[] base64ToByte(String data) throws Exception {
Base64 base64 = new Base64();
return Base64.decodeBase64(data);
}
/**
* This method take byte array as input and
* convert it to base64 string
*
* @param data byte array
* @return base64 string
*
*/
@SuppressWarnings("static-access")
public static String byteToBase64(byte[] data) {
Base64 base64 = new Base64();
return base64.encodeBase64String(data);
}
}
</pre>
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-72644875644552624192013-05-18T09:03:00.002-07:002013-05-18T09:49:58.746-07:00New Date & Time API in JDK8<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<span style="font-family: 'Bitstream Vera Sans', 'Luxi Sans', Verdana, Arial, Helvetica; font-size: 13px; line-height: 15px;">The existing Java date and time classes are poor, mutable, and have unpredictable performance. There has been a long-standing desire for a better date and time API based on the Joda-Time project. The new API will have a more intuitive design allowing code to better express its intent. The classes will also be immutable which aligns with the multi-core direction of the industry.</span></div>
<div>
<br /></div>
<pre class="java" name="code">package com.lambada.practice;
import java.time.Clock;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZoneId;
public class EarlyReleaseDemo {
public static void main (String [] args) {
new EarlyReleaseDemo().dataAndTimeAPI();
}
public void dataAndTimeAPI() {
Clock clock = Clock.systemUTC();
System.out.println("Current time in milisecond : " +clock.millis());
LocalDate date = LocalDate.now();
LocalTime localTime = LocalTime.now();
ZoneId zoneId = ZoneId.systemDefault();
//console output
System.out.println("Current Time : " +localTime);
System.out.println("Current Hour : " +localTime.getHour());
System.out.println("Current Min. : " +localTime.getMinute());
System.out.println("Current Second : " +localTime.getSecond());
System.out.println("Todays date : " +date);
System.out.println("Year : "+date.getYear());
System.out.println("Month Value : "+date.getMonthValue());
System.out.println("Month :"+date.getMonth());
System.out.println("Day of Month :"+date.getDayOfMonth());
System.out.println("Day of year : "+date.getDayOfYear());
System.out.println("System default zone : " +zoneId.normalized());
System.out.println("Available Zone Id's :" + zoneId.getAvailableZoneIds());
}
}
//output
Current time in milisecond : 1368893133938
Current Time : 22:05:34.048
Current Hour : 22
Current Min. : 5
Current Second : 34
Todays date : 2013-05-18
Year : 2013
Month Value : 5
Month :MAY
Day of Month :18
Day of year : 138
System default zone : Asia/Almaty
Available Zone Id's :[America/Virgin, Europe/London, Atlantic/Reykjavik, Canada/Eastern, Africa/Ndjamena, America/Grenada, Asia/Saigon, Asia/Muscat, Europe/Sarajevo, America/Belem, Eire, Greenwich, Universal, Asia/Kashgar, ...........</pre>
Reference's :
<a href="http://openjdk.java.net/jeps/150" target="_blank">http://openjdk.java.net/jeps/150</a> </br>
<a href="http://ttux.net/post/java-8-new-features-release-performance-code/" target="_blank">http://ttux.net/post/java-8-new-features-release-performance-code/</a>
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-84818262034056799712013-05-08T04:54:00.001-07:002013-05-08T05:04:14.366-07:00Ad hoc polymorphism With Java Example<div dir="ltr" style="text-align: left;" trbidi="on">
In <a class="mw-redirect" href="http://en.wikipedia.org/wiki/Programming_languages" title="Programming languages">programming languages</a>, <b>ad hoc polymorphism</b><sup class="reference" id="cite_ref-1"><a href="http://en.wikipedia.org/wiki/Ad-hoc_polymorphism#cite_note-1">[1]</a></sup> is a kind of <a href="http://en.wikipedia.org/wiki/Polymorphism_%28computer_science%29" title="Polymorphism (computer science)">polymorphism</a>
in which polymorphic functions can be applied to arguments of different
types, because a polymorphic function can denote a number of distinct
and potentially heterogeneous implementations depending on the type of
argument(s) to which it is applied. It is also known as <a href="http://en.wikipedia.org/wiki/Function_overloading" title="Function overloading">function overloading</a> or <a href="http://en.wikipedia.org/wiki/Operator_overloading" title="Operator overloading">operator overloading</a>. The term "<a href="http://en.wikipedia.org/wiki/Ad_hoc" title="Ad hoc">ad hoc</a>"
in this context is not intended to be pejorative; it refers simply to
the fact that this type of polymorphism is not a fundamental feature of
the type system. This is in contrast to <a href="http://en.wikipedia.org/wiki/Parametric_polymorphism" title="Parametric polymorphism">parametric polymorphism</a>,
in which polymorphic functions are written without mention of any
specific type, and can thus apply a single abstract implementation to
any number of types in a transparent way. This classification was
introduced by <a href="http://en.wikipedia.org/wiki/Christopher_Strachey" title="Christopher Strachey">Christopher Strachey</a> in 1967.<br />
(ref : <a href="http://en.wikipedia.org/wiki/Ad-hoc_polymorphism" target="_blank">http://en.wikipedia.org/wiki/Ad-hoc_polymorphism</a>)<br />
<br />
<pre class="java" name="code">// credit to choychoy
List<integer> list = new ArrayList(Arrays.asList(1,2,3));
int v = 1;
list.remove(v);
System.out.println(list); // prints [1, 3]
List<integer> list = new ArrayList(Arrays.asList(1,2,3));
Integer v = 1;
list.remove(v);
System.out.println(list); // prints [2, 3]
</pre>
<br />
<a href="http://blog.functr.com/2012/08/java-oddities-part-ii.html" target="_blank">http://blog.functr.com/2012/08/java-oddities-part-ii.html</a><br />
<a href="http://www.reddit.com/r/programming/comments/z2n9f/javawat_part_i/" target="_blank">http://www.reddit.com/r/programming/comments/z2n9f/javawat_part_i/</a><br />
<br /></div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com1tag:blogger.com,1999:blog-8258930489936359575.post-19154740322593486102013-05-08T03:50:00.002-07:002013-05-08T03:50:55.163-07:00Script to Disable Default F5 key using java script<div dir="ltr" style="text-align: left;" trbidi="on">
<pre class="javascript" name="code">
function disableKey(event) {
if (!event)
event = window.event;
if (!event)
return;
var keyCode = event.keyCode ? event.keyCode : event.charCode;
if (keyCode == 116 || (event.ctrlKey && keyCode == 82)) {
/* window.status = "F5 key detected! Attempting to disabling default
* response."; window.setTimeout("window.status='';", 2000);
*/
if (event.preventDefault)
event.preventDefault();
//IE (exclude Opera with !event.preventDefault):
if (document.all && window.event && !event.preventDefault) {
event.cancelBubble = true;
event.returnValue = false;
event.keyCode = 0;
}
return false;
}
a
}
function setEventListener(eventListener) {
if (document.addEventListener)
document.addEventListener('keypress', eventListener, true);
else if (document.attachEvent)
document.attachEvent('onkeydown', eventListener);
else
document.onkeydown = eventListener;
}
function unsetEventListener(eventListener) {
if (document.removeEventListener)
document.removeEventListener('keypress', eventListener, true);
else if (document.detachEvent)
document.detachEvent('onkeydown', eventListener);
else
document.onkeydown = null;
}
setEventListener(disableKey)
</pre>
<br /></div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-58501794341502485912013-05-08T02:55:00.000-07:002013-05-08T02:55:59.393-07:00Modules of Spring Framework<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Introduction :</b><br />
<br />
Spring Framework is a Java platform that provides comprehensive
infrastructure support for developing Java applications. Spring handles the
infrastructure so you can focus on your application.<br />
Spring enables you to build applications from “plain old Java objects”
(POJOs) and to apply enterprise services non-invasively to POJOs. This
capability applies to the Java SE programming model and to full and partial
Java EE.<br />
Examples of how you, as an application developer, can use the Spring
platform advantage:<br />
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
Make a Java method execute in a database transaction without
having to deal with transaction APIs.<br />
</li>
<li class="listitem">
Make a local Java method a remote procedure without having to deal
with remote APIs.<br />
</li>
<li class="listitem">
Make a local Java method a management operation without having to
deal with JMX APIs.<br />
</li>
<li class="listitem">
Make a local Java method a message handler without having to deal
with JMS APIs.<br />
<br />
(Reference : <a href="http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/overview.html" target="_blank">http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/overview.html</a>)<br />
<br />
Modules of Spring Framework :<br />
<br />
<h3 class="title">
Core Container</h3>
The <a class="link" href="http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/beans.html#beans-introduction" title="5.1 Introduction to the Spring IoC container and beans"><span class="emphasis"><em>Core
Container</em></span></a> consists of the Core, Beans, Context, and
Expression Language modules.<br />
The <a class="link" href="http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/beans.html#beans-introduction" title="5.1 Introduction to the Spring IoC container and beans"><span class="emphasis"><em>Core and
Beans</em></span></a> modules provide the fundamental parts of the
framework, including the IoC and Dependency Injection features. The
<code class="classname">BeanFactory</code> is a sophisticated implementation of
the factory pattern. It removes the need for programmatic singletons and
allows you to decouple the configuration and specification of
dependencies from your actual program logic.<br />
The <a class="link" href="http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/beans.html#context-introduction" title="5.14 Additional Capabilities of the ApplicationContext"><span class="emphasis"><em>Context</em></span></a>
module builds on the solid base provided by the <a class="link" href="http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/beans.html#beans-introduction" title="5.1 Introduction to the Spring IoC container and beans"><span class="emphasis"><em>Core and Beans</em></span></a>
modules: it is a means to access objects in a framework-style manner
that is similar to a JNDI registry. The Context module inherits its
features from the Beans module and adds support for internationalization
(using, for example, resource bundles), event-propagation,
resource-loading, and the transparent creation of contexts by, for
example, a servlet container. The Context module also supports Java EE
features such as EJB, JMX ,and basic remoting. The
<code class="classname">ApplicationContext</code> interface is the focal point
of the Context module.<br />
The <a class="link" href="http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/expressions.html" title="8. Spring Expression Language (SpEL)"><span class="emphasis"><em>Expression
Language</em></span></a> module provides
a powerful expression language for querying and manipulating an object
graph at runtime. It is an extension of the unified expression language
(unified EL) as specified in the JSP 2.1 specification. The language
supports setting and getting property values, property assignment,
method invocation, accessing the context of arrays, collections and
indexers, logical and arithmetic operators, named variables, and
retrieval of objects by name from Spring's IoC container. It also
supports list projection and selection as well as common list
aggregations.<br />
<div class="section" title="1.2.2 Data Access/Integration">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a href="https://www.blogger.com/null" name="overview-data-access"></a>Data Access/Integration</h3>
</div>
</div>
</div>
The <span class="emphasis"><em>Data Access/Integration</em></span> layer consists of
the JDBC, ORM, OXM, JMS and Transaction modules.<br />
</div>
<div class="section" title="1.2.3 Web">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a href="https://www.blogger.com/null" name="overview-web"></a>Web</h3>
</div>
</div>
</div>
The <span class="emphasis"><em>Web</em></span> layer consists of the Web,
Web-Servlet, Web-Struts, and Web-Portlet modules.<br />
Spring's <span class="emphasis"><em>Web</em></span> module provides basic
web-oriented integration features such as multipart file-upload
functionality and the initialization of the IoC container using servlet
listeners and a web-oriented application context. It also contains the
web-related parts of Spring's remoting support.<br />
</div>
<div class="section" title="1.2.4 AOP and Instrumentation">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a href="https://www.blogger.com/null" name="overview-aop-instrumentation"></a>AOP and Instrumentation</h3>
</div>
</div>
</div>
Spring's <a class="link" href="http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/aop.html#aop-introduction" title="9.1 Introduction"><span class="emphasis"><em>AOP</em></span></a> module
provides an <span class="emphasis"><em>AOP Alliance</em></span>-compliant aspect-oriented
programming implementation allowing you to define, for example,
method-interceptors and pointcuts to cleanly decouple code that
implements functionality that should be separated. Using source-level
metadata functionality, you can also incorporate behavioral information
into your code, in a manner similar to that of .NET attributes.<br />
The separate <span class="emphasis"><em>Aspects</em></span> module provides
integration with AspectJ.<br />
The <span class="emphasis"><em>Instrumentation</em></span> module provides class
instrumentation support and classloader implementations to be used in
certain application servers.<br />
</div>
<div class="section" title="1.2.5 Test">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a href="https://www.blogger.com/null" name="overview-testing"></a> Test</h3>
</div>
</div>
</div>
The <span class="emphasis"><em>Test</em></span> module supports the testing of
Spring components with JUnit or TestNG. It provides consistent loading
of Spring ApplicationContexts and caching of those contexts. It also
provides mock objects that you can use to test your code in
isolation.<br />
</div>
<div class="section" title="1.3 Usage scenarios">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;">
<a href="https://www.blogger.com/null" name="overview-usagescenarios"></a></h2>
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-42249801019402879432013-05-01T01:03:00.002-07:002013-05-01T01:04:07.193-07:00Drop Down List in GWT
To achieve this, we need to work on ListBox of GWT.
<pre class="java" name="code">public class ListBoxExample implements EntryPoint {
public void onModuleLoad() {
// Make a new list box, adding a few items to it.
ListBox lb = new ListBox();
lb.addItem("foo");
lb.addItem("bar");
lb.addItem("baz");
lb.addItem("toto");
lb.addItem("tintin");
// Make enough room for all five items (setting this value to 1 turns it
// into a drop-down list).
lb.setVisibleItemCount(1);
// Add it to the root panel.
RootPanel.get().add(lb);
}
}
</pre>
<a href="http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/ui/ListBox.html"></a>thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-35586970966656667112013-04-29T23:33:00.001-07:002013-04-29T23:33:58.933-07:00Close GWT Dilouge Box on KeyBoard ESCAPE Key
Requirement : Closeable dialogue box in GWT upon ESC key of keyboard.
To achieve this we just need to override a GWT method.
<pre class = "java" name = "code">
private class ExtendedDialogBox extends DialogBox {
protected void onPreviewNativeEvent(NativePreviewEvent event) {
super.onPreviewNativeEvent(event);
switch (event.getTypeInt()) {
case Event.ONKEYDOWN:
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) {
hide();
}
break;
}
}
}
</pre> thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-56450328267736030192013-04-29T23:27:00.002-07:002013-04-29T23:30:30.639-07:00Prevent Default Refresh Event in Browser Using GWTBit odd requirement that if anyone need to prevent default Cntrl + R or F5 event using GWT (Google Web Tool Kit). It can be done easily.
In onModuleMethod of EntryPoint class just use this code.
<pre class = "java" name = "code">
public void onModuleLoad() {
//disable refresh button
Event.addNativePreviewHandler(new NativePreviewHandler() {
public void onPreviewNativeEvent(NativePreviewEvent event) {
switch (event.getTypeInt()) {
case Event.ONKEYDOWN:
NativeEvent nEvent = event.getNativeEvent();
if (nEvent.getCtrlKey() && nEvent.getKeyCode() == 'R') {
nEvent.preventDefault();
}
if (nEvent.getKeyCode() == 116) {
nEvent.preventDefault();
}
break;
}
}
});
}
</pre>
This will full fill the need across the GWT application.
Reference : Co worker : Ruhulthinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-86828802848117218582013-04-22T01:50:00.001-07:002013-04-22T02:11:34.402-07:00Load Image from DB and Show it in browser using Google Web Toolkit<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
<br />
A widget that displays the image at a given URL. The image can be in
'unclipped' mode (the default) or 'clipped' mode. In clipped mode, a viewport
is overlaid on top of the image so that a subset of the image will be displayed.
In unclipped mode, there is no viewport - the entire image will be visible.
Whether an image is in clipped or unclipped mode depends on how the image is
constructed, and how it is transformed after construction. Methods will operate
differently depending on the mode that the image is in. These differences are
detailed in the documentation for each method. <br />
If an image transitions between clipped mode and unclipped mode, any <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/dom/client/Element.html" title="class in com.google.gwt.dom.client"><code><span style="color: blue; font-size: 10.0pt;">Element</span></code></a>-specific attributes added by the user
(including style attributes, style names, and style modifiers), except for
event listeners, will be lost.<br />
reference : <!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]--><br />
<br />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="mso-spacerun: yes;"> </span><a href="http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/Image.html" target="_blank">http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/Image.html</a></span><br />
<br />
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><a href="http://stackoverflow.com/questions/6409587/generating-an-inline-image-with-java-gwt" target="_blank">http://stackoverflow.com/questions/6409587/generating-an-inline-image-with-java-gwt</a> </span><br />
<br />
<pre class="java" name="code">public String getImage (String id) {
String imageDataAsString = new String();
byte imageBytes[] = new byte[5000];
imageBytes = imageService.getImageById(id);
return encodeasBase64(imageBytes);
}
</pre>
<pre class="java" name="code">
//convert data to base64 string
// * base64 codec ported with GWT will not going to work , use commons codec *
// * this method is responsible to convert byteArray to base64
// * encoded string
//*org.apache.commons.codec.binary.Base64*
public String encodeasBase64(byte[] imageByteArray) {
StringBuilder imageDataAsbase64String = new StringBuilder();
String encodedString = new
String(Base64.encodeBase64(imageByteArray));
imageDataAsbase64String.append("data:image/jpg;base64,");
imageDataAsbase64String.append(encodedString);
return imageDataAsbase64String.toString();
}
</pre>
<pre class="java" name="code">
// Data will come from GWT rpc call , rpc call can be initiate upon click event
public void displayImage(String result) {
Image image = new Image(result);
HorizontalPanel imagePanel = new HorizontalPanel();
DialogBox dialogueBox = new DialogBox();
imagePanel.add(image);
dialogueBox.setWidget(imagePanel);
dialogueBox.show();
}
</pre>
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"> </span> thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com0tag:blogger.com,1999:blog-8258930489936359575.post-82060898473394359072012-12-30T10:33:00.001-08:002012-12-30T11:24:06.536-08:00Factory Method Design Pattern or Virtual Constructor<div dir="ltr" style="text-align: left;" trbidi="on">
Factory method design pattern is one of the extensively used design patter in software development using java. Concept of factory method design pattern is blend from factory which deals with the problem of creating products (in case of programming object).This is one of the basic creational design pattern.<br />
<br />
Intent of factory method :<br />
<br />
Define an interface for creating an object, but let subclasses decide which class<br />
to instantiate. Factory Method lets a class defer instantiation to subclasses.<br />
<br />
Assume an online banking system using two different sms gateway to deliver mobile banking notification to it's valued customers.System need to resolve which gateway will use by cell number assume hear gateway type. Based on category or need system need to create or return object/instance of a gateway. Hear is the practical example :<br />
<b>Gateway type enumeration :</b>
<br />
<pre class="java" name="code">package com.thinktank.rnd.se.pattern.factorymethod;
public enum GatewayType {
ONE(1), TWO(2);
private int value;
private GatewayType(int value) {
this.value = value;
}
};
</pre>
<b>Gateway interface :</b>
<br />
<pre class="java" name="code">package com.thinktank.rnd.se.pattern.factorymethod;
public interface GateWay {
public int connectToGateWay();
}
</pre>
<b>Implementation of gateway interface :</b>
<br />
<pre class="java" name="code">package com.thinktank.rnd.se.pattern.factorymethod;
public class SmsGatewayOne implements GateWay {
public int connectToGateWay() {
System.out.println("Connection Established With Gateway One");
return 1;
}
}
</pre>
<b>Another implementation of gateway interface :</b>
<br />
<pre class="java" name="code">package com.thinktank.rnd.se.pattern.factorymethod;
public class SmsGatewayTwo implements GateWay {
public int connectToGateWay() {
System.out.println("Connection Established to Gateway Two");
return 1;
}
}
</pre>
<b>Gateway factory class :</b>
<br />
<pre class="java" name="code">package com.thinktank.rnd.se.pattern.factorymethod;
public class GatewayFactory {
public GateWay getGateway(GatewayType gatewayType) {
switch (gatewayType) {
case ONE:
return new SmsGatewayOne();
case TWO:
return new SmsGatewayTwo();
}
return null;
}
}
</pre>
<b>Main class for our factory method demo :</b>
<br />
<pre class="java" name="code">package com.thinktank.rnd.se.pattern.factorymethod;
public class DemoFactoryMethod {
public static void main(String args[]) {
GatewayFactory gatewayFactory = new GatewayFactory();
GateWay gateWay = gatewayFactory.getGateway(GatewayType.TWO);
gateWay.connectToGateWay();
}
}
</pre>
<br />
<br />
Use the Factory Method pattern when<br />
· a class can't anticipate the class of objects it must create.<br />
· a class wants its subclasses to specify the objects it creates.<br />
· classes delegate responsibility to one of several helper subclasses, and<br />
you want to localize the knowledge of which helper subclass is the delegate.<br />
<br />
<br />
<br />
<br />
<br />
<b>Reference :</b><br />
<a href="http://www.amazon.co.uk/Design-patterns-elements-reusable-object-oriented/dp/0201633612" target="_blank">Design-patterns-elements-reusable-object-oriented</a><br />
<a href="http://en.wikipedia.org/wiki/Design_Patterns" target="_blank">http://en.wikipedia.org/wiki/Design_Patterns</a><br />
<a href="http://java.dzone.com/articles/design-patterns-factory" target="_blank">http://java.dzone.com/articles/design-patterns-factory</a><br />
<a href="http://javapapers.com/design-patterns/factory-method-pattern/" target="_blank">http://javapapers.com/design-patterns/factory-method-pattern/</a><br />
<a href="http://en.wikipedia.org/wiki/Factory_method_pattern" target="_blank">http://en.wikipedia.org/wiki/Factory_method_pattern</a></div>
thinktankhttp://www.blogger.com/profile/07701607514796006407noreply@blogger.com2