<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-123553503389886348</id><updated>2011-11-27T15:53:25.231-08:00</updated><category term='JAVA'/><title type='text'>Java Interview Questions n Answers - An interviewhelper.org blog</title><subtitle type='html'>This blog contains common JAVA interview questions asked by different organizations.&lt;br&gt;&lt;br&gt;
For more such interview questions, please visit our website &lt;a href="http://interviewhelper.org"&gt;Interview Helper&lt;/a&gt;........&lt;a href="http://interviewhelper.org"&gt;&lt;img src="http://interviewhelper.org/images/interviewhelper.jpg" width="200" height="73" border="0"&gt;&lt;/a&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default?start-index=101&amp;max-results=100'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>812</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-6673100951933982387</id><published>2009-03-14T01:26:00.000-07:00</published><updated>2009-03-14T01:27:45.754-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Do objects stored in a HTTP Session need to be serializable  Or can it</title><content type='html'>&lt;strong&gt;Question :Do objects stored in a HTTP Session need to be serializable? Or can it&lt;br /&gt;store any object? (Servlets)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :Yes, the objects need to be serializable, but only if your servlet container&lt;br /&gt;supports persistent sessions. Most lightweight servlet engines (like&lt;br /&gt;Tomcat) do not support this. However, many EJB-enabled servlet engines&lt;br /&gt;do. Even if your engine does support persistent sessions, it is usually&lt;br /&gt;possible to disable this feature.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-6673100951933982387?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/6673100951933982387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/do-objects-stored-in-http-session-need.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6673100951933982387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6673100951933982387'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/do-objects-stored-in-http-session-need.html' title='Do objects stored in a HTTP Session need to be serializable  Or can it'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1054838905107573541</id><published>2009-03-14T01:25:00.000-07:00</published><updated>2009-03-14T01:26:25.895-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is URL Encoding and URL Decoding   (Servlets)</title><content type='html'>&lt;strong&gt;Question :What is URL Encoding and URL Decoding ? (Servlets)&lt;/strong&gt;&lt;br /&gt;Answer :URL encoding is the method of replacing all the spaces and other extra characters into their Characters and Decoding is the reverse process converting all Hex Characters back their normal For Example consider this URL, /ServletsDirectory/Hello'servlet/&lt;br /&gt;When Encoded using URLEncoder.encode("/ServletsDirectory/Hello'servlet/") the output is&lt;br /&gt;http%3A%2F%2Fwww.javacommerce.com%2FServlets+Directory%2FHello%27servlet%2FThis back using&lt;br /&gt;URLDecoder.decode("http%3A%2F%2Fwww.javacommerce.com%2FServlets+Directory%2FHello%&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1054838905107573541?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1054838905107573541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-url-encoding-and-url-decoding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1054838905107573541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1054838905107573541'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-url-encoding-and-url-decoding.html' title='What is URL Encoding and URL Decoding   (Servlets)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-3247417054713468801</id><published>2009-03-14T01:23:00.000-07:00</published><updated>2009-03-14T01:24:45.551-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Can I just abort processing a JSP  (Servlets)</title><content type='html'>&lt;strong&gt;Question :Can I just abort processing a JSP? (Servlets)&lt;/strong&gt;&lt;br /&gt;Answer :Yes. Because your JSP is just a servlet method, you can just put&lt;br /&gt;(whereever necessary) a &lt; % return; % &gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-3247417054713468801?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/3247417054713468801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-i-just-abort-processing-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3247417054713468801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3247417054713468801'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-i-just-abort-processing-jsp.html' title='Can I just abort processing a JSP  (Servlets)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-7028043375705053044</id><published>2009-03-14T01:21:00.000-07:00</published><updated>2009-03-14T01:23:09.730-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Is it true that servlet containers service each request by creating a new</title><content type='html'>&lt;strong&gt;Question :Is it true that servlet containers service each request by creating a new&lt;br /&gt;thread? If that is true, how does a container handle a sudden dramatic&lt;br /&gt;surge in incoming requests without significant performance&lt;br /&gt;degradation? (Servlets)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :The implementation depends on the Servlet engine. For each request&lt;br /&gt;generally, a new Thread is created. But to give performance boost, most&lt;br /&gt;containers, create and maintain a thread pool at the server startup time.&lt;br /&gt;To service a request, they simply borrow a thread from the pool and when&lt;br /&gt;they are done, return it to the pool.&lt;br /&gt;For this thread pool, upper bound and lower bound is maintained. Upper&lt;br /&gt;bound prevents the resource exhaustion problem associated with unlimited&lt;br /&gt;thread allocation. The lower bound can instruct the pool not to keep too&lt;br /&gt;many idle threads, freeing them if needed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-7028043375705053044?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/7028043375705053044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-it-true-that-servlet-containers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7028043375705053044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7028043375705053044'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-it-true-that-servlet-containers.html' title='Is it true that servlet containers service each request by creating a new'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-7222879486001632062</id><published>2009-03-14T00:59:00.000-07:00</published><updated>2009-03-14T01:01:03.597-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What do the differing levels of bean storage (page, session, app) mean (Servlets)</title><content type='html'>&lt;strong&gt;Question :What do the differing levels of bean storage (page, session, app)&lt;br /&gt;mean? (Servlets)&lt;/strong&gt;&lt;br /&gt;Answer :page life time - NO storage. This is the same as declaring the variable in&lt;br /&gt;a scriptlet and using it from there.&lt;br /&gt;session life time - request.getSession(true).putValue "myKey", myObj);&lt;br /&gt;application level ?&lt;br /&gt;getServletConfig().getServletContext().setAttribute("myKey ",myObj )&lt;br /&gt;request level - The storage exists for the lifetime of the request, which&lt;br /&gt;may be forwarded between jsp's and servlets&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-7222879486001632062?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/7222879486001632062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-do-differing-levels-of-bean_14.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7222879486001632062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7222879486001632062'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-do-differing-levels-of-bean_14.html' title='What do the differing levels of bean storage (page, session, app) mean (Servlets)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-7055819271026581106</id><published>2009-03-14T00:56:00.000-07:00</published><updated>2009-03-14T00:57:50.760-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Is there some sort of event that happens when a session object gets</title><content type='html'>&lt;strong&gt;Question :Is there some sort of event that happens when a session object gets&lt;br /&gt;bound or unbound to the session? (Servlets)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :HttpSessionBindingListener will hear the events When an object is added&lt;br /&gt;and/or remove from the session object, or when the session is invalidated,&lt;br /&gt;in which case the objects are first removed from the session, whether the&lt;br /&gt;session is invalidated manually or automatically (timeout).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-7055819271026581106?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/7055819271026581106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-there-some-sort-of-event-that.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7055819271026581106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7055819271026581106'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-there-some-sort-of-event-that.html' title='Is there some sort of event that happens when a session object gets'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-7880812655296971496</id><published>2009-03-14T00:55:00.000-07:00</published><updated>2009-03-14T00:56:26.303-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What?s the difference between sendRedirect( ) and forward( )</title><content type='html'>&lt;strong&gt;Question :What?s the difference between sendRedirect( ) and forward( )&lt;br /&gt;methods? (Servlets)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :A sendRedirect method creates a new request (it?s also reflected in&lt;br /&gt;browser?s URL ) where as forward method forwards the same request to&lt;br /&gt;the new target(hence the chnge is NOT reflected in browser?s URL).&lt;br /&gt;The previous request scope objects are no longer available after a redirect&lt;br /&gt;because it results in a new request, but it?s available in forward.&lt;br /&gt;SendRedirectis slower compared to forward.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-7880812655296971496?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/7880812655296971496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/whats-difference-between-sendredirect.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7880812655296971496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7880812655296971496'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/whats-difference-between-sendredirect.html' title='What?s the difference between sendRedirect( ) and forward( )'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-3649864288974912985</id><published>2009-03-14T00:51:00.000-07:00</published><updated>2009-03-14T00:55:26.583-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How many cookies can one set in the response object of the servlet</title><content type='html'>&lt;strong&gt;Question :How many cookies can one set in the response object of the servlet?&lt;br /&gt;Also, are there any restrictions on the size of cookies? (Servlets)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :If the client is using Netscape, the browser can receive and store 300&lt;br /&gt;total cookies&lt;br /&gt;4 kilobytes per cookie (including name)&lt;br /&gt;20 cookies per server or domain&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-3649864288974912985?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/3649864288974912985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-many-cookies-can-one-set-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3649864288974912985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3649864288974912985'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-many-cookies-can-one-set-in.html' title='How many cookies can one set in the response object of the servlet'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-6705249757837573656</id><published>2009-03-14T00:47:00.000-07:00</published><updated>2009-03-14T00:50:04.022-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is Server Side Push and how is it implemented and when is it</title><content type='html'>&lt;strong&gt;Question :What is Server Side Push and how is it implemented and when is it&lt;br /&gt;useful? (Servlets)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :Server Side push is useful when data needs to change regularly on the&lt;br /&gt;clients application or browser, without intervention from client. Standard&lt;br /&gt;examples might include apps like Stock's Tracker, Current News etc. As&lt;br /&gt;such server cannot connect to client's application automatically. The&lt;br /&gt;mechanism used is, when client first connects to Server, (Either through&lt;br /&gt;login etc..), then Server keeps the TCP/IP connection open.&lt;br /&gt;It's not always possible or feasible to keep the connection to Server open.&lt;br /&gt;So another method used is, to use the standard HTTP protocols ways of&lt;br /&gt;refreshing the page, which is normally supported by all browsers.&lt;br /&gt;&lt;META HTTP-EQUIV="Refresh" CONTENT="5;URL=/servlet/stockquotes/"&gt;&lt;br /&gt;This will refresh the page in the browser automatically and loads the new&lt;br /&gt;data every 5 seconds.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-6705249757837573656?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/6705249757837573656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-server-side-push-and-how-is-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6705249757837573656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6705249757837573656'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-server-side-push-and-how-is-it.html' title='What is Server Side Push and how is it implemented and when is it'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-876090758076144883</id><published>2009-03-14T00:42:00.000-07:00</published><updated>2009-03-14T00:43:37.281-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is HttpTunneling  (Servlets)</title><content type='html'>&lt;strong&gt;Question :What is HttpTunneling? (Servlets)&lt;/strong&gt;&lt;br /&gt;Answer :HTTP tunneling is used to encapsulate other protocols within the HTTP or&lt;br /&gt;HTTPS protocols. Normally the intra-network of an organization is blocked&lt;br /&gt;by a firewall and the network is exposed to the outer world only through a&lt;br /&gt;specific web server port , that listens for only HTTP requests. To use any&lt;br /&gt;other protocol, that by passes the firewall, the protocol is embedded in&lt;br /&gt;HTTP and send as HttpRequest.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-876090758076144883?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/876090758076144883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-httptunneling-servlets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/876090758076144883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/876090758076144883'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-httptunneling-servlets.html' title='What is HttpTunneling  (Servlets)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8219010475304363525</id><published>2009-03-14T00:40:00.000-07:00</published><updated>2009-03-14T00:42:17.744-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>The code in a finally clause will never fail to execute, right  (Servlets)</title><content type='html'>&lt;strong&gt;Question :The code in a finally clause will never fail to execute, right ? (Servlets)&lt;/strong&gt;&lt;br /&gt;Answer :Using System.exit(1); in try block will not allow finally code to execute.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8219010475304363525?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8219010475304363525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/code-in-finally-clause-will-never-fail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8219010475304363525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8219010475304363525'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/code-in-finally-clause-will-never-fail.html' title='The code in a finally clause will never fail to execute, right  (Servlets)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1595302554060356960</id><published>2009-03-14T00:38:00.000-07:00</published><updated>2009-03-14T00:40:46.986-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can a servlet refresh automatically if some new data has entered the database (Servlets)</title><content type='html'>&lt;strong&gt;Question :How can a servlet refresh automatically if some new data has entered the&lt;br /&gt;database? (Servlets)&lt;/strong&gt;&lt;br /&gt;Answer :You can use a client-side Refresh or Server Push&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1595302554060356960?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1595302554060356960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-servlet-refresh-automatically.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1595302554060356960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1595302554060356960'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-servlet-refresh-automatically.html' title='How can a servlet refresh automatically if some new data has entered the database (Servlets)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-5881948017643319748</id><published>2009-03-14T00:37:00.000-07:00</published><updated>2009-03-14T00:38:52.474-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Can we use the constructor, instead of init(), to initialize servlet  (Servlets)</title><content type='html'>&lt;strong&gt;Question :Can we use the constructor, instead of init(), to initialize servlet? (Servlets)&lt;/strong&gt;&lt;br /&gt;Answer :Yes , of course you can use the constructor instead of init(). There's&lt;br /&gt;nothing to stop you. But you shouldn't. The original reason for init() was&lt;br /&gt;that ancient versions of Java couldn't dynamically invoke constructors with&lt;br /&gt;arguments, so there was no way to give the constructur a ServletConfig.&lt;br /&gt;That no longer applies, but servlet containers still will only call your no-arg&lt;br /&gt;constructor. So you won't have access to a ServletConfig or&lt;br /&gt;ServletContext.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-5881948017643319748?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/5881948017643319748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-we-use-constructor-instead-of-init.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5881948017643319748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5881948017643319748'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-we-use-constructor-instead-of-init.html' title='Can we use the constructor, instead of init(), to initialize servlet  (Servlets)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-2722345696420066708</id><published>2009-03-14T00:36:00.000-07:00</published><updated>2009-03-14T00:37:09.617-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can I send user authentication information while</title><content type='html'>&lt;strong&gt;Question :How can I send user authentication information while&lt;br /&gt;makingURLConnection? (Servlets)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :You'll want to use HttpURLConnection.setRequestProperty and set all the&lt;br /&gt;appropriate headers to HTTP authorization.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-2722345696420066708?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/2722345696420066708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-send-user-authentication.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2722345696420066708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2722345696420066708'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-send-user-authentication.html' title='How can I send user authentication information while'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-939013113755482215</id><published>2009-03-14T00:34:00.000-07:00</published><updated>2009-03-14T00:36:04.003-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Request parameter How to find whether a parameter exists in the request object (Servlets)</title><content type='html'>&lt;strong&gt;Question :Request parameter How to find whether a parameter exists in the request&lt;br /&gt;object? (Servlets)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :1.boolean hasFoo = !(request.getParameter("foo") == null ||&lt;br /&gt;request.getParameter("foo").equals(""));&lt;br /&gt;2. boolean hasParameter =&lt;br /&gt;request.getParameterMap().contains(theParameter);&lt;br /&gt;(which works in Servlet 2.3+)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-939013113755482215?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/939013113755482215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/request-parameter-how-to-find-whether.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/939013113755482215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/939013113755482215'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/request-parameter-how-to-find-whether.html' title='Request parameter How to find whether a parameter exists in the request object (Servlets)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1286083663972045592</id><published>2009-03-14T00:29:00.000-07:00</published><updated>2009-03-14T00:34:01.303-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Assume an application needs security permissions granted before the</title><content type='html'>&lt;strong&gt;Question :Assume an application needs security permissions granted before the&lt;br /&gt;application can talk to the database. How&lt;br /&gt;do you go about setting the permissions? Give an example of setting the&lt;br /&gt;permission in Tomcat and stand alone&lt;br /&gt;java programme. (Security)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :In Tomcat:&lt;br /&gt;Add security permission to catalina.policy file located under&lt;br /&gt;&lt;TOMCAT_HOME&gt;/conf/ Add the following lines&lt;br /&gt;grant codeBase "file:${catalina.home}/webapps/MyContext/-"&lt;br /&gt;{&lt;br /&gt;permission java.security.AllPermission;&lt;br /&gt;};&lt;br /&gt;In stand alone java application:&lt;br /&gt;Create a .policy file that points to the code base where the application&lt;br /&gt;resides.&lt;br /&gt;grant codebase "file:c:/source/java/-"&lt;br /&gt;{&lt;br /&gt;permission java.security.AllPermission;&lt;br /&gt;};&lt;br /&gt;java -Djava.security.policy=&lt;file name&gt;.policy com.test.MyClass&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1286083663972045592?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1286083663972045592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/assume-application-needs-security.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1286083663972045592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1286083663972045592'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/assume-application-needs-security.html' title='Assume an application needs security permissions granted before the'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-3984483926254637064</id><published>2009-03-14T00:27:00.000-07:00</published><updated>2009-03-14T00:28:19.613-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Can RMI and Corba based applications interact   (RMI)</title><content type='html'>&lt;strong&gt;Question :Can RMI and Corba based applications interact ? (RMI)&lt;/strong&gt;&lt;br /&gt;Answer :Yes they can. RMI is available with IIOP as the transport protocol instead&lt;br /&gt;of JRMP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-3984483926254637064?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/3984483926254637064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-rmi-and-corba-based-applications.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3984483926254637064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3984483926254637064'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-rmi-and-corba-based-applications.html' title='Can RMI and Corba based applications interact   (RMI)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-4925866833772578762</id><published>2009-03-14T00:25:00.000-07:00</published><updated>2009-03-14T00:26:57.303-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Does RMI-IIOP support code downloading for Java objects sent by value</title><content type='html'>&lt;strong&gt;Question :Does RMI-IIOP support code downloading for Java objects sent by value&lt;br /&gt;across an IIOP connection in the same way as RMI does across a JRMP&lt;br /&gt;connection? (RMI)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :Yes. The JDK 1.2 support the dynamic class loading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-4925866833772578762?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/4925866833772578762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/does-rmi-iiop-support-code-downloading.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4925866833772578762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4925866833772578762'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/does-rmi-iiop-support-code-downloading.html' title='Does RMI-IIOP support code downloading for Java objects sent by value'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8503919458194790650</id><published>2009-03-14T00:23:00.000-07:00</published><updated>2009-03-14T00:25:06.027-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Does RMI-IIOP support dynamic downloading of classes  (RMI)</title><content type='html'>&lt;strong&gt;Question :Does RMI-IIOP support dynamic downloading of classes? (RMI)&lt;/strong&gt;&lt;br /&gt;Answer :No, RMI-IIOP doesn't support dynamic downloading of the classes as it is&lt;br /&gt;done with CORBA in DII (Dynamic Interface Invocation).Actually RMI-IIOP&lt;br /&gt;combines the usability of Java Remote Method Invocation (RMI) with the&lt;br /&gt;interoperability of the Internet Inter-ORB Protocol (IIOP).So in order to&lt;br /&gt;attain this interoperability between RMI and CORBA,some of the features&lt;br /&gt;that are supported by RMI but not CORBA and vice versa are eliminated&lt;br /&gt;from the RMI-IIOP specification.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8503919458194790650?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8503919458194790650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/does-rmi-iiop-support-dynamic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8503919458194790650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8503919458194790650'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/does-rmi-iiop-support-dynamic.html' title='Does RMI-IIOP support dynamic downloading of classes  (RMI)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-3846673991782003966</id><published>2009-03-14T00:21:00.000-07:00</published><updated>2009-03-14T00:22:59.832-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How many types of protocol implementations does RMI have  (RMI)</title><content type='html'>&lt;strong&gt;Question :How many types of protocol implementations does RMI have? (RMI)&lt;/strong&gt;&lt;br /&gt;Answer :RMI has at least three protocol implementations: Java Remote Method&lt;br /&gt;Protocol(JRMP), Internet Inter ORB Protocol(IIOP), and Jini Extensible&lt;br /&gt;Remote Invocation(JERI). These are alternatives, not part of the same&lt;br /&gt;thing, All three are indeed layer 6 protocols for those who are still speaking&lt;br /&gt;OSI reference model.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-3846673991782003966?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/3846673991782003966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-many-types-of-protocol.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3846673991782003966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3846673991782003966'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-many-types-of-protocol.html' title='How many types of protocol implementations does RMI have  (RMI)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-643324424898532250</id><published>2009-03-14T00:18:00.000-07:00</published><updated>2009-03-14T00:20:59.541-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Considering a=4 and b=10. Can you swap the values without using any</title><content type='html'>Question :Considering a=4 and b=10. Can you swap the values without using any&lt;br /&gt;temp variable? The final output should be a=10 and b=4. (Other)&lt;br /&gt;&lt;br /&gt;Answer :a = a + b // 4 + 10 = 14&lt;br /&gt;b = a - b // 14 - 10 = 4&lt;br /&gt;a = a - b // 14 - 4 = 10&lt;br /&gt;b = 4&lt;br /&gt;a = 10&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-643324424898532250?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/643324424898532250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/considering-a4-and-b10-can-you-swap_14.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/643324424898532250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/643324424898532250'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/considering-a4-and-b10-can-you-swap_14.html' title='Considering a=4 and b=10. Can you swap the values without using any'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-222326442759169797</id><published>2009-03-14T00:16:00.000-07:00</published><updated>2009-03-14T00:18:11.100-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>how to make default checkbox selecte(in struts) (Other)</title><content type='html'>&lt;strong&gt;Question :how to make default checkbox selecte(in struts) (Other)&lt;/strong&gt;&lt;br /&gt;Answer :useing the set and get methods it can be done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-222326442759169797?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/222326442759169797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-to-make-default-checkbox-selectein.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/222326442759169797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/222326442759169797'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-to-make-default-checkbox-selectein.html' title='how to make default checkbox selecte(in struts) (Other)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-6174963797420266343</id><published>2009-03-14T00:15:00.000-07:00</published><updated>2009-03-14T00:16:18.899-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Write a query for getting the second maximum marks of students from</title><content type='html'>&lt;strong&gt;Question :Write a query for getting the second maximum marks of students from&lt;br /&gt;students table? (Other)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :select max(marks) from students where marks &lt;(select max(marks)&lt;br /&gt;from students)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-6174963797420266343?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/6174963797420266343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/write-query-for-getting-second-maximum.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6174963797420266343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6174963797420266343'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/write-query-for-getting-second-maximum.html' title='Write a query for getting the second maximum marks of students from'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8111648615718359023</id><published>2009-03-14T00:13:00.000-07:00</published><updated>2009-03-14T00:14:51.445-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Considering a=4 and b=10. Can you swap the values without using any</title><content type='html'>&lt;strong&gt;Question :Considering a=4 and b=10. Can you swap the values without using any&lt;br /&gt;temp variable? The final output should be a=10 and b=4. (Other)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :a = a + b // 4 + 10 = 14&lt;br /&gt;b = a - b // 14 - 10 = 4&lt;br /&gt;a = a - b // 14 - 4 = 10&lt;br /&gt;b = 4&lt;br /&gt;a = 10&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8111648615718359023?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8111648615718359023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/considering-a4-and-b10-can-you-swap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8111648615718359023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8111648615718359023'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/considering-a4-and-b10-can-you-swap.html' title='Considering a=4 and b=10. Can you swap the values without using any'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-7750046252218220754</id><published>2009-03-14T00:12:00.000-07:00</published><updated>2009-03-14T00:13:42.918-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What are the two important TCP Socket classes  (Networking)</title><content type='html'>&lt;strong&gt;Question :What are the two important TCP Socket classes? (Networking)&lt;/strong&gt;&lt;br /&gt;Answer :Socket and ServerSocket. ServerSocket is used for normal two-way&lt;br /&gt;socket communication. Socket class allows us to read and write through&lt;br /&gt;the sockets. getInputStream() and getOutputStream() are the two&lt;br /&gt;methods available in Socket class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-7750046252218220754?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/7750046252218220754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-two-important-tcp-socket.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7750046252218220754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7750046252218220754'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-two-important-tcp-socket.html' title='What are the two important TCP Socket classes  (Networking)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8194841155183801208</id><published>2009-03-14T00:11:00.000-07:00</published><updated>2009-03-14T00:12:18.929-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is the difference between URL instance and URLConnection</title><content type='html'>&lt;strong&gt;Question :What is the difference between URL instance and URLConnection&lt;br /&gt;instance? (Networking)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :A URL instance represents the location of a resource, and a&lt;br /&gt;URLConnection instance represents a link for accessing or communicating&lt;br /&gt;with the resource at the location.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8194841155183801208?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8194841155183801208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between-url-instance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8194841155183801208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8194841155183801208'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between-url-instance.html' title='What is the difference between URL instance and URLConnection'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-2608256525521190043</id><published>2009-03-14T00:09:00.000-07:00</published><updated>2009-03-14T00:11:04.604-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What information is needed to create a TCP Socket  (Networking)</title><content type='html'>&lt;strong&gt;Question :What information is needed to create a TCP Socket? (Networking)&lt;/strong&gt;&lt;br /&gt;Answer :The Local System?s IP Address and Port Number. And the Remote&lt;br /&gt;System's IPAddress and Port Number.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-2608256525521190043?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/2608256525521190043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-information-is-needed-to-create.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2608256525521190043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2608256525521190043'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-information-is-needed-to-create.html' title='What information is needed to create a TCP Socket  (Networking)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-2706653928206203799</id><published>2009-03-14T00:08:00.000-07:00</published><updated>2009-03-14T00:09:42.211-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do I convert a numeric IP address like 192.18.97.39 into a hostname</title><content type='html'>&lt;strong&gt;Question :How do I convert a numeric IP address like 192.18.97.39 into a hostname&lt;br /&gt;like java.sun.com? (Networking)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :String hostname =&lt;br /&gt;InetAddress.getByName("192.18.97.39").getHostName();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-2706653928206203799?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/2706653928206203799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-convert-numeric-ip-address.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2706653928206203799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2706653928206203799'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-convert-numeric-ip-address.html' title='How do I convert a numeric IP address like 192.18.97.39 into a hostname'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-989395798195580893</id><published>2009-03-14T00:05:00.000-07:00</published><updated>2009-03-14T00:07:58.638-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Why would a client application use JTA transactions  (JTA)</title><content type='html'>Question :Why would a client application use JTA transactions? (JTA)&lt;br /&gt;&lt;br /&gt;Answer :One possible example would be a scenario in which a client needs to&lt;br /&gt;employ two (or more) session beans, where each session bean is deployed&lt;br /&gt;on a different EJB server and each bean performs operations against&lt;br /&gt;external resources (for example, a database) and/or is managing one or&lt;br /&gt;more entity beans. In this scenario, the client's logic could required an allor-&lt;br /&gt;nothing guarantee for the operations performed by the session beans;&lt;br /&gt;hence, the session bean usage could be bundled together with a JTA&lt;br /&gt;UserTransaction object.&lt;br /&gt;In the previous scenario, however, the client application developer should&lt;br /&gt;address the question of whether or not it would be better to encapsulate&lt;br /&gt;these operations in yet another session bean, and allow the session bean to&lt;br /&gt;handle the transactions via the EJB container. In general, lightweight clients&lt;br /&gt;are easier to maintain than heavyweight clients. Also, EJB environments are&lt;br /&gt;ideally suited for transaction management.&lt;br /&gt;...&lt;br /&gt;Context c = new InitialContext(); UserTransaction ut =&lt;br /&gt;(UserTransaction) c.lookup("java:comp/UserTransaction");&lt;br /&gt;ut.begin(); // perform multiple operations...&lt;br /&gt;ut.commit()&lt;br /&gt;...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-989395798195580893?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/989395798195580893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/why-would-client-application-use-jta.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/989395798195580893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/989395798195580893'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/why-would-client-application-use-jta.html' title='Why would a client application use JTA transactions  (JTA)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8006782093724324686</id><published>2009-03-13T23:44:00.010-07:00</published><updated>2009-03-14T00:02:48.155-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can we access a Vector from one jsp page to another jsp page.  You</title><content type='html'>&lt;strong&gt;Question :How can we access a Vector from one jsp page to another jsp page.? You&lt;br /&gt;also need to restrict a third jsp page from having access to this&lt;br /&gt;Vector. (JSP)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :If you use session.setAttribute("key","value"); then the object that is put&lt;br /&gt;into the session is available till the session is timed out. In this case&lt;br /&gt;if you need to restrict the vector in third jsp page, put it in request scope&lt;br /&gt;e.g. request.setAttribute("key", "value"); By this way your object&lt;br /&gt;is available till your request has been processed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8006782093724324686?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8006782093724324686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-we-access-vector-from-one-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8006782093724324686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8006782093724324686'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-we-access-vector-from-one-jsp.html' title='How can we access a Vector from one jsp page to another jsp page.  You'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-94038536279591062</id><published>2009-03-13T23:44:00.009-07:00</published><updated>2009-03-14T00:00:46.215-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>The following are the contents of test.jsp</title><content type='html'>&lt;strong&gt;Question :The following are the contents of test.jsp&lt;br /&gt;&lt;html&gt;&lt;br /&gt;&lt;title&gt;Welcome to my web page&lt;/title&gt;&lt;br /&gt;&lt;h1&gt;This example demonstrates the output of test.jsp&lt;/h1&gt;&lt;br /&gt;&lt;%! String name=request.getParameter(``name``); %&gt;&lt;br /&gt;Name is &lt;%=name %&gt;&lt;br /&gt;&lt;/html&gt;&lt;br /&gt;If the user types http://localhost:8080/test.jsp?name=JavaGalaxy, What&lt;br /&gt;will the output be? (JSP)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :Compilation error as all the implict objects (request,session,out,...) are&lt;br /&gt;not available in&lt;br /&gt;declarative part.Since we are trying to declare&lt;br /&gt;name=request.getParameter("name")&lt;br /&gt;it gives us compilation error as stating undefined variable or class name :&lt;br /&gt;request&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-94038536279591062?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/94038536279591062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/following-are-contents-of-testjsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/94038536279591062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/94038536279591062'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/following-are-contents-of-testjsp.html' title='The following are the contents of test.jsp'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8660882924910433081</id><published>2009-03-13T23:44:00.008-07:00</published><updated>2009-03-13T23:58:53.673-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>a.jsp</title><content type='html'>&lt;strong&gt;Question :a.jsp&lt;br /&gt;&lt;%!&lt;br /&gt;int x = 10;&lt;br /&gt;%&gt;&lt;br /&gt;b.jsp&lt;br /&gt;&lt;%@ include file="a.jsp" %&gt;&lt;br /&gt;&lt;%&lt;br /&gt;int x = 20;&lt;br /&gt;out.println("x:"+x);&lt;br /&gt;%&gt;&lt;br /&gt;When the above programme is invoked as http://localhost:8080/b.jsp,&lt;br /&gt;what is the output? (JSP)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :Compiler error as x is already initialised.&lt;br /&gt;When a.jsp file is included in b.jsp, all the variables of a.jsp are also&lt;br /&gt;invoked&lt;br /&gt;in b.jsp.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8660882924910433081?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8660882924910433081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/ajsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8660882924910433081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8660882924910433081'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/ajsp.html' title='a.jsp'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1271100388842113650</id><published>2009-03-13T23:44:00.007-07:00</published><updated>2009-03-13T23:57:21.527-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do you print the contents of a.jsp in b.jsp. How do you include the</title><content type='html'>&lt;strong&gt;Question :How do you print the contents of a.jsp in b.jsp. How do you include the&lt;br /&gt;file? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :a.jsp&lt;br /&gt;&lt;%!&lt;br /&gt;public int i=10;&lt;br /&gt;%&gt;&lt;br /&gt;b.jsp&lt;br /&gt;&lt;%@ include file="a.jsp" %&gt;&lt;br /&gt;&lt;%&lt;br /&gt;out.println(i);&lt;br /&gt;%&gt;&lt;br /&gt;do not use as this will include the file at runtime where as the above&lt;br /&gt;includes (directive include) the file at compile time&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1271100388842113650?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1271100388842113650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-you-print-contents-of-ajsp-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1271100388842113650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1271100388842113650'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-you-print-contents-of-ajsp-in.html' title='How do you print the contents of a.jsp in b.jsp. How do you include the'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-3420717419007375196</id><published>2009-03-13T23:44:00.006-07:00</published><updated>2009-03-13T23:50:37.915-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do you precompile a jsp page  (JSP)</title><content type='html'>&lt;strong&gt;Question :How do you precompile a jsp page? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :To precompile a JSP page, access the page with a query string of ?&lt;br /&gt;jsp_precompile&lt;br /&gt;http://www.javagalaxy.com:8080/RMI/index.jsp?jsp_precompile&lt;br /&gt;the jsp page will not get executed by this action.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-3420717419007375196?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/3420717419007375196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-you-precompile-jsp-page-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3420717419007375196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3420717419007375196'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-you-precompile-jsp-page-jsp.html' title='How do you precompile a jsp page  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-5433969690383425853</id><published>2009-03-13T23:44:00.005-07:00</published><updated>2009-03-13T23:49:26.930-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is the difference between a tag handler and a tag handler</title><content type='html'>&lt;strong&gt;Question :What is the difference between a tag handler and a tag handler&lt;br /&gt;class? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :The only difference between a tag handler and a tag handler class is that&lt;br /&gt;a tag handler is written in JSP syntax, while a tag handler class is written&lt;br /&gt;in the Java language.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-5433969690383425853?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/5433969690383425853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between-tag-handler.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5433969690383425853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5433969690383425853'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between-tag-handler.html' title='What is the difference between a tag handler and a tag handler'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8582826608548287448</id><published>2009-03-13T23:44:00.004-07:00</published><updated>2009-03-13T23:48:13.815-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is the difference between page and request scopes  (JSP)</title><content type='html'>&lt;strong&gt;Question :What is the difference between page and request scopes? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :If you specify scope as Page then its life span is until page is displayed or&lt;br /&gt;control is forwarded to a new page. Accessibility is current page only.&lt;br /&gt;But if u specify as Request, its life span is until the request has been&lt;br /&gt;completely processed and the response has been sent back to the user.&lt;br /&gt;Accessibility is current page and any included or for-warded pages&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8582826608548287448?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8582826608548287448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between-page-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8582826608548287448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8582826608548287448'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between-page-and.html' title='What is the difference between page and request scopes  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8039894386035732243</id><published>2009-03-13T23:44:00.003-07:00</published><updated>2009-03-13T23:47:16.363-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do you prevent the Creation of a Session in a JSP Page and</title><content type='html'>&lt;strong&gt;Question :How do you prevent the Creation of a Session in a JSP Page and&lt;br /&gt;why? (JSP)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :By default, a JSP page will automatically create a session for the request&lt;br /&gt;if one does not exist. However, sessions consume resources and if it is not&lt;br /&gt;necessary to maintain a session, one should not be created. For example,&lt;br /&gt;a marketing campaign may suggest the reader visit a web page for more&lt;br /&gt;information. If it is anticipated that a lot of traffic will hit that page, you&lt;br /&gt;may want to optimize the load on the machine by not creating useless&lt;br /&gt;sessions.&lt;br /&gt;The page directive is used to prevent a JSP page from automatically&lt;br /&gt;creating a session:&lt;br /&gt;&lt;%@ page session="false"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8039894386035732243?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8039894386035732243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-you-prevent-creation-of-session.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8039894386035732243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8039894386035732243'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-you-prevent-creation-of-session.html' title='How do you prevent the Creation of a Session in a JSP Page and'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8728724636333134148</id><published>2009-03-13T23:44:00.002-07:00</published><updated>2009-03-13T23:46:00.855-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can my JSP page communicate with an EJB Session Bean? (JSP)</title><content type='html'>&lt;strong&gt;Question :How can my JSP page communicate with an EJB Session Bean? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :The following is a code snippet that demonstrates how a JSP page can&lt;br /&gt;interact with an EJB session bean:&lt;br /&gt;&lt;%@ page import="javax.naming.*, javax.rmi.PortableRemoteObject,&lt;br /&gt;foo.AccountHome, foo.Account" %&gt;&lt;br /&gt;&lt;%!&lt;br /&gt;//declare a "global" reference to an instance of the home interface of the&lt;br /&gt;session bean&lt;br /&gt;AccountHome accHome=null;&lt;br /&gt;public void jspInit() {&lt;br /&gt;//obtain an instance of the home interface&lt;br /&gt;InitialContext cntxt = new InitialContext( );&lt;br /&gt;Object ref= cntxt.lookup("java:comp/env/ejb/AccountEJB");&lt;br /&gt;accHome =&lt;br /&gt;(AccountHome)PortableRemoteObject.narrow(ref,AccountHome.class);&lt;br /&gt;}&lt;br /&gt;%&gt;&lt;br /&gt;&lt;%&lt;br /&gt;//instantiate the session bean&lt;br /&gt;Account acct = accHome.create();&lt;br /&gt;//invoke the remote methods&lt;br /&gt;acct.doWhatever(...);&lt;br /&gt;// etc etc...&lt;br /&gt;%&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8728724636333134148?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8728724636333134148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-my-jsp-page-communicate-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8728724636333134148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8728724636333134148'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-my-jsp-page-communicate-with.html' title='How can my JSP page communicate with an EJB Session Bean? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-2402145160618960705</id><published>2009-03-13T23:44:00.001-07:00</published><updated>2009-03-13T23:44:56.966-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do you pass an InitParameter to a JSP? (JSP)</title><content type='html'>&lt;strong&gt;Question :How do you pass an InitParameter to a JSP? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :The JspPage interface defines the jspInit() and jspDestroy() method which&lt;br /&gt;the page writer can use in their pages and are invoked in much the same&lt;br /&gt;manner as the init() and destory() methods of a servlet. The example page&lt;br /&gt;below enumerates through all the parameters and prints them to the&lt;br /&gt;console.&lt;br /&gt;&lt;%@ page import="java.util.*" %&gt;&lt;br /&gt;&lt;%!&lt;br /&gt;ServletConfig cfg =null;&lt;br /&gt;public void jspInit(){&lt;br /&gt;ServletConfig cfg=getServletConfig();&lt;br /&gt;for (Enumeration e=cfg.getInitParameterNames(); e.hasMoreElements();)&lt;br /&gt;{&lt;br /&gt;String name=(String)e.nextElement();&lt;br /&gt;String value = cfg.getInitParameter(name);&lt;br /&gt;System.out.println(name+"="+value);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;%&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-2402145160618960705?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/2402145160618960705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-you-pass-initparameter-to-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2402145160618960705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2402145160618960705'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-you-pass-initparameter-to-jsp.html' title='How do you pass an InitParameter to a JSP? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1736738363106474923</id><published>2009-03-13T23:35:00.000-07:00</published><updated>2009-03-13T23:41:44.198-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can I get to print the stacktrace for an exception occuring within my</title><content type='html'>Question :How can I get to print the stacktrace for an exception occuring within my&lt;br /&gt;JSP page? (JSP)&lt;br /&gt;&lt;br /&gt;Answer :By printing out the exception's stack trace, you can usually diagonse a&lt;br /&gt;problem better when debugging JSP pages. By looking at a stack trace, a&lt;br /&gt;programmer should be able to discern which method threw the exception&lt;br /&gt;and which method called that method. However, you cannot print the&lt;br /&gt;stacktrace using the JSP out implicit variable, which is of type JspWriter.&lt;br /&gt;You will have to use a PrintWriter object instead. The following snippet&lt;br /&gt;demonstrates how you can print a stacktrace from within a JSP error page:&lt;br /&gt;&lt;%@ page isErrorPage="true" %&gt;&lt;br /&gt;&lt;%&lt;br /&gt;out.println("&lt;br /&gt;");&lt;br /&gt;PrintWriter pw = response.getWriter();&lt;br /&gt;exception.printStackTrace(pw);&lt;br /&gt;out.println("&lt;br /&gt;");&lt;br /&gt;%&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1736738363106474923?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1736738363106474923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-get-to-print-stacktrace-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1736738363106474923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1736738363106474923'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-get-to-print-stacktrace-for.html' title='How can I get to print the stacktrace for an exception occuring within my'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-3296315107062171796</id><published>2009-03-13T06:53:00.000-07:00</published><updated>2009-03-13T06:55:02.693-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can I prevent the word "null" from appearing in my HTML input text</title><content type='html'>&lt;strong&gt;Question :How can I prevent the word "null" from appearing in my HTML input text&lt;br /&gt;fields when I populate them with a resultset that has null values? (JSP)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :You could make a simple wrapper function, like&lt;br /&gt;&lt;%!&lt;br /&gt;String blanknull(String s) {&lt;br /&gt;return (s == null) ? "" : s;&lt;br /&gt;}&lt;br /&gt;%&gt;&lt;br /&gt;then use it inside your JSP form, like&lt;br /&gt;&lt;input type="text" name="shoesize" value="&lt;%=blanknull(shoesize)%&lt;br /&gt;&gt;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-3296315107062171796?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/3296315107062171796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-prevent-word-null-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3296315107062171796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3296315107062171796'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-prevent-word-null-from.html' title='How can I prevent the word &quot;null&quot; from appearing in my HTML input text'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-271304202542674503</id><published>2009-03-13T06:51:00.000-07:00</published><updated>2009-03-13T06:52:02.202-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do I have the JSP-generated servlet subclass my own custom servlet</title><content type='html'>&lt;strong&gt;Question :How do I have the JSP-generated servlet subclass my own custom servlet&lt;br /&gt;class, instead of the default? (JSP)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :One should be very careful when having JSP pages extend custom servlet&lt;br /&gt;classes as opposed to the default one generated by the JSP engine. In&lt;br /&gt;doing so, you may lose out on any advanced optimization that may be&lt;br /&gt;provided by the JSP engine. In any case, your new superclass has to fulfill&lt;br /&gt;the contract with the JSP engine by:&lt;br /&gt;Implementing the HttpJspPage interface, if the protocol used is HTTP, or&lt;br /&gt;implementing JspPage otherwise Ensuring that all the methods in the&lt;br /&gt;Servlet interface are declared final Additionally, your servlet superclass&lt;br /&gt;also needs to do the following:&lt;br /&gt;The service() method has to invoke the _jspService() method&lt;br /&gt;The init() method has to invoke the jspInit() method&lt;br /&gt;The destroy() method has to invoke jspDestroy()&lt;br /&gt;If any of the above conditions are not satisfied, the JSP engine may throw&lt;br /&gt;a translation error.&lt;br /&gt;Once the superclass has been developed, you can have your JSP extend it&lt;br /&gt;as follows:&lt;br /&gt;&lt;%@ page extends="packageName.ServletName" %&lt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-271304202542674503?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/271304202542674503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-have-jsp-generated-servlet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/271304202542674503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/271304202542674503'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-have-jsp-generated-servlet.html' title='How do I have the JSP-generated servlet subclass my own custom servlet'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-4049249124114198816</id><published>2009-03-13T06:48:00.002-07:00</published><updated>2009-03-13T06:49:40.636-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How does a servlet communicate with a JSP page  (JSP)</title><content type='html'>&lt;strong&gt;Question :How does a servlet communicate with a JSP page? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :The following code snippet shows how a servlet instantiates a bean and&lt;br /&gt;initializes it with FORM data posted by a browser. The bean is then placed&lt;br /&gt;into the request, and the call is then forwarded to the JSP page, Bean1.jsp,&lt;br /&gt;by means of a request dispatcher for downstream processing.&lt;br /&gt;public void doPost (HttpServletRequest request, HttpServletResponse&lt;br /&gt;response) {&lt;br /&gt;try {&lt;br /&gt;govi.FormBean f = new govi.FormBean();&lt;br /&gt;String id = request.getParameter("id");&lt;br /&gt;f.setName(request.getParameter("name"));&lt;br /&gt;f.setAddr(request.getParameter("addr"));&lt;br /&gt;f.setAge(request.getParameter("age"));&lt;br /&gt;//use the id to compute&lt;br /&gt;//additional bean properties like info&lt;br /&gt;//maybe perform a db query, etc.&lt;br /&gt;// . . .&lt;br /&gt;f.setPersonalizationInfo(info);&lt;br /&gt;request.setAttribute("fBean",f);&lt;br /&gt;getServletConfig().getServletContext().getRequestDispatcher&lt;br /&gt;("/jsp/Bean1.jsp").forward(request, response);&lt;br /&gt;} catch (Exception ex) {&lt;br /&gt;. . .&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;The JSP page Bean1.jsp can then process fBean, after first extracting it&lt;br /&gt;from the default request scope via the useBean action.&lt;br /&gt;jsp:useBean id="fBean" class="govi.FormBean" scope="request"/&lt;br /&gt;jsp:getProperty name="fBean" property="name" / jsp:getProperty&lt;br /&gt;name="fBean" property="addr" / jsp:getProperty name="fBean"&lt;br /&gt;property="age" / jsp:getProperty name="fBean"&lt;br /&gt;property="personalizationInfo" /&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-4049249124114198816?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/4049249124114198816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-does-servlet-communicate-with-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4049249124114198816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4049249124114198816'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-does-servlet-communicate-with-jsp.html' title='How does a servlet communicate with a JSP page  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8922406653733842365</id><published>2009-03-13T06:48:00.001-07:00</published><updated>2009-03-13T06:48:44.218-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can I set a cookie and delete a cookie from within a JSP page  (JSP)</title><content type='html'>&lt;strong&gt;Question :How can I set a cookie and delete a cookie from within a JSP page? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :A cookie, mycookie, can be deleted using the following scriptlet:&lt;br /&gt;&lt;%&lt;br /&gt;//creating a cookie&lt;br /&gt;Cookie mycookie = new Cookie("aName","aValue");&lt;br /&gt;response.addCookie(mycookie);&lt;br /&gt;//delete a cookie&lt;br /&gt;Cookie killMyCookie = new Cookie("mycookie", null);&lt;br /&gt;killMyCookie.setMaxAge(0);&lt;br /&gt;killMyCookie.setPath("/");&lt;br /&gt;response.addCookie(killMyCookie);&lt;br /&gt;%&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8922406653733842365?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8922406653733842365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-set-cookie-and-delete-cookie.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8922406653733842365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8922406653733842365'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-set-cookie-and-delete-cookie.html' title='How can I set a cookie and delete a cookie from within a JSP page  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8287842440594253897</id><published>2009-03-13T06:47:00.000-07:00</published><updated>2009-03-13T06:48:01.486-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Is there a way I can set the inactivity lease period on a per-session basis</title><content type='html'>&lt;strong&gt;Question :Is there a way I can set the inactivity lease period on a per-session basis?&lt;br /&gt;(JSP)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :Typically, a default inactivity lease period for all sessions is set within&lt;br /&gt;your JSP engine admin screen or associated properties file. However, if&lt;br /&gt;your JSP engine supports the Servlet 2.1 API, you can manage the&lt;br /&gt;inactivity lease period on a per-session basis. This is done by invoking the&lt;br /&gt;HttpSession.setMaxInactiveInterval() method, right after the session has&lt;br /&gt;been created. For example:&lt;br /&gt;&lt;%&lt;br /&gt;session.setMaxInactiveInterval(300);&lt;br /&gt;%&gt;&lt;br /&gt;would reset the inactivity period for this session to 5 minutes. The&lt;br /&gt;inactivity interval is set in seconds.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8287842440594253897?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8287842440594253897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-there-way-i-can-set-inactivity-lease.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8287842440594253897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8287842440594253897'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-there-way-i-can-set-inactivity-lease.html' title='Is there a way I can set the inactivity lease period on a per-session basis'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1639841015677996084</id><published>2009-03-13T06:46:00.001-07:00</published><updated>2009-03-13T06:46:57.659-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can I declare methods within my JSP page? (JSP)</title><content type='html'>&lt;strong&gt;Question :How can I declare methods within my JSP page? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :You can declare methods for use within your JSP page as declarations.&lt;br /&gt;The methods can then be invoked within any other methods you declare,&lt;br /&gt;or within JSP scriptlets and expressions.&lt;br /&gt;Do note that you do not have direct access to any of the JSP implicit&lt;br /&gt;objects like request, response, session and so forth from within JSP&lt;br /&gt;methods. However, you should be able to pass any of the implicit JSP&lt;br /&gt;variables as parameters to the methods you declare. For example:&lt;br /&gt;&lt;%!&lt;br /&gt;public String whereFrom(HttpServletRequest req) {&lt;br /&gt;HttpSession ses = req.getSession();&lt;br /&gt;...&lt;br /&gt;return req.getRemoteHost();&lt;br /&gt;}&lt;br /&gt;%&gt;&lt;br /&gt;&lt;%&lt;br /&gt;out.print("Hi there, I see that you are coming in from ");&lt;br /&gt;%&gt;&lt;br /&gt;&lt;%= whereFrom(request) %&gt;&lt;br /&gt;Another Example&lt;br /&gt;file1.jsp:&lt;br /&gt;&lt;%@page contentType="text/html"%&gt;&lt;br /&gt;&lt;%!&lt;br /&gt;public void test(JspWriter writer) throws IOException{&lt;br /&gt;writer.println("Hello!");&lt;br /&gt;}&lt;br /&gt;%&gt;&lt;br /&gt;file2.jsp&lt;br /&gt;&lt;%@include file="file1.jsp"%&gt;&lt;br /&gt;&lt;html&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;%test(out);% &gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1639841015677996084?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1639841015677996084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-declare-methods-within-my-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1639841015677996084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1639841015677996084'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-declare-methods-within-my-jsp.html' title='How can I declare methods within my JSP page? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8284473063961883609</id><published>2009-03-13T06:43:00.000-07:00</published><updated>2009-03-13T06:46:00.968-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can I enable session tracking for JSP pages if the browser has</title><content type='html'>&lt;strong&gt;Question :How can I enable session tracking for JSP pages if the browser has&lt;br /&gt;disabled cookies? (JSP)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer :We know that session tracking uses cookies by default to associate a&lt;br /&gt;session identifier with a unique user. If the browser does not support&lt;br /&gt;cookies, or if cookies are disabled, you can still enable session tracking&lt;br /&gt;using URL rewriting.&lt;br /&gt;URL rewriting essentially includes the session ID within the link itself as a&lt;br /&gt;name/value pair. However, for this to be effective, you need to append the&lt;br /&gt;session ID for each and every link that is part of your servlet response.&lt;br /&gt;Adding the session ID to a link is greatly simplified by means of of a couple&lt;br /&gt;of methods: response.encodeURL() associates a session ID with a given&lt;br /&gt;URL, and if you are using redirection, response.encodeRedirectURL() can&lt;br /&gt;be used by giving the redirected URL as input.&lt;br /&gt;Both encodeURL() and encodeRedirectedURL() first determine whether&lt;br /&gt;cookies are supported by the browser; if so, the input URL is returned&lt;br /&gt;unchanged since the session ID will be persisted as a cookie.&lt;br /&gt;Consider the following example, in which two JSP files, say hello1.jsp and&lt;br /&gt;hello2.jsp, interact with each other. Basically, we create a new session&lt;br /&gt;within hello1.jsp and place an object within this session. The user can then&lt;br /&gt;traverse to hello2.jsp by clicking on the link present within the page.Within&lt;br /&gt;hello2.jsp, we simply extract the object that was earlier placed in the&lt;br /&gt;session and display its contents. Notice that we invoke the encodeURL()&lt;br /&gt;within hello1.jsp on the link used to invoke hello2.jsp; if cookies are&lt;br /&gt;disabled, the session ID is automatically appended to the URL, allowing&lt;br /&gt;hello2.jsp to still retrieve the session object.&lt;br /&gt;Try this example first with cookies enabled. Then disable cookie support,&lt;br /&gt;restart the brower, and try again. Each time you should see the&lt;br /&gt;maintenance of the session across pages.&lt;br /&gt;Do note that to get this example to work with cookies disabled at the&lt;br /&gt;browser, your JSP engine has to support URL rewriting.&lt;br /&gt;hello1.jsp&lt;br /&gt;&lt;%@ page session="true" %&gt;&lt;br /&gt;&lt;%&lt;br /&gt;Integer num = new Integer(100);&lt;br /&gt;session.putValue("num",num);&lt;br /&gt;String url =response.encodeURL("hello2.jsp");&lt;br /&gt;%&gt;&lt;br /&gt;&lt;strong&gt;&lt;a href='&lt;%=url%&gt;'&gt;&lt;/strong&gt;hello2.jsp&lt;/a&gt;&lt;br /&gt;hello2.jsp&lt;br /&gt;&lt;%@ page session="true" %&gt;&lt;br /&gt;&lt;%&lt;br /&gt;Integer i= (Integer )session.getValue("num");&lt;br /&gt;out.println("Num value in session is "+i.intValue());&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8284473063961883609?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8284473063961883609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-enable-session-tracking-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8284473063961883609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8284473063961883609'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-enable-session-tracking-for.html' title='How can I enable session tracking for JSP pages if the browser has'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8860527100746541917</id><published>2009-03-13T06:41:00.000-07:00</published><updated>2009-03-13T06:42:36.610-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do I use a scriptlet to initialize a newly instantiated bean  (JSP)</title><content type='html'>&lt;strong&gt;Question :How do I use a scriptlet to initialize a newly instantiated bean? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :A jsp:useBean action may optionally have a body. If the body is specified,&lt;br /&gt;its contents will be automatically invoked when the specified bean is&lt;br /&gt;instantiated. Typically, the body will contain scriptlets or jsp:setProperty&lt;br /&gt;tags to initialize the newly instantiated bean, although you are not&lt;br /&gt;restricted to using those alone.&lt;br /&gt;The following example shows the "today" property of the Foo bean&lt;br /&gt;initialized to the current date when it is instantiated. Note that here, we&lt;br /&gt;make use of a JSP expression within the jsp:setProperty action.&lt;br /&gt;&lt;jsp:useBean id="foo" class="com.Bar.Foo" &gt;&lt;br /&gt;&lt;jsp:setProperty name="foo" property="today" value="&lt;&lt;br /&gt;%=java.text.DateFormat.getDateInstance().format(new java.util.Date())&lt;br /&gt;%&gt;"/ &gt;&lt;br /&gt;&lt;%-- scriptlets calling bean setter methods go here --%&gt;&lt;br /&gt;&lt;/jsp:useBean &gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8860527100746541917?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8860527100746541917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-use-scriptlet-to-initialize.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8860527100746541917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8860527100746541917'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-use-scriptlet-to-initialize.html' title='How do I use a scriptlet to initialize a newly instantiated bean  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1791375575314966548</id><published>2009-03-13T06:38:00.000-07:00</published><updated>2009-03-13T06:41:04.433-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Response has already been commited error. What does it mean  (JSP)</title><content type='html'>&lt;strong&gt;Question :Response has already been commited error. What does it mean? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :This error show only when you try to redirect a page after you already&lt;br /&gt;have written something in your page. This happens because HTTP&lt;br /&gt;specification force the header to be set up before the lay out of the page&lt;br /&gt;can be shown (to make sure of how it should be displayed...contenttype="&lt;br /&gt;text/html" or "text/xml" or "plain-text" or "image/jpg", etc...) When&lt;br /&gt;you try to send a redirect status (Number is line_status_402), your HTTP&lt;br /&gt;server cannot send it right now if it hasn't finished to set up the header. If&lt;br /&gt;not starter to set up the header, there are no problems, but if it 's already&lt;br /&gt;begin to set up the header, then your HTTP server expects these headers to&lt;br /&gt;be finished setting up and it cannot be the case if the stream of the page is&lt;br /&gt;not over... In this last case it's like you have a file started with &lt;HTML&lt;br /&gt;Tag&gt; &lt;Some Headers&gt; &lt;Body&gt; some output (like testing your&lt;br /&gt;variables...) ... and before you indicate that the file is over (and before the&lt;br /&gt;size of the page can be setted up in the header), you try to send a redirect&lt;br /&gt;status... It s simply impossible due to the specification of HTTP 1.0 and 1.1&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1791375575314966548?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1791375575314966548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/response-has-already-been-commited.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1791375575314966548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1791375575314966548'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/response-has-already-been-commited.html' title='Response has already been commited error. What does it mean  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-3582121022139281217</id><published>2009-03-13T06:25:00.000-07:00</published><updated>2009-03-13T06:38:13.699-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do I use comments within a JSP page? (JSP)</title><content type='html'>&lt;strong&gt;Question :How do I use comments within a JSP page? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :You can use "JSP-style" comments to selectively block out code while&lt;br /&gt;debugging or simply to comment your scriptlets. JSP comments are not&lt;br /&gt;visible at the client. For example:&lt;br /&gt;&lt;%-- the scriptlet is now commented out&lt;br /&gt;&lt;%&lt;br /&gt;out.println("Hello World");&lt;br /&gt;%&gt;&lt;br /&gt;--%&gt;&lt;br /&gt;You can also use HTML-style comments anywhere within your JSP page.&lt;br /&gt;These comments are visible at the client. For example:&lt;br /&gt;&lt;!-- (c) 2004 javagalaxy.com --&gt;&lt;br /&gt;Of course, you can also use comments supported by your JSP scripting&lt;br /&gt;language within your scriptlets. For example, assuming Java is the&lt;br /&gt;scripting language, you can have:&lt;br /&gt;&lt;%&lt;br /&gt;//some comment&lt;br /&gt;/**&lt;br /&gt;yet another comment&lt;br /&gt;**/&lt;br /&gt;%&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-3582121022139281217?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/3582121022139281217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-use-comments-within-jsp-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3582121022139281217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3582121022139281217'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-use-comments-within-jsp-page.html' title='How do I use comments within a JSP page? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-3655576252804235557</id><published>2009-03-13T06:24:00.000-07:00</published><updated>2009-03-13T06:25:33.591-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do I prevent the output of my JSP or Servlet pages from being</title><content type='html'>&lt;strong&gt;Question :How do I prevent the output of my JSP or Servlet pages from being&lt;br /&gt;cached by the browser? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :You will need to set the appropriate HTTP header attributes to prevent&lt;br /&gt;the dynamic content output by the JSP page from being cached by the&lt;br /&gt;browser. Just execute the following scriptlet at the beginning of your JSP&lt;br /&gt;pages to prevent them from being cached at the browser. You need both&lt;br /&gt;the statements to take care of some of the older browser versions.&lt;br /&gt;&lt;%&lt;br /&gt;response.setHeader("Cache-Control","no-store"); //HTTP 1.1&lt;br /&gt;response.setHeader("Pragma","no-cache"); //HTTP 1.0&lt;br /&gt;response.setDateHeader ("Expires", 0); //prevents caching at the proxy&lt;br /&gt;server&lt;br /&gt;%&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-3655576252804235557?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/3655576252804235557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-prevent-output-of-my-jsp-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3655576252804235557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3655576252804235557'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-prevent-output-of-my-jsp-or.html' title='How do I prevent the output of my JSP or Servlet pages from being'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8957338052493458055</id><published>2009-03-13T06:23:00.000-07:00</published><updated>2009-03-13T06:24:47.872-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How does JSP handle run-time exceptions  (JSP)</title><content type='html'>&lt;strong&gt;Question :How does JSP handle run-time exceptions? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :You can use the errorPage attribute of the page directive to have&lt;br /&gt;uncaught run-time exceptions automatically forwarded to an error&lt;br /&gt;processing page. For example:&lt;br /&gt;&lt;%@ page errorPage="error.jsp" %&gt;&lt;br /&gt;redirects the browser to the JSP page error.jsp if an uncaught exception is&lt;br /&gt;encountered during request processing. Within error.jsp, if you indicate&lt;br /&gt;that it is an error-processing page, via the directive:&lt;br /&gt;&lt;%@ page isErrorPage="true" %&gt;&lt;br /&gt;the Throwable object describing the exception may be accessed within the&lt;br /&gt;error page via the exception implicit object.&lt;br /&gt;Note: You must always use a relative URL as the value for the errorPage&lt;br /&gt;attribute.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8957338052493458055?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8957338052493458055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-does-jsp-handle-run-time-exceptions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8957338052493458055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8957338052493458055'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-does-jsp-handle-run-time-exceptions.html' title='How does JSP handle run-time exceptions  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8686072802344940473</id><published>2009-03-13T06:22:00.000-07:00</published><updated>2009-03-13T06:23:27.264-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can I implement a thread-safe JSP page? What are the advantages</title><content type='html'>&lt;strong&gt;Question :How can I implement a thread-safe JSP page? What are the advantages&lt;br /&gt;and Disadvantages of using it? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :You can make your JSPs thread-safe by having them implement the&lt;br /&gt;SingleThreadModel interface. This is done by adding the directive&lt;br /&gt;&lt;%@ page isThreadSafe="false" %&gt; within your JSP page.&lt;br /&gt;With this, instead of a single instance of the servlet generated for your JSP&lt;br /&gt;page loaded in memory, you will have N instances of the servlet loaded&lt;br /&gt;and initialized, with the service method of each instance effectively&lt;br /&gt;synchronized. You can typically control the number of instances (N) that&lt;br /&gt;are instantiated for all servlets implementing SingleThreadModel through&lt;br /&gt;the admin screen for your JSP engine.&lt;br /&gt;More importantly, avoid using the &lt;%! DECLARE %&gt; tag for variables. If&lt;br /&gt;you do use this tag, then you should set isThreadSafe to true, as&lt;br /&gt;mentioned above. Otherwise, all requests to that page will access those&lt;br /&gt;variables, causing a nasty race condition.&lt;br /&gt;SingleThreadModel is not recommended for normal use. There are many&lt;br /&gt;pitfalls, including the example above of not being able to use &lt;%! %&gt;.&lt;br /&gt;You should try really hard to make them thread-safe the old fashioned&lt;br /&gt;way: by making them thread-safe&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8686072802344940473?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8686072802344940473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-implement-thread-safe-jsp_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8686072802344940473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8686072802344940473'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-implement-thread-safe-jsp_13.html' title='How can I implement a thread-safe JSP page? What are the advantages'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1403705160233233556</id><published>2009-03-13T06:21:00.002-07:00</published><updated>2009-03-13T06:22:33.947-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Is JSP technology extensible  (JSP)</title><content type='html'>&lt;strong&gt;Question :Is JSP technology extensible? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :YES. JSP technology is extensible through the development of custom&lt;br /&gt;actions, or tags, which are encapsulated in tag libraries&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1403705160233233556?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1403705160233233556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-jsp-technology-extensible-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1403705160233233556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1403705160233233556'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-jsp-technology-extensible-jsp.html' title='Is JSP technology extensible  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1728943530801013360</id><published>2009-03-13T06:21:00.001-07:00</published><updated>2009-03-13T06:21:45.151-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What are the implicit objects  (JSP)</title><content type='html'>&lt;strong&gt;Question :What are the implicit objects? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Implicit objects are objects that are created by the web container and&lt;br /&gt;contain information related to a particular request, page, or application.&lt;br /&gt;They are:&lt;br /&gt;request&lt;br /&gt;response&lt;br /&gt;pageContext&lt;br /&gt;session&lt;br /&gt;application&lt;br /&gt;out&lt;br /&gt;config&lt;br /&gt;page&lt;br /&gt;exception&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1728943530801013360?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1728943530801013360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-implicit-objects-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1728943530801013360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1728943530801013360'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-implicit-objects-jsp.html' title='What are the implicit objects  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1526195910811000646</id><published>2009-03-13T06:20:00.001-07:00</published><updated>2009-03-13T06:20:49.571-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can you store international / Unicode characters into a cookie  (JSP)</title><content type='html'>&lt;strong&gt;Question :How can you store international / Unicode characters into a cookie? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :One way is, before storing the cookie URLEncode it.&lt;br /&gt;URLEnocder.encoder(str);&lt;br /&gt;And use URLDecoder.decode(str) when you get the stored cookie.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1526195910811000646?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1526195910811000646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-you-store-international-unicode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1526195910811000646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1526195910811000646'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-you-store-international-unicode.html' title='How can you store international / Unicode characters into a cookie  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-7728864020429757954</id><published>2009-03-13T06:19:00.000-07:00</published><updated>2009-03-13T06:20:05.166-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Can I invoke a JSP error page from a servlet? (JSP)</title><content type='html'>&lt;strong&gt;Question :Can I invoke a JSP error page from a servlet? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Yes, you can invoke the JSP error page and pass the exception object to&lt;br /&gt;it from within a servlet. The trick is to create a request dispatcher for the&lt;br /&gt;JSP error page, and pass the exception object as a&lt;br /&gt;javax.servlet.jsp.jspException request attribute. However, note that you&lt;br /&gt;can do this from only within controller servlets. If your servlet opens an&lt;br /&gt;OutputStream or PrintWriter, the JSP engine will throw the following&lt;br /&gt;translation error:&lt;br /&gt;java.lang.IllegalStateException: Cannot forward as OutputStream or Writer&lt;br /&gt;has already been obtained&lt;br /&gt;The following code snippet demonstrates the invocation of a JSP error page&lt;br /&gt;from within a controller servlet:&lt;br /&gt;protected void sendErrorRedirect(HttpServletRequest request,&lt;br /&gt;HttpServletResponse response, String errorPageURL, Throwable e) throws&lt;br /&gt;ServletException, IOException {&lt;br /&gt;request.setAttribute ("javax.servlet.jsp.jspException", e);&lt;br /&gt;getServletConfig().getServletContext().&lt;br /&gt;getRequestDispatcher(errorPageURL).forward(request, response);&lt;br /&gt;}&lt;br /&gt;public void doPost(HttpServletRequest request, HttpServletResponse&lt;br /&gt;response) {&lt;br /&gt;try {&lt;br /&gt;// do something&lt;br /&gt;} catch (Exception ex) {&lt;br /&gt;try {&lt;br /&gt;sendErrorRedirect(request,response,"/jsp/MyErrorPage.jsp",ex);&lt;br /&gt;} catch (Exception e) {&lt;br /&gt;e.printStackTrace();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-7728864020429757954?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/7728864020429757954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-i-invoke-jsp-error-page-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7728864020429757954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7728864020429757954'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-i-invoke-jsp-error-page-from.html' title='Can I invoke a JSP error page from a servlet? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-5949219710512959039</id><published>2009-03-13T06:18:00.000-07:00</published><updated>2009-03-13T06:19:17.009-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do I instantiate a bean whose constructor accepts parameters using</title><content type='html'>&lt;strong&gt;Question :How do I instantiate a bean whose constructor accepts parameters using&lt;br /&gt;the useBean tag? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Consider the following bean: package bar;&lt;br /&gt;public class FooBean {&lt;br /&gt;public FooBean(SomeObj arg) {&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;//getters and setters here&lt;br /&gt;}&lt;br /&gt;The only way you can instantiate this bean within your JSP page is to use a&lt;br /&gt;scriptlet. For example, the following snippet creates the bean with session&lt;br /&gt;scope:&lt;br /&gt;&amp;l;% SomeObj x = new SomeObj(...);&lt;br /&gt;bar.FooBean foobar = new FooBean(x);&lt;br /&gt;session.putValue("foobar",foobar);&lt;br /&gt;%&gt; You can now access this bean within any other page that is part of the&lt;br /&gt;same session as: &amp;l;%&lt;br /&gt;bar.FooBean foobar = session.getValue("foobar");&lt;br /&gt;%&gt;&lt;br /&gt;To give the bean "application scope", you will have to place it within the&lt;br /&gt;ServletContext as:&lt;br /&gt;&amp;l;%&lt;br /&gt;application.setAttribute("foobar",foobar);&lt;br /&gt;%&gt;&lt;br /&gt;To give the bean "request scope", you will have to place it within the&lt;br /&gt;request object as:&lt;br /&gt;&amp;l;%&lt;br /&gt;request.setAttribute("foobar",foobar);&lt;br /&gt;%&gt;&lt;br /&gt;If you do not place the bean within the request, session or application&lt;br /&gt;scope, the bean can be accessed only within the current JSP page (page&lt;br /&gt;scope).&lt;br /&gt;Once the bean is instantiated, it can be accessed in the usual way:&lt;br /&gt;jsp:getProperty name="foobar" property="someProperty"/ jsp:setProperty&lt;br /&gt;name="foobar" property="someProperty" value="someValue"/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-5949219710512959039?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/5949219710512959039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-instantiate-bean-whose.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5949219710512959039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5949219710512959039'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-instantiate-bean-whose.html' title='How do I instantiate a bean whose constructor accepts parameters using'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-2725480547359458167</id><published>2009-03-13T06:17:00.000-07:00</published><updated>2009-03-13T06:18:11.003-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Is there a way to reference the "this" variable within a JSP page? (JSP)</title><content type='html'>&lt;strong&gt;Question :Is there a way to reference the "this" variable within a JSP page? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Yes, there is. Under JSP 1.0, the page implicit object is equivalent to&lt;br /&gt;"this", and returns a reference to the servlet generated by the JSP page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-2725480547359458167?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/2725480547359458167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-there-way-to-reference-this-variable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2725480547359458167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2725480547359458167'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-there-way-to-reference-this-variable.html' title='Is there a way to reference the &quot;this&quot; variable within a JSP page? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-6077791045765685124</id><published>2009-03-13T06:16:00.000-07:00</published><updated>2009-03-13T06:17:30.371-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can I get to view any compilation/parsing errors at the client while</title><content type='html'>&lt;strong&gt;Question :How can I get to view any compilation/parsing errors at the client while&lt;br /&gt;developing JSP pages? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :With JSWDK 1.0, set the following servlet initialization property within the&lt;br /&gt;\WEB-INF\servlets.properties file for your application:&lt;br /&gt;jsp.initparams=sendErrToClient=true&lt;br /&gt;This will cause any compilation/parsing errors to be sent as part of the&lt;br /&gt;response to the client.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-6077791045765685124?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/6077791045765685124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-get-to-view-any.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6077791045765685124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6077791045765685124'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-get-to-view-any.html' title='How can I get to view any compilation/parsing errors at the client while'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-418841868583423084</id><published>2009-03-13T06:14:00.002-07:00</published><updated>2009-03-13T06:16:37.400-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Can I stop JSP execution while in the midst of processing a request  (JSP)</title><content type='html'>&lt;strong&gt;Question :Can I stop JSP execution while in the midst of processing a request? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Yes. Preemptive termination of request processing on an error condition&lt;br /&gt;is a good way to maximize the throughput of a high-volume JSP engine.&lt;br /&gt;The trick (asuming Java is your scripting language) is to use the return&lt;br /&gt;statement when you want to terminate further processing. For example,&lt;br /&gt;consider:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-418841868583423084?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/418841868583423084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-i-stop-jsp-execution-while-in-midst.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/418841868583423084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/418841868583423084'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-i-stop-jsp-execution-while-in-midst.html' title='Can I stop JSP execution while in the midst of processing a request  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-7405236728724874753</id><published>2009-03-13T06:14:00.001-07:00</published><updated>2009-03-13T06:14:51.213-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What's a better approach for enabling thread-safe servlets and JSPs</title><content type='html'>&lt;strong&gt;Question :What's a better approach for enabling thread-safe servlets and JSPs?&lt;br /&gt;SingleThreadModel Interface or Synchronization? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Although the SingleThreadModel technique is easy to use, and works well&lt;br /&gt;for low volume sites, it does not scale well. If you anticipate your users to&lt;br /&gt;increase in the future, you may be better off implementing explicit&lt;br /&gt;synchronization for your shared data. The key however, is to effectively&lt;br /&gt;minimize the amount of code that is synchronzied so that you take&lt;br /&gt;maximum advantage of multithreading.&lt;br /&gt;Also, note that SingleThreadModel is pretty resource intensive from the&lt;br /&gt;server's perspective. The most serious issue however is when the number&lt;br /&gt;of concurrent requests exhaust the servlet instance pool. In that case, all&lt;br /&gt;the unserviced requests are queued until something becomes free - which&lt;br /&gt;results in poor performance. Since the usage is non-deterministic, it may&lt;br /&gt;not help much even if you did add more memory and increased the size of&lt;br /&gt;the instance pool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-7405236728724874753?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/7405236728724874753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/whats-better-approach-for-enabling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7405236728724874753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7405236728724874753'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/whats-better-approach-for-enabling.html' title='What&apos;s a better approach for enabling thread-safe servlets and JSPs'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1908443620725064645</id><published>2009-03-13T06:13:00.000-07:00</published><updated>2009-03-13T06:14:04.992-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Can you make use of a ServletOutputStream object from within a JSP page (JSP)</title><content type='html'>&lt;strong&gt;Question :Can you make use of a ServletOutputStream object from within a JSP&lt;br /&gt;page? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :No. You are supposed to make use of only a JSPWriter object (given to&lt;br /&gt;you in the form of the implicit object out) for replying to clients. A&lt;br /&gt;JSPWriter can be viewed as a buffered version of the stream object&lt;br /&gt;returned by response.getWriter(), although from an implementational&lt;br /&gt;perspective, it is not. A page author can always disable the default&lt;br /&gt;buffering for any page using a page directive as:&lt;br /&gt;&lt;%@ page buffer="none" %&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1908443620725064645?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1908443620725064645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-you-make-use-of-servletoutputstream.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1908443620725064645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1908443620725064645'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-you-make-use-of-servletoutputstream.html' title='Can you make use of a ServletOutputStream object from within a JSP page (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-5088844512465836248</id><published>2009-03-13T06:12:00.000-07:00</published><updated>2009-03-13T06:13:00.747-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Can a JSP page instantiate a serialized bean  (JSP)</title><content type='html'>&lt;strong&gt;Question :Can a JSP page instantiate a serialized bean? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :No problem! The useBean action specifies the beanName attribute, which&lt;br /&gt;can be used for indicating a serialized bean. For example:&lt;br /&gt;&lt;jsp:usebean id="shop" type="shopping.CD" beanname="CD"&gt;&lt;br /&gt;&lt;jsp:getproperty name="shop" property="album"&gt;&lt;br /&gt;A couple of important points to note. Although you would have to name&lt;br /&gt;your serialized file "filename.ser", you only indicate "filename" as the value&lt;br /&gt;for the beanName attribute. Also, you will have to place your serialized file&lt;br /&gt;within the WEB-INF\jsp\beans directory for it to be located by the JSP&lt;br /&gt;engine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-5088844512465836248?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/5088844512465836248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-jsp-page-instantiate-serialized.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5088844512465836248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5088844512465836248'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-jsp-page-instantiate-serialized.html' title='Can a JSP page instantiate a serialized bean  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-7323717154200115709</id><published>2009-03-13T06:11:00.000-07:00</published><updated>2009-03-13T06:12:05.050-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do I perform browser redirection from a JSP page? (JSP)</title><content type='html'>&lt;strong&gt;Question :How do I perform browser redirection from a JSP page? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :You can use the response implicit object to redirect the browser to a&lt;br /&gt;different resource, as:&lt;br /&gt;response.sendRedirect("http://www.foo.com/path/error.html");&lt;br /&gt;You can also physically alter the Location HTTP header attribute, as shown&lt;br /&gt;below:&lt;br /&gt;&lt;%&lt;br /&gt;response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);&lt;br /&gt;String newLocn = "/newpath/index.html";&lt;br /&gt;response.setHeader("Location",newLocn);&lt;br /&gt;%&gt;&lt;br /&gt;You can also use the: &lt;jsp:forward page="/newpage.jsp"&gt; Also note&lt;br /&gt;that you can only use this before any output has been sent to the client. I&lt;br /&gt;beleve this is the case with the response.sendRedirect() method as well.&lt;br /&gt;If you want to pass any paramateres then you can pass using &lt;jsp:forward&lt;br /&gt;page="/servlet/login"&gt; &lt;jsp:param name="username" value="jsmith"&gt;&lt;br /&gt;&lt;/jsp:forward&gt;&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-7323717154200115709?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/7323717154200115709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-perform-browser-redirection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7323717154200115709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7323717154200115709'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-perform-browser-redirection.html' title='How do I perform browser redirection from a JSP page? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-405946144492828372</id><published>2009-03-13T06:10:00.000-07:00</published><updated>2009-03-13T06:11:13.872-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do I include static files within a JSP page  (JSP)</title><content type='html'>&lt;strong&gt;Question :How do I include static files within a JSP page? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Static resources should always be included using the JSP include&lt;br /&gt;directive. This way, the inclusion is performed just once during the&lt;br /&gt;translation phase. The following example shows the syntax:&lt;br /&gt;&lt;%@ include file="copyright.html" %&gt;&lt;br /&gt;Do note that you should always supply a relative URL for the file attribute.&lt;br /&gt;Although you can also include static resources using the action, this is not&lt;br /&gt;advisable as the inclusion is then performed for each and every request.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-405946144492828372?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/405946144492828372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-include-static-files-within_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/405946144492828372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/405946144492828372'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-include-static-files-within_13.html' title='How do I include static files within a JSP page  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-3565100283128490142</id><published>2009-03-13T06:06:00.000-07:00</published><updated>2009-03-13T06:10:20.876-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What JSP lifecycle methods can I override  (JSP)</title><content type='html'>&lt;strong&gt;Question :What JSP lifecycle methods can I override? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :You cannot override the _jspService() method within a JSP page. You can&lt;br /&gt;however, override the jspInit() and jspDestroy() methods within a JSP&lt;br /&gt;page. jspInit() can be useful for allocating resources like database&lt;br /&gt;connections, network connections, and so forth for the JSP page. It is good&lt;br /&gt;programming practice to free any allocated resources within jspDestroy().&lt;br /&gt;The jspInit() and jspDestroy() methods are each executed just once during&lt;br /&gt;the lifecycle of a JSP page and are typically declared as JSP declarations:&lt;br /&gt;&lt;%!&lt;br /&gt;public void jspInit() {&lt;br /&gt;. . .&lt;br /&gt;}&lt;br /&gt;%&gt;&lt;br /&gt;&lt;%!&lt;br /&gt;public void jspDestroy() {&lt;br /&gt;. . .&lt;br /&gt;}&lt;br /&gt;%&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-3565100283128490142?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/3565100283128490142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-jsp-lifecycle-methods-can-i.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3565100283128490142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3565100283128490142'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-jsp-lifecycle-methods-can-i.html' title='What JSP lifecycle methods can I override  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-616393118430610128</id><published>2009-03-13T06:04:00.001-07:00</published><updated>2009-03-13T06:06:28.517-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Can a JSP page process HTML FORM data  (JSP)</title><content type='html'>&lt;p&gt;&lt;strong&gt;Question :Can a JSP page process HTML FORM data (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Yes. However, unlike servlets, you are not required to implement HTTPprotocol&lt;br /&gt;specific methods like doGet() or doPost() within your JSP page.&lt;br /&gt;You can obtain the data for the FORM input elements via the request&lt;br /&gt;implicit object within a scriptlet or expression as:&lt;br /&gt;&lt;% String item = request.getParameter("item"); int howMany = new Integer(request.getParameter("units")).intValue(); %&gt;&lt;br /&gt;or&lt;br /&gt;&lt;%= request.getParameter("item") %&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-616393118430610128?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/616393118430610128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-jsp-page-process-html-form-data-jsp_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/616393118430610128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/616393118430610128'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-jsp-page-process-html-form-data-jsp_13.html' title='Can a JSP page process HTML FORM data  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-950436154709495739</id><published>2009-03-13T06:04:00.000-07:00</published><updated>2009-03-13T06:05:10.886-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Can a JSP page process HTML FORM data  (JSP)</title><content type='html'>&lt;strong&gt;Question :Can a JSP page process HTML FORM data? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Yes. However, unlike servlets, you are not required to implement HTTPprotocol&lt;br /&gt;specific methods like doGet() or doPost() within your JSP page.&lt;br /&gt;You can obtain the data for the FORM input elements via the request&lt;br /&gt;implicit object within a scriptlet or expression as:&lt;br /&gt;&lt;%&lt;br /&gt;String item = request.getParameter("item");&lt;br /&gt;int howMany = new Integer(request.getParameter("units")).intValue();&lt;br /&gt;%&gt;&lt;br /&gt;or&lt;br /&gt;&lt;%= request.getParameter("item") %&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-950436154709495739?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/950436154709495739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-jsp-page-process-html-form-data-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/950436154709495739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/950436154709495739'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-jsp-page-process-html-form-data-jsp.html' title='Can a JSP page process HTML FORM data  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-4144052530156732627</id><published>2009-03-13T06:03:00.000-07:00</published><updated>2009-03-13T06:04:16.384-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do I mix JSP and SSI #include? (JSP)</title><content type='html'>&lt;strong&gt;Question :How do I mix JSP and SSI #include? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :If you're just including raw HTML, use the #include directive as usual&lt;br /&gt;inside your .jsp file.&lt;br /&gt;&lt;!--#include file="data.inc"--&gt;&lt;br /&gt;But it's a little trickier if you want the server to evaluate any JSP code that's&lt;br /&gt;inside the included file. If your data.inc file contains jsp code you will have&lt;br /&gt;to use&lt;br /&gt;&lt;%@ vinclude="data.inc" %&gt;&lt;br /&gt;The &lt;!--#include file="data.inc"--&gt; is used for including non-JSP files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-4144052530156732627?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/4144052530156732627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-mix-jsp-and-ssi-include-jsp_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4144052530156732627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4144052530156732627'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-mix-jsp-and-ssi-include-jsp_13.html' title='How do I mix JSP and SSI #include? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-2565570517907246041</id><published>2009-03-13T06:02:00.000-07:00</published><updated>2009-03-13T06:03:14.023-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do I include static files within a JSP page  (JSP)</title><content type='html'>&lt;strong&gt;Question :How do I include static files within a JSP page? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Static resources should always be included using the JSP include&lt;br /&gt;directive. This way, the inclusion is performed just once during the&lt;br /&gt;translation phase. The following example shows the syntax: Do note that&lt;br /&gt;you should always supply a relative URL for the file attribute. Although you&lt;br /&gt;can also include static resources using the action, this is not advisable as&lt;br /&gt;the inclusion is then performed for each and every request.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-2565570517907246041?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/2565570517907246041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-include-static-files-within.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2565570517907246041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2565570517907246041'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-include-static-files-within.html' title='How do I include static files within a JSP page  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-7188802158767727431</id><published>2009-03-13T06:01:00.000-07:00</published><updated>2009-03-13T06:02:26.453-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>In the Servlet 2.4 specification SingleThreadModel has been deprecates,</title><content type='html'>&lt;strong&gt;Question :In the Servlet 2.4 specification SingleThreadModel has been deprecates,&lt;br /&gt;why? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Because it is not practical to have such model. Whether you set&lt;br /&gt;isThreadSafe to true or false, you should take care of concurrent client&lt;br /&gt;requests to the JSP page by synchronizing access to any shared objects&lt;br /&gt;defined at the page level.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-7188802158767727431?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/7188802158767727431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/in-servlet-24-specification.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7188802158767727431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7188802158767727431'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/in-servlet-24-specification.html' title='In the Servlet 2.4 specification SingleThreadModel has been deprecates,'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8359636900932360460</id><published>2009-03-13T05:59:00.000-07:00</published><updated>2009-03-13T06:01:44.235-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How many JSP scripting elements are there and what are they? (JSP)</title><content type='html'>&lt;strong&gt;Question :How many JSP scripting elements are there and what are they? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :There are three scripting language elements:&lt;br /&gt;declarations&lt;br /&gt;scriptlets&lt;br /&gt;expressions&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8359636900932360460?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8359636900932360460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-many-jsp-scripting-elements-are.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8359636900932360460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8359636900932360460'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-many-jsp-scripting-elements-are.html' title='How many JSP scripting elements are there and what are they? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-3512308983469514462</id><published>2009-03-13T05:58:00.000-07:00</published><updated>2009-03-13T05:59:11.388-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can I implement a thread-safe JSP page? (JSP)</title><content type='html'>&lt;strong&gt;Question :How can I implement a thread-safe JSP page? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :You can make your JSPs thread-safe by having them implement the&lt;br /&gt;SingleThreadModel interface. This is done by adding the directive &lt;%@&lt;br /&gt;page isThreadSafe="false" % &gt; within your JSP page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-3512308983469514462?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/3512308983469514462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-implement-thread-safe-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3512308983469514462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3512308983469514462'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-i-implement-thread-safe-jsp.html' title='How can I implement a thread-safe JSP page? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1274997350596432849</id><published>2009-03-13T05:57:00.000-07:00</published><updated>2009-03-13T05:58:24.165-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How can my application get to know when a HttpSession is</title><content type='html'>&lt;strong&gt;Question :How can my application get to know when a HttpSession is&lt;br /&gt;removed? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Define a Class HttpSessionNotifier which implements&lt;br /&gt;HttpSessionBindingListener and implement the functionality what you need&lt;br /&gt;in valueUnbound() method.&lt;br /&gt;Create an instance of that class and put that instance in HttpSession.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1274997350596432849?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1274997350596432849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-my-application-get-to-know-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1274997350596432849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1274997350596432849'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-can-my-application-get-to-know-when.html' title='How can my application get to know when a HttpSession is'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-5140808907924525827</id><published>2009-03-13T05:56:00.002-07:00</published><updated>2009-03-13T05:57:27.502-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is the difference between Model 1 and Model 2 architecture  (JSP)</title><content type='html'>&lt;strong&gt;Question :What is the difference between Model 1 and Model 2 architecture? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :In Model 1 there is no Controller and in Model 2 there is a Controller&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-5140808907924525827?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/5140808907924525827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between-model-1-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5140808907924525827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5140808907924525827'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between-model-1-and.html' title='What is the difference between Model 1 and Model 2 architecture  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-2115418788416163654</id><published>2009-03-13T05:56:00.001-07:00</published><updated>2009-03-13T05:56:43.347-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do I mix JSP and SSI #include  (JSP)</title><content type='html'>&lt;strong&gt;Question :How do I mix JSP and SSI #include? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :If you're just including raw HTML, use the #include directive as usual&lt;br /&gt;inside your .jsp file.&lt;br /&gt;&lt;!--#include file="data.inc"--&gt;&lt;br /&gt;But it's a little trickier if you want the server to evaluate any JSP code&lt;br /&gt;that's inside the included file. Ronel Sumibcay&lt;br /&gt;(ronel@LIVESOFTWARE.COM) says: If your data.inc file contains jsp code&lt;br /&gt;you will have to use&lt;br /&gt;&lt;%@ vinclude="data.inc" %&gt;&lt;br /&gt;The &lt;!--#include file="data.inc"--&gt; is used for including non-JSP files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-2115418788416163654?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/2115418788416163654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-mix-jsp-and-ssi-include-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2115418788416163654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2115418788416163654'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-i-mix-jsp-and-ssi-include-jsp.html' title='How do I mix JSP and SSI #include  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-839501377387580745</id><published>2009-03-13T05:53:00.000-07:00</published><updated>2009-03-13T05:56:05.372-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How do you delete a Cookie within a JSP  (JSP)</title><content type='html'>&lt;strong&gt;Question :How do you delete a Cookie within a JSP? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Cookie mycook = new Cookie("name","value");&lt;br /&gt;response.addCookie(mycook);&lt;br /&gt;Cookie killmycook = new Cookie("mycook","value");&lt;br /&gt;killmycook.setMaxAge(0);&lt;br /&gt;killmycook.setPath("/");&lt;br /&gt;killmycook.addCookie(killmycook);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-839501377387580745?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/839501377387580745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-you-delete-cookie-within-jsp-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/839501377387580745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/839501377387580745'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-do-you-delete-cookie-within-jsp-jsp.html' title='How do you delete a Cookie within a JSP  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-5621892232351693389</id><published>2009-03-13T05:52:00.000-07:00</published><updated>2009-03-13T05:53:21.587-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How does JSP handle runtime exceptions  (JSP)</title><content type='html'>&lt;strong&gt;Question :How does JSP handle runtime exceptions? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Using errorPage attribute of page directive and also we need to specify&lt;br /&gt;isErrorPage=true if the current page is intended to URL redirecting of a&lt;br /&gt;JSP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-5621892232351693389?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/5621892232351693389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-does-jsp-handle-runtime-exceptions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5621892232351693389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5621892232351693389'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-does-jsp-handle-runtime-exceptions.html' title='How does JSP handle runtime exceptions  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-3122831159124508276</id><published>2009-03-13T05:51:00.000-07:00</published><updated>2009-03-13T05:52:30.780-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is the difference between RequestDispatcher and sendRedirect  (JSP)</title><content type='html'>&lt;strong&gt;Question :What is the difference between RequestDispatcher and sendRedirect? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :RequestDispatcher: server-side redirect with request and response&lt;br /&gt;objects.&lt;br /&gt;sendRedirect : Client-side redirect with new request and response objects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-3122831159124508276?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/3122831159124508276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between_2611.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3122831159124508276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/3122831159124508276'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between_2611.html' title='What is the difference between RequestDispatcher and sendRedirect  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-8162990302546049505</id><published>2009-03-13T05:49:00.000-07:00</published><updated>2009-03-13T05:51:33.822-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is the difference between directive include and jsp include? (JSP)</title><content type='html'>&lt;strong&gt;Question :What is the difference between directive include and jsp include? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :&lt;%@ include&gt; : Used to include static resources during translation time.&lt;br /&gt;: Used to include dynamic content or static content during runtime.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-8162990302546049505?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/8162990302546049505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between-directive.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8162990302546049505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/8162990302546049505'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between-directive.html' title='What is the difference between directive include and jsp include? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-4260316836327679649</id><published>2009-03-13T05:48:00.002-07:00</published><updated>2009-03-13T05:49:42.151-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How to pass information from JSP to included JSP? (JSP)</title><content type='html'>&lt;strong&gt;Question :How to pass information from JSP to included JSP? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :Using &lt;%jsp:param&gt; tag.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-4260316836327679649?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/4260316836327679649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-to-pass-information-from-jsp-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4260316836327679649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4260316836327679649'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-to-pass-information-from-jsp-to.html' title='How to pass information from JSP to included JSP? (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-6785545466201262127</id><published>2009-03-13T05:48:00.001-07:00</published><updated>2009-03-13T05:48:52.520-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is the difference in using request.getRequestDispatcher() and</title><content type='html'>&lt;strong&gt;Question :What is the difference in using request.getRequestDispatcher() and&lt;br /&gt;context.getRequestDispatcher()? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :request.getRequestDispatcher(path): In order to create it we need to&lt;br /&gt;give the relative path of the resource&lt;br /&gt;context.getRequestDispatcher(path): In order to create it we need to give&lt;br /&gt;the absolute path of the resource.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-6785545466201262127?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/6785545466201262127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-in-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6785545466201262127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6785545466201262127'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-in-using.html' title='What is the difference in using request.getRequestDispatcher() and'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-5050035220267298745</id><published>2009-03-13T05:45:00.000-07:00</published><updated>2009-03-13T05:48:00.120-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is the difference between ServletContext and PageContext  (JSP)</title><content type='html'>&lt;strong&gt;Question :What is the difference between ServletContext and PageContext? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :ServletContext: Gives the information about the container&lt;br /&gt;PageContext: Gives the information about the Request&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-5050035220267298745?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/5050035220267298745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5050035220267298745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5050035220267298745'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-difference-between_13.html' title='What is the difference between ServletContext and PageContext  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1638186134658879345</id><published>2009-03-13T05:43:00.000-07:00</published><updated>2009-03-13T05:44:34.947-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Can we implement an interface in a JSP  (JSP)</title><content type='html'>&lt;strong&gt;Question :Can we implement an interface in a JSP? (JSP)&lt;/strong&gt;&lt;br /&gt;Answer :No&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1638186134658879345?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1638186134658879345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-we-implement-interface-in-jsp-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1638186134658879345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1638186134658879345'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/can-we-implement-interface-in-jsp-jsp.html' title='Can we implement an interface in a JSP  (JSP)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-497646047128922535</id><published>2009-03-13T05:40:00.000-07:00</published><updated>2009-03-13T05:42:09.965-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What are native methods  How do you use them  (JNI)</title><content type='html'>&lt;strong&gt;Question :What are native methods? How do you use them? (JNI)&lt;/strong&gt;&lt;br /&gt;Answer :Native methods are methods written in other languages like C, C++, or&lt;br /&gt;even assembly language.&lt;br /&gt;You can call native methods from Java using JNI&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-497646047128922535?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/497646047128922535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-native-methods-how-do-you-use.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/497646047128922535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/497646047128922535'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-native-methods-how-do-you-use.html' title='What are native methods  How do you use them  (JNI)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-730705292836672265</id><published>2009-03-13T05:37:00.000-07:00</published><updated>2009-03-13T05:38:41.460-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Is JNDI a protocol  Where is it used  (JNDI)</title><content type='html'>&lt;strong&gt;Question :Is JNDI a protocol? Where is it used? (JNDI)&lt;/strong&gt;&lt;br /&gt;Answer :Yes.HotJava Views 1.1 is using JNDI to access LDAP. Enterprise APIs such&lt;br /&gt;as Enterprise JavaBeans, Java Message Service, JDBC 2.0 make use of&lt;br /&gt;JNDI to for their naming and directory needs. RMI over IIOP applications&lt;br /&gt;can use JNDI to access the CORBA (COS) naming service.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-730705292836672265?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/730705292836672265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-jndi-protocol-where-is-it-used-jndi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/730705292836672265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/730705292836672265'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/is-jndi-protocol-where-is-it-used-jndi.html' title='Is JNDI a protocol  Where is it used  (JNDI)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-1826836712468905079</id><published>2009-03-13T05:36:00.000-07:00</published><updated>2009-03-13T05:37:19.560-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Components of JNDI (JNDI)</title><content type='html'>&lt;strong&gt;Question :Components of JNDI (JNDI)&lt;/strong&gt;&lt;br /&gt;Answer :Naming Interface- The naming interface organizes information&lt;br /&gt;hierarchically and maps human-friendly names to addresses or objects that&lt;br /&gt;are machine-friendly. It allows access to named objects through multiple&lt;br /&gt;namespaces.&lt;br /&gt;Directory Interface- JNDI includes a directory service interface that&lt;br /&gt;provides access to directory objects, which can contain attributes, thereby&lt;br /&gt;providing attribute-based searching and schema support&lt;br /&gt;Service Provider Interface- JNDI comes with the SPI, which supports the&lt;br /&gt;protocols provided by third parties.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-1826836712468905079?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/1826836712468905079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/components-of-jndi-jndi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1826836712468905079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/1826836712468905079'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/components-of-jndi-jndi.html' title='Components of JNDI (JNDI)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-5889679383478527010</id><published>2009-03-13T05:35:00.000-07:00</published><updated>2009-03-13T05:36:29.127-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What's the difference between JNDI lookup(), list(), listBindings(), and search() (JNDI)</title><content type='html'>&lt;strong&gt;Question :What's the difference between JNDI lookup(), list(), listBindings(), and&lt;br /&gt;search()? (JNDI)&lt;/strong&gt;&lt;br /&gt;Answer :lookup() attempts to find the specified object in the given context. I.e., it&lt;br /&gt;looks for a single, specific object and either finds it in the current context&lt;br /&gt;or it fails.&lt;br /&gt;list() attempts to return an enumeration of all of the NameClassPair's of all&lt;br /&gt;of the objects in the current context. I.e., it's a listing of all of the objects&lt;br /&gt;in the current context but only returns the object's name and the name of&lt;br /&gt;the class to which the object belongs.&lt;br /&gt;listBindings() attempts to return an enumeration of the Binding's of all of&lt;br /&gt;the objects in the current context. I.e., it's a listing of all of the objects in&lt;br /&gt;the current context with the object's name, its class name, and a reference&lt;br /&gt;to the object itself.&lt;br /&gt;search() attempts to return an enumeration of all of the objects matching&lt;br /&gt;a given set of search criteria. It can search across multiple contexts (or&lt;br /&gt;not). It can return whatever attributes of the objects that you desire. Etc.&lt;br /&gt;It's by far the most complex and powerful of these options but is also the&lt;br /&gt;most expensive.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-5889679383478527010?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/5889679383478527010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/whats-difference-between-jndi-lookup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5889679383478527010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5889679383478527010'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/whats-difference-between-jndi-lookup.html' title='What&apos;s the difference between JNDI lookup(), list(), listBindings(), and search() (JNDI)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-5001203558131541423</id><published>2009-03-13T05:33:00.000-07:00</published><updated>2009-03-13T05:35:24.114-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is Context and InitialContext? (JNDI)</title><content type='html'>&lt;strong&gt;Question :What is Context and InitialContext? (JNDI)&lt;/strong&gt;&lt;br /&gt;Answer :A context represents a set of bindings within a naming service. A Context&lt;br /&gt;object provides the methods for binding names to objects and unbinding&lt;br /&gt;names from objects, for renaming objects, and for listing the bindings.&lt;br /&gt;JNDI performs all naming operations relative to a context.&lt;br /&gt;The JNDI specification defines an InitialContext class. This class is&lt;br /&gt;instantiated with properties that define the type of naming service in use&lt;br /&gt;(such as provider URL, security, ID and password to use when connecting).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-5001203558131541423?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/5001203558131541423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-context-and-initialcontext-jndi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5001203558131541423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5001203558131541423'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-context-and-initialcontext-jndi.html' title='What is Context and InitialContext? (JNDI)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-7125395015517830232</id><published>2009-03-13T05:30:00.000-07:00</published><updated>2009-03-13T05:31:21.732-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What protocols does JNDI provide an interface to  (JNDI)</title><content type='html'>&lt;strong&gt;Question :What protocols does JNDI provide an interface to? (JNDI)&lt;/strong&gt;&lt;br /&gt;Answer :JNDI itself is independent of any specific directory access protocol.&lt;br /&gt;Individual service providers determine the protocols to support. JNDI&lt;br /&gt;supports popular protocols, such as LDAP (Light weight Directory Access&lt;br /&gt;Protocol) , NDS(Netscape Directory Service), DNS(Domain Naming&lt;br /&gt;Service), and NIS(Network Information Service), supplied by different&lt;br /&gt;vendors.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-7125395015517830232?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/7125395015517830232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-protocols-does-jndi-provide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7125395015517830232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7125395015517830232'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-protocols-does-jndi-provide.html' title='What protocols does JNDI provide an interface to  (JNDI)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-4063946935585486482</id><published>2009-03-13T05:28:00.000-07:00</published><updated>2009-03-13T05:30:09.030-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How does the Application server handle the JMS Connection  (JMS)</title><content type='html'>&lt;strong&gt;Question:How does the Application server handle the JMS Connection? (JMS)&lt;/strong&gt;&lt;br /&gt;Answer:- App server creates the server session and stores them in a pool&lt;br /&gt;- Connection consumer uses the server session to put messages in the&lt;br /&gt;session of the JMS.&lt;br /&gt;- Server session is the one that spawns the JMS session.&lt;br /&gt;- Applications written by Application programmers creates the message&lt;br /&gt;listener&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-4063946935585486482?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/4063946935585486482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-does-application-server-handle-jms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4063946935585486482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4063946935585486482'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-does-application-server-handle-jms.html' title='How does the Application server handle the JMS Connection  (JMS)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-4514331604438633082</id><published>2009-03-13T05:26:00.000-07:00</published><updated>2009-03-13T05:28:44.424-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Give an example of using the point-to-point model. (JMS)</title><content type='html'>&lt;strong&gt;Question :Give an example of using the point-to-point model. (JMS)&lt;/strong&gt;&lt;br /&gt;Answer :The point-to-point model is used when the information is specific to a&lt;br /&gt;single client. For example, a client can send a message for a print out, and&lt;br /&gt;the server can send information back to this client after completion of the&lt;br /&gt;print job.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-4514331604438633082?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/4514331604438633082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/give-example-of-using-point-to-point.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4514331604438633082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/4514331604438633082'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/give-example-of-using-point-to-point.html' title='Give an example of using the point-to-point model. (JMS)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-5839947161460735056</id><published>2009-03-13T05:25:00.000-07:00</published><updated>2009-03-13T05:26:26.733-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How does a typical client perform the communication  (JMS)</title><content type='html'>&lt;strong&gt;Question :How does a typical client perform the communication? (JMS)&lt;/strong&gt;&lt;br /&gt;Answer :1. Use JNDI to locate administrative objects.&lt;br /&gt;1a. Locate a single ConnectionFactory object.&lt;br /&gt;1b. Locate one or more Destination objects.&lt;br /&gt;2. Use the ConnectionFactory to create a JMS Connection.&lt;br /&gt;3. Use the Connection to create one or more Session(s).&lt;br /&gt;4. Use a Session and the Destinations to create the MessageProducers and&lt;br /&gt;MessageConsumers needed.&lt;br /&gt;5. Perform your communication.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-5839947161460735056?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/5839947161460735056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-does-typical-client-perform.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5839947161460735056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5839947161460735056'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/how-does-typical-client-perform.html' title='How does a typical client perform the communication  (JMS)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-2456081997069292105</id><published>2009-03-13T05:24:00.000-07:00</published><updated>2009-03-13T05:25:41.997-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is the Role of the JMS Provider  (JMS)</title><content type='html'>&lt;strong&gt;Question :What is the Role of the JMS Provider? (JMS)&lt;/strong&gt;&lt;br /&gt;Answer :The JMS provider handles security of the messages, data conversion and&lt;br /&gt;the client triggering. The JMS provider specifies the level of encryption and&lt;br /&gt;the security level of the message, the best data type for the non-JMS&lt;br /&gt;client.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-2456081997069292105?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/2456081997069292105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-role-of-jms-provider-jms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2456081997069292105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2456081997069292105'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-role-of-jms-provider-jms.html' title='What is the Role of the JMS Provider  (JMS)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-6875055164650935217</id><published>2009-03-13T05:23:00.000-07:00</published><updated>2009-03-13T05:24:52.022-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What are the various message types supported by JMS? (JMS)</title><content type='html'>&lt;strong&gt;Question :What are the various message types supported by JMS? (JMS)&lt;/strong&gt;&lt;br /&gt;Answer :Stream Messages ? Group of Java Primitives&lt;br /&gt;Map Messages ? Name Value Pairs.&lt;br /&gt;Name being a string&lt;br /&gt;Value being a java primitive&lt;br /&gt;Text Messages ? String messages (since being widely used a separate&lt;br /&gt;messaging Type has been supported)&lt;br /&gt;Object Messages ? Group of serialize able java object&lt;br /&gt;Bytes Message ? Stream of uninterrupted bytes&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-6875055164650935217?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/6875055164650935217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-various-message-types.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6875055164650935217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6875055164650935217'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-various-message-types.html' title='What are the various message types supported by JMS? (JMS)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-2320262778668540058</id><published>2009-03-13T05:21:00.000-07:00</published><updated>2009-03-13T05:23:00.766-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What are the core JMS-related objects required for each JMS-enabled application (JMS)</title><content type='html'>&lt;strong&gt;Question :What are the core JMS-related objects required for each JMS-enabled&lt;br /&gt;application? (JMS)&lt;/strong&gt;&lt;br /&gt;Answer :Each JMS-enabled client must establish the following:&lt;br /&gt;· A connection object provided by the JMS server (the message broker)&lt;br /&gt;· Within a connection, one or more sessions, which provide a context for&lt;br /&gt;message sending and receiving&lt;br /&gt;· Within a session, either a queue or topic object representing the&lt;br /&gt;destination (the message staging area) within the message broker&lt;br /&gt;· Within a session, the appropriate sender or publisher or receiver or&lt;br /&gt;subscriber object (depending on whether the client is a message producer&lt;br /&gt;or consumer and uses a point-to-point or publish/subscribe strategy,&lt;br /&gt;respectively)&lt;br /&gt;Within a session, a message object (to send or to receive)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-2320262778668540058?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/2320262778668540058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-core-jms-related-objects.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2320262778668540058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/2320262778668540058'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-core-jms-related-objects.html' title='What are the core JMS-related objects required for each JMS-enabled application (JMS)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-5870886768182835489</id><published>2009-03-13T05:20:00.000-07:00</published><updated>2009-03-13T05:21:54.453-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Why doesn't the JMS API provide end-to-end synchronous message</title><content type='html'>&lt;strong&gt;Question:Why doesn't the JMS API provide end-to-end synchronous message&lt;br /&gt;delivery and notification of delivery? (JMS)&lt;/strong&gt;&lt;br /&gt;Answer :Some messaging systems provide synchronous delivery to destinations as&lt;br /&gt;a mechanism for implementing reliable applications. Some systems provide&lt;br /&gt;clients with various forms of delivery notification so that the clients can&lt;br /&gt;detect dropped or ignored messages. This is not the model defined by the&lt;br /&gt;JMS API.&lt;br /&gt;JMS API messaging provides guaranteed delivery via the once-and-onlyonce&lt;br /&gt;delivery semantics of PERSISTENT messages. In addition, message&lt;br /&gt;consumers can insure reliable processing of messages by using either&lt;br /&gt;CLIENT_ACKNOWLEDGE mode or transacted sessions. This achieves&lt;br /&gt;reliable delivery with minimum synchronization and is the enterprise&lt;br /&gt;messaging model most vendors and developers prefer.&lt;br /&gt;The JMS API does not define a schema of systems messages (such as&lt;br /&gt;delivery notifications). If an application requires acknowledgment of&lt;br /&gt;message receipt, it can define an application-level acknowledgment&lt;br /&gt;message.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-5870886768182835489?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/5870886768182835489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/why-doesnt-jms-api-provide-end-to-end.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5870886768182835489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/5870886768182835489'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/why-doesnt-jms-api-provide-end-to-end.html' title='Why doesn&apos;t the JMS API provide end-to-end synchronous message'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-7676279653701253582</id><published>2009-03-13T05:19:00.000-07:00</published><updated>2009-03-13T05:20:35.934-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What is publish/subscribe messaging  (JMS)</title><content type='html'>&lt;strong&gt;Question :What is publish/subscribe messaging? (JMS)&lt;/strong&gt;&lt;br /&gt;Answer :With publish/subscribe message passing the sending application/client&lt;br /&gt;establishes a named topic in the JMS broker/server and publishes&lt;br /&gt;messages to this queue. The receiving clients register (specifically,&lt;br /&gt;subscribe) via the broker to messages by topic; every subscriber to a topic&lt;br /&gt;receives each message published to that topic. There is a one-to-many&lt;br /&gt;relationship between the publishing client and the subscribing clients.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-7676279653701253582?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/7676279653701253582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-publishsubscribe-messaging-jms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7676279653701253582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/7676279653701253582'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-is-publishsubscribe-messaging-jms.html' title='What is publish/subscribe messaging  (JMS)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-123553503389886348.post-6045590387186521993</id><published>2009-03-13T05:18:00.000-07:00</published><updated>2009-03-13T05:19:39.232-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>What are the types of messaging? (JMS)</title><content type='html'>&lt;strong&gt;Question :What are the types of messaging? (JMS)&lt;/strong&gt;&lt;br /&gt;Answer :There are two kinds of Messaging.&lt;br /&gt;Synchronous Messaging:&lt;br /&gt;Synchronous messaging involves a client that waits for the server to&lt;br /&gt;respond to a message.&lt;br /&gt;Asynchronous Messaging:&lt;br /&gt;Asynchronous messaging involves a client that does not wait for a message&lt;br /&gt;from the server. An event is used to trigger a message from a server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/123553503389886348-6045590387186521993?l=java-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-interview-questions-answers.blogspot.com/feeds/6045590387186521993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-types-of-messaging-jms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6045590387186521993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/123553503389886348/posts/default/6045590387186521993'/><link rel='alternate' type='text/html' href='http://java-interview-questions-answers.blogspot.com/2009/03/what-are-types-of-messaging-jms.html' title='What are the types of messaging? (JMS)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry></feed>
