<?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-7266580669968450373</id><updated>2012-02-16T04:20:30.862-08:00</updated><title type='text'>Spread Smile</title><subtitle type='html'>The purpose of this blog is to spread knowledge, information of various field .
Enjoy and contribute</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://thesandeepsaxena.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://thesandeepsaxena.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sandeep</name><uri>http://www.blogger.com/profile/11401210729852266730</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_BUWbGMq2OqY/S6r8PfJsMRI/AAAAAAAAABU/N6KSsnR3KD8/S220/0619_133223.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7266580669968450373.post-8716483551914223432</id><published>2009-06-11T01:04:00.000-07:00</published><updated>2009-06-11T01:06:06.897-07:00</updated><title type='text'>TTL .... New Contender in GSM fight !!!!</title><content type='html'>Tata Teleservices is launching its gsm services!!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7266580669968450373-8716483551914223432?l=thesandeepsaxena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thesandeepsaxena.blogspot.com/feeds/8716483551914223432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7266580669968450373&amp;postID=8716483551914223432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/8716483551914223432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/8716483551914223432'/><link rel='alternate' type='text/html' href='http://thesandeepsaxena.blogspot.com/2009/06/ttl-new-contender-in-gsm-fight.html' title='TTL .... New Contender in GSM fight !!!!'/><author><name>Sandeep</name><uri>http://www.blogger.com/profile/11401210729852266730</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_BUWbGMq2OqY/S6r8PfJsMRI/AAAAAAAAABU/N6KSsnR3KD8/S220/0619_133223.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7266580669968450373.post-6149374550676519939</id><published>2009-06-11T00:49:00.000-07:00</published><updated>2009-06-11T01:02:47.160-07:00</updated><title type='text'>Samsung is launching World's first Solar Cellphone !!!!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_BUWbGMq2OqY/SjC4iPgianI/AAAAAAAAAA8/JnzxKsuPezY/s1600-h/103047_matter.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://1.bp.blogspot.com/_BUWbGMq2OqY/SjC4iPgianI/AAAAAAAAAA8/JnzxKsuPezY/s320/103047_matter.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5345975656106846834" /&gt;&lt;/a&gt;&lt;br /&gt;Samsung is going to launch cellphone with solar energy charging option !!!!&lt;br /&gt;It will be launched under its "GuRu" category at just INR 2800+ .&lt;br /&gt;You can put it in your pocket after mid of june.&lt;br /&gt;According to Samsung’s South West Asia Headquarters President and CEO J. S. Shin, “Solar Guru has been developed keeping in mind the needs of Indian consumers, especially customers residing in areas facing power crunch so that they can rely on solar charging to remain connected”.&lt;br /&gt;&lt;br /&gt;Solar Guru was being introduced in various global markets, he added.&lt;br /&gt;&lt;br /&gt;Samsung Country Head (Mobile Division) Sunil Dutt said: “Initially, the handsets will be imported from Korea and will be available in the Indian market within a week. In the next few months, we would start manufacturing the handsets at our Noida facility”.&lt;br /&gt;After taking sun bath for 40 hours ,it will be fully charged.&lt;br /&gt;1 hour of sun bathing will give you around 10 to 15 minutes talk time.&lt;br /&gt;Customers are targeted who belongs to power cut areas and those who don't want to miss a call after forgetting their chargers at their Home....&lt;br /&gt;Good Work Samsung!!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7266580669968450373-6149374550676519939?l=thesandeepsaxena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thesandeepsaxena.blogspot.com/feeds/6149374550676519939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7266580669968450373&amp;postID=6149374550676519939' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/6149374550676519939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/6149374550676519939'/><link rel='alternate' type='text/html' href='http://thesandeepsaxena.blogspot.com/2009/06/samsung-is-launching-worlds-first-solar.html' title='Samsung is launching World&apos;s first Solar Cellphone !!!!'/><author><name>Sandeep</name><uri>http://www.blogger.com/profile/11401210729852266730</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_BUWbGMq2OqY/S6r8PfJsMRI/AAAAAAAAABU/N6KSsnR3KD8/S220/0619_133223.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_BUWbGMq2OqY/SjC4iPgianI/AAAAAAAAAA8/JnzxKsuPezY/s72-c/103047_matter.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7266580669968450373.post-4442442067257827780</id><published>2009-05-26T03:59:00.000-07:00</published><updated>2009-05-26T04:02:19.136-07:00</updated><title type='text'>J2EE Technolgy Concept .......</title><content type='html'>1) Is it the "servlets" directory or the "servlet" directory?&lt;br /&gt;For Java Web Server:&lt;br /&gt;· on the file system, it's "servlets"&lt;br /&gt;c:\JavaWebServer1.1\servlets\DateServlet.class&lt;br /&gt;· in a URL path, it's "servlet"&lt;br /&gt;http://www.stinky.com/servlet/DateServlet&lt;br /&gt;2) How do I support both GET and POST protocol from the same Servlet?&lt;br /&gt;The easy way is, just support POST, then have your doGet method&lt;br /&gt;call your doPost method:&lt;br /&gt;public void doGet(HttpServletRequest req, HttpServletResponse&lt;br /&gt;res)&lt;br /&gt;throws ServletException, IOException&lt;br /&gt;{&lt;br /&gt;doPost(req, res);&lt;br /&gt;}&lt;br /&gt;3) How do I ensure that my servlet is thread-safe?&lt;br /&gt;]&lt;br /&gt;This is actually a very complex issue. A few guidelines:&lt;br /&gt;1. The init() method is guaranteed to be called once per servlet&lt;br /&gt;instance, when the servlet is loaded. You don't have to worry&lt;br /&gt;about thread safety inside this method, since it is only called&lt;br /&gt;by a single thread, and the web server will wait until that&lt;br /&gt;thread exits before sending any more threads into your&lt;br /&gt;service() method.&lt;br /&gt;2. Every new client request generates (or allocates) a new&lt;br /&gt;thread; that thread calls the service() method of your servlet&lt;br /&gt;(which may in turn call doPost(), doGet() and so forth).&lt;br /&gt;3. Under most circumstances, there is only one instance of&lt;br /&gt;your servlet, no matter how many client requests are in&lt;br /&gt;process. That means that at any given moment, there may&lt;br /&gt;be many threads running inside the service() method of your&lt;br /&gt;solo instance, all sharing the same instance data and&lt;br /&gt;potentially stepping on each other's toes. This means that&lt;br /&gt;you should be careful to synchronize access to shared data&lt;br /&gt;(instance variables) using the synchronized keyword.&lt;br /&gt;(Note that the server will also allocate a new instance if you&lt;br /&gt;register the servlet with a new name and, e.g., new init&lt;br /&gt;parameters.)&lt;br /&gt;4. Note that you need not (and should not) synchronize on&lt;br /&gt;local data or parameters. And especially you shouldn't&lt;br /&gt;synchronize the service() method! (Or doPost(), doGet() et al.)&lt;br /&gt;5. A simple solution to synchronizing is to always synchronize&lt;br /&gt;on the servlet instance itself using &amp;amp;quot;synchronized&lt;br /&gt;(this) { ... }&amp;amp;quot;. However, this can lead to performance&lt;br /&gt;bottlenecks; you're usually better off synchronizing on the&lt;br /&gt;data objects themselves.&lt;br /&gt;6. If you absolutely can't deal with synchronizing, you can&lt;br /&gt;declare that your servlet &amp;amp;quot;implements&lt;br /&gt;SingleThreadModel&amp;amp;quot;. This empty interface tells the&lt;br /&gt;web server to only send one client request at a time into your&lt;br /&gt;servlet. From the JavaDoc: &amp;amp;quot;If the target servlet is&lt;br /&gt;flagged with this interface, the servlet programmer is&lt;br /&gt;guaranteed that no two threads will execute concurrently the&lt;br /&gt;service method of that servlet. This guarantee is ensured by&lt;br /&gt;maintaining a pool of servlet instances for each such servlet,&lt;br /&gt;and dispatching each service call to a free servlet. In&lt;br /&gt;essence, if the servlet implements this interface, the servlet&lt;br /&gt;will be thread safe.&amp;amp;quot; Note that this is not an ideal&lt;br /&gt;solution, since performance may suffer (depending on the&lt;br /&gt;size of the instance pool), plus it's more difficult to share data&lt;br /&gt;across instances than within a single instance.&lt;br /&gt;See also What's a better approach for enabling thread-safe&lt;br /&gt;servlets and JSPs? SingleThreadModel Interface or&lt;br /&gt;Synchronization?&lt;br /&gt;7. To share data across successive or concurrent requests,&lt;br /&gt;you can use either instance variables or class-static&lt;br /&gt;variables, or use Session Tracking.&lt;br /&gt;8. The destroy() method is not necessarily as clean as the init()&lt;br /&gt;method. The server calls destroy either after all service calls&lt;br /&gt;have been completed, or after a certain number of seconds&lt;br /&gt;have passed, whichever comes first. This means that other&lt;br /&gt;threads might be running service requests at the same time&lt;br /&gt;as your destroy() method is called! So be sure to synchronize,&lt;br /&gt;and/or wait for the other requests to quit. Sun's Servlet&lt;br /&gt;Tutorial has an example of how to do this with reference&lt;br /&gt;counting.&lt;br /&gt;9. destroy() can not throw an exception, so if something bad&lt;br /&gt;happens, call log() with a helpful message (like the&lt;br /&gt;exception). See the &amp;amp;quot;closing a JDBC&lt;br /&gt;connection&amp;amp;quot; example in Sun's Tutorial.&lt;br /&gt;4) What is the difference between URL encoding, URL rewriting, HTML&lt;br /&gt;escaping, and entity encoding?&lt;br /&gt;URL Encoding is a process of transforming user input to a CGI&lt;br /&gt;form so it is fit for travel across the network -- basically, stripping&lt;br /&gt;spaces and punctuation and replacing with escape characters. URL&lt;br /&gt;Decoding is the reverse process. To perform these operations, call&lt;br /&gt;java.net.URLEncoder.encode() and java.net.URLDecoder.decode() (the latter&lt;br /&gt;was (finally!) added to JDK 1.2, aka Java 2).&lt;br /&gt;Example: changing "We're #1!" into "We%27re+%231%21"&lt;br /&gt;URL Rewriting is a technique for saving state information on the&lt;br /&gt;user's browser between page hits. It's sort of like cookies, only the&lt;br /&gt;information gets stored inside the URL, as an additional parameter.&lt;br /&gt;The HttpSession API, which is part of the Servlet API, sometimes&lt;br /&gt;uses URL Rewriting when cookies are unavailable.&lt;br /&gt;Example: changing &lt;A HREF="nextpage.html"&gt; into&lt;br /&gt;&lt;A HREF="nextpage.html;$sessionid$=DSJFSDKFSLDFEEKOE"&gt;&lt;br /&gt;(or whatever the actual syntax is; I forget offhand)&lt;br /&gt;(Unfortunately, the method in the Servlet API for doing URL&lt;br /&gt;rewriting for session management is called encodeURL(). Sigh...)&lt;br /&gt;There's also a feature of the Apache web server called URL&lt;br /&gt;Rewriting; it is enabled by the mod_rewrite module. It rewrites URLs&lt;br /&gt;on their way in to the server, allowing you to do things like&lt;br /&gt;automatically add a trailing slash to a directory name, or to map old&lt;br /&gt;file names to new file names. This has nothing to do with servlets.&lt;br /&gt;For more information, see the Apache FAQ&lt;br /&gt;(http://www.apache.org/docs/misc/FAQ.html#rewrite-more-config) .&lt;br /&gt;5) How do I upload a file to my servlet or JSP?&lt;br /&gt;On the client side, the client's browser must support form-based&lt;br /&gt;upload. Most modern browsers do, but there's no guarantee. For&lt;br /&gt;example,&lt;br /&gt;&lt;FORM ENCTYPE='multipart/form-data'&lt;br /&gt;method='POST' action='/myservlet'&gt;&lt;br /&gt;&lt;INPUT TYPE='file' NAME='mptest'&gt;&lt;br /&gt;&lt;INPUT TYPE='submit' VALUE='upload'&gt;&lt;br /&gt;&lt;/FORM&gt;&lt;br /&gt;The input type &amp;amp;quot;file&amp;amp;quot; brings up a button for a&lt;br /&gt;file select box on the browser together with a text field that takes&lt;br /&gt;the file name once selected. The servlet can use the GET method&lt;br /&gt;parameters to decide what to do with the upload while the POST&lt;br /&gt;body of the request contains the file data to parse.&lt;br /&gt;When the user clicks the "Upload" button, the client browser locates&lt;br /&gt;the local file and sends it using HTTP POST, encoded using the&lt;br /&gt;MIME-type multipart/form-data. When it reaches your servlet, your&lt;br /&gt;servlet must process the POST data in order to extract the encoded&lt;br /&gt;file. You can learn all about this format in RFC 1867.&lt;br /&gt;Unfortunately, there is no method in the Servlet API to do this.&lt;br /&gt;Fortunately, there are a number of libraries available that do. Some&lt;br /&gt;of these assume that you will be writing the file to disk; others&lt;br /&gt;return the data as an InputStream.&lt;br /&gt;· Jason Hunter's MultipartRequest (available from&lt;br /&gt;http://www.servlets.com/)&lt;br /&gt;· Apache Jakarta Commons Upload (package&lt;br /&gt;org.apache.commons.upload) "makes it easy to add robust,&lt;br /&gt;high-performance, file upload capability to your servlets and&lt;br /&gt;web applications"&lt;br /&gt;· CParseRFC1867 (available from&lt;br /&gt;http://www.servletcentral.com/).&lt;br /&gt;· HttpMultiPartParser by Anil Hemrajani, at the isavvix Code&lt;br /&gt;Exchange&lt;br /&gt;· There is a multipart/form parser availailable from Anders&lt;br /&gt;Kristensen (http://www-uk.hpl.hp.com/people/ak/java/,&lt;br /&gt;ak@hplb.hpl.hp.com) at http://wwwuk.&lt;br /&gt;hpl.hp.com/people/ak/java/#utils.&lt;br /&gt;· JavaMail also has MIME-parsing routines (see the Purple&lt;br /&gt;Servlet References).&lt;br /&gt;· Jun Inamori has written a class called&lt;br /&gt;org.apache.tomcat.request.ParseMime which is available in the&lt;br /&gt;Tomcat CVS tree.&lt;br /&gt;· JSPSmart has a free set of JSP for doing file upload and&lt;br /&gt;download.&lt;br /&gt;· UploadBean by JavaZoom claims to handle most of the&lt;br /&gt;hassle of uploading for you, including writing to disk or&lt;br /&gt;memory.&lt;br /&gt;· There's an Upload Tag in dotJ&lt;br /&gt;Once you process the form-data stream into the uploaded file, you&lt;br /&gt;can then either write it to disk, write it to a database, or process it&lt;br /&gt;as an InputStream, depending on your needs. See How can I&lt;br /&gt;access or create a file or folder in the current directory from inside a&lt;br /&gt;servlet? and other questions in the Servlets:Files Topic for&lt;br /&gt;information on writing files from a Servlet.&lt;br /&gt;Please note that you can't access a file on the client system&lt;br /&gt;directly from a servlet; that would be a huge security hole. You have&lt;br /&gt;to ask the user for permission, and currently form-based upload is&lt;br /&gt;the only way to do that.&lt;br /&gt;6) How does a servlet communicate with a JSP page?&lt;br /&gt;The following code snippet shows how a servlet instantiates a bean&lt;br /&gt;and initializes it with FORM data posted by a browser. The bean is&lt;br /&gt;then placed into the request, and the call is then forwarded to the&lt;br /&gt;JSP page, Bean1.jsp, by means of a request dispatcher for&lt;br /&gt;downstream processing.&lt;br /&gt;public void doPost (HttpServletRequest request,&lt;br /&gt;HttpServletResponse 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&lt;br /&gt;extracting it from the default request scope via the useBean action.&lt;br /&gt;&lt;jsp:useBean id="fBean" class="govi.FormBean"&lt;br /&gt;scope="request"/&gt;&lt;br /&gt;&lt;jsp:getProperty name="fBean" property="name" /&gt;&lt;br /&gt;&lt;jsp:getProperty name="fBean" property="addr" /&gt;&lt;br /&gt;&lt;jsp:getProperty name="fBean" property="age" /&gt;&lt;br /&gt;&lt;jsp:getProperty name="fBean" property="personalizationInfo" /&gt;&lt;br /&gt;7) What's a better approach for enabling thread-safe servlets and JSPs?&lt;br /&gt;SingleThreadModel Interface or Synchronization?&lt;br /&gt;Although the SingleThreadModel technique is easy to use, and&lt;br /&gt;works well for low volume sites, it does not scale well. If you&lt;br /&gt;anticipate your users to increase in the future, you may be better off&lt;br /&gt;implementing explicit synchronization for your shared data. The key&lt;br /&gt;however, is to effectively minimize the amount of code that is&lt;br /&gt;synchronzied so that you take maximum advantage of&lt;br /&gt;multithreading.&lt;br /&gt;Also, note that SingleThreadModel is pretty resource intensive from&lt;br /&gt;the server's perspective. The most serious issue however is when&lt;br /&gt;the number of concurrent requests exhaust the servlet instance&lt;br /&gt;pool. In that case, all the unserviced requests are queued until&lt;br /&gt;something becomes free - which results in poor performance. Since&lt;br /&gt;the usage is non-deterministic, it may not help much even if you did&lt;br /&gt;add more memory and increased the size of the instance pool.&lt;br /&gt;8) Can a servlet maintain a JTA UserTransaction object across multiple servlet&lt;br /&gt;invocations?&lt;br /&gt;No. A JTA transaction must start and finish within a single&lt;br /&gt;invocation (of the service() method). Note that this question does not&lt;br /&gt;address servlets that maintain and manipulate JDBC connections,&lt;br /&gt;including a connection's transaction handling.&lt;br /&gt;9) How does the performance of JSP pages compare with that of servlets?&lt;br /&gt;How does it compare with Perl scripts?&lt;br /&gt;The performance of JSP pages is very close to that of servlets.&lt;br /&gt;However, users may experience a perceptible delay when a JSP&lt;br /&gt;page is accessed for the very first time. This is because the JSP&lt;br /&gt;page undergoes a "translation phase" wherein it is converted into a&lt;br /&gt;servlet by the JSP engine. Once this servlet is dynamically&lt;br /&gt;compiled and loaded into memory, it follows the servlet life cycle for&lt;br /&gt;request processing. Here, the jspInit() method is automatically&lt;br /&gt;invoked by the JSP engine upon loading the servlet, followed by the&lt;br /&gt;_jspService() method, which is responsible for request processing&lt;br /&gt;and replying to the client. Do note that the lifetime of this servlet is&lt;br /&gt;non-deterministic - it may be removed from memory at any time by&lt;br /&gt;the JSP engine for resource-related reasons. When this happens,&lt;br /&gt;the JSP engine automatically invokes the jspDestroy() method&lt;br /&gt;allowing the servlet to free any previously allocated resources.&lt;br /&gt;Subsequent client requests to the JSP page do not result in a&lt;br /&gt;repeat of the translation phase as long as the servlet is cached in&lt;br /&gt;memory, and are directly handled by the servlet's service() method&lt;br /&gt;in a concurrent fashion (i.e. the service() method handles each&lt;br /&gt;client request within a seperate thread concurrently.)&lt;br /&gt;There have been some recent studies contrasting the performance of servlets&lt;br /&gt;with Perl scripts running in a "real-life" environment. The results are favorable to&lt;br /&gt;servlets, especially when they are running in a clustered environment.&lt;br /&gt;10) How do I call one servlet from another servlet?&lt;br /&gt;[ Short answer: there are several ways to do this, including&lt;br /&gt;· use a RequestDispatcher&lt;br /&gt;· use a URLConnection or HTTPClient&lt;br /&gt;· send a redirect&lt;br /&gt;· call getServletContext().getServlet(name) (deprecated,&lt;br /&gt;doesn't work in 2.1+)&lt;br /&gt;- Alex ]&lt;br /&gt;It depends on what you mean by "call" and what it is you seek to do&lt;br /&gt;and why you seek to do it.&lt;br /&gt;If the end result needed is to invoke the methods then the simplest&lt;br /&gt;mechanism would be to treat the servlet like any java object ,&lt;br /&gt;create an instance and call the mehods.&lt;br /&gt;If the idea is to call the service method from the service method of&lt;br /&gt;another servlet, AKA forwarding the request, you could use the&lt;br /&gt;RequestDispatcher object.&lt;br /&gt;If, however, you want to gain access to the instance of the servlet&lt;br /&gt;that has been loaded into memory by the servlet engine, you have&lt;br /&gt;to know the alias of the servlet. (How it is defined depends on the&lt;br /&gt;engine.) For example, to invoke a servlet in JSDK a servlet can be&lt;br /&gt;named by the property&lt;br /&gt;myname.code=com.sameer.servlets.MyServlet&lt;br /&gt;The code below shows how this named servlet can be accessed in&lt;br /&gt;the service method of another servlet&lt;br /&gt;public void service (HttpServletRequest request,&lt;br /&gt;HttpServletResponse response)&lt;br /&gt;throws ServletException, IOException {&lt;br /&gt;...&lt;br /&gt;MyServlet ms=(MyServlet)&lt;br /&gt;getServletConfig().getServletContext().getServlet("myname");&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;That said, This whole apporach of accessing servlets in another&lt;br /&gt;servlets has been deprecated in the 2.1 version of the servlet API&lt;br /&gt;due to the security issues. The cleaner and better apporach is to&lt;br /&gt;just avoid accessing other servlets directly and use the&lt;br /&gt;RequestDispatcher instead.&lt;br /&gt;11) What are all the different kinds of servers? (Such as Web Servers,&lt;br /&gt;Application Servers, etc)&lt;br /&gt;The servers involved in handling and processing a user's request&lt;br /&gt;break down into a few basic types, each of which may have one or&lt;br /&gt;more tasks it solves. This flexibility gives developers a great deal of&lt;br /&gt;power over how applications will be created and deployed, but also&lt;br /&gt;leads to confusion over what server is able to, or should, perform a&lt;br /&gt;specific task.&lt;br /&gt;Starting at the basic level, a user is typically submitting a request to&lt;br /&gt;a system through a web browser. (We are conveniently ignoring all&lt;br /&gt;other types of clients (RMI, CORBA, COM/DCOM, Custom, etc..)&lt;br /&gt;for the time being for purposes of clarity.) The web request must be&lt;br /&gt;received by a Web Server (otherwise known as an HTTP Server)&lt;br /&gt;of some sort. This web server must handle standard HTTP requests&lt;br /&gt;and responses, typically returning HTML to the calling user. Code&lt;br /&gt;that executes within the server environment may be CGI driven,&lt;br /&gt;Servlets, ASP, or some other server-side programming language,&lt;br /&gt;but the end result is that the web server will pass back HTML to the&lt;br /&gt;user.&lt;br /&gt;The web server may need to execute an application in response to&lt;br /&gt;the users request. It may be generating a list of news items, or&lt;br /&gt;handling a form submission to a guest book. If the server&lt;br /&gt;application is written as a Java Servlet, it will need a place to&lt;br /&gt;execute, and this place is typically called a Servlet Engine.&lt;br /&gt;Depending on the web server, this engine may be internal, external,&lt;br /&gt;or a completely different product. This engine is continually running,&lt;br /&gt;unlike a traditional CGI environment where a CGI script is started&lt;br /&gt;upon each request to the server. This persistance gives a servlet&lt;br /&gt;connection and thread pooling, as well as an easy way to maintain&lt;br /&gt;state between each HTTP request. JSP pages are usually tied in&lt;br /&gt;with the servlet engine, and would execute within the same&lt;br /&gt;space/application as the servlets.&lt;br /&gt;There are many products that handle the web serving and the&lt;br /&gt;servlet engine in different manners. Netscape/iPlanet Enterprise&lt;br /&gt;Server builds the servlet engine directly into the web server and&lt;br /&gt;runs within the same process space. Apache requires that a servlet&lt;br /&gt;engine run in an external process, and will communicate to the&lt;br /&gt;engine via TCP/IP sockets. Other servers, such as MS IIS don't&lt;br /&gt;officially support servlets, and require add-on products to add that&lt;br /&gt;capability.&lt;br /&gt;When you move on to Enterprise JavaBeans (and other J2EE&lt;br /&gt;components like JMS and CORBA) you move into the application&lt;br /&gt;server space. An Application Server is any server that supplies&lt;br /&gt;additional functionality related to enterprise computing -- for&lt;br /&gt;instance, load balancing, database access classes, transaction&lt;br /&gt;processing, messaging, and so on.&lt;br /&gt;EJB Application Servers provide an EJB container, which is the&lt;br /&gt;environment that beans will execute in, and this container will&lt;br /&gt;manage transactions, thread pools, and other issues as necessary.&lt;br /&gt;These application servers are usually stand-alone products, and&lt;br /&gt;developers would tie their servlets/JSP pages to the EJB&lt;br /&gt;components via remote object access APIs. Depending on the&lt;br /&gt;application server, programmers may use CORBA or RMI to talk to&lt;br /&gt;their beans, but the baseline standard is to use JNDI to locate and&lt;br /&gt;create EJB references as necessary.&lt;br /&gt;Now, one thing that confuses the issue is that many application&lt;br /&gt;server providers include some or all of these components in their&lt;br /&gt;product. If you look at WebLogic (http://www.beasys.com/) you will&lt;br /&gt;find that WebLogic contains a web server, servlet engine, JSP&lt;br /&gt;processor, JMS facility, as well as an EJB container. Theoretically a&lt;br /&gt;product like this could be used to handle all aspects of site&lt;br /&gt;development. In practice, you would most likely use this type of&lt;br /&gt;product to manage/serve EJB instances, while dedicated web&lt;br /&gt;servers handle the specific HTTP requests.&lt;br /&gt;12) Should I override the service() method?&lt;br /&gt;No. It provides a fair bit of housekeeping that you'd just have to do&lt;br /&gt;yourself. If you need to do something regardless of whether the&lt;br /&gt;request is e.g., a POST or a GET, create a helper method and call&lt;br /&gt;that at the beginning of e.g., doPost() and doGet().&lt;br /&gt;13) How can my application get to know when a HttpSession is removed&lt;br /&gt;(when it time-outs)?&lt;br /&gt;Define a class, say SessionTimeoutNotifier, that implements&lt;br /&gt;javax.servlet.http.HttpSessionBindingListener. Create a SessionTimeoutNotifier&lt;br /&gt;object and add it to the user session. When the session is removed,&lt;br /&gt;SessionTimeoutNotifier.valueUnbound() will be called by the servlet&lt;br /&gt;engine. You can implement valueUnbound() to do whatever you want.&lt;br /&gt;14) Why use JSP when we can do the same thing with servlets?&lt;br /&gt;[Original question: Why should I use JSP when there is already&lt;br /&gt;servlet technology available for serving dynamic content?]&lt;br /&gt;While JSP may be great for serving up dynamic Web content and&lt;br /&gt;separating content from presentation, some may still wonder why&lt;br /&gt;servlets should be cast aside for JSP. The utility of servlets is not in&lt;br /&gt;question. They are excellent for server-side processing, and, with&lt;br /&gt;their significant installed base, are here to stay. In fact,&lt;br /&gt;architecturally speaking, you can view JSP as a high-level&lt;br /&gt;abstraction of servlets that is implemented as an extension of the&lt;br /&gt;Servlet 2.1 API. Still, you shouldn't use servlets indiscriminately;&lt;br /&gt;they may not be appropriate for everyone. For instance, while page&lt;br /&gt;designers can easily write a JSP page using conventional HTML or&lt;br /&gt;XML tools, servlets are more suited for back-end developers&lt;br /&gt;because they are often written using an IDE -- a process that&lt;br /&gt;generally requires a higher level of programming expertise.&lt;br /&gt;When deploying servlets, even developers have to be careful and&lt;br /&gt;ensure that there is no tight coupling between presentation and&lt;br /&gt;content. You can usually do this by adding a third-party HTML&lt;br /&gt;wrapper package like htmlKona to the mix. But even this approach,&lt;br /&gt;though providing some flexibility with simple screen changes, still&lt;br /&gt;does not shield you from a change in the presentation format itself.&lt;br /&gt;For example, if your presentation changed from HTML to DHTML,&lt;br /&gt;you would still need to ensure that wrapper packages were&lt;br /&gt;compliant with the new format. In a worst-case scenario, if a&lt;br /&gt;wrapper package is not available, you may end up hardcoding the&lt;br /&gt;presentation within the dynamic content. So, what is the solution?&lt;br /&gt;One approach would be to use both JSP and servlet technologies&lt;br /&gt;for building application systems.&lt;br /&gt;15) How do I send information and data back and forth between applet and&lt;br /&gt;servlet using the HTTP protocol?&lt;br /&gt;Use the standard java.net.URL class, or "roll your own" using&lt;br /&gt;java.net.Socket. See the HTTP spec at W3C for more detail.&lt;br /&gt;Note: The servlet cannot initiate this connection! If the servlet&lt;br /&gt;needs to asynchronously send a message to the applet, then you&lt;br /&gt;must open up a persistent socket using java.net.Socket (on the applet&lt;br /&gt;side), and java.net.ServerSocket and Threads (on the server side).&lt;br /&gt;16) Can I get the path of the current servlet where it lives on the file system&lt;br /&gt;(not its URL)?&lt;br /&gt;Try using:&lt;br /&gt;request.getRealPath(request.getServletPath())&lt;br /&gt;An example may be:&lt;br /&gt;out.println(request.getRealPath(request.getServletPath()));&lt;br /&gt;17) How can I daisy chain servlets together such that the output of one&lt;br /&gt;servlet serves as the input to the next?&lt;br /&gt;There are two common methods for chaining the output of one&lt;br /&gt;servlet to another servlet :&lt;br /&gt;ï‚· the first method is the aliasing which describes a series of&lt;br /&gt;servlets to be executed&lt;br /&gt;ï‚· the second one is to define a new MIME-Type and associate a&lt;br /&gt;servlet as handlers As I don't really use the second one, I'll focus on&lt;br /&gt;the aliasing.&lt;br /&gt;To chain servlets together, you have to specify a sequential list of&lt;br /&gt;servlets and associate it to an alias. When a request is made to this&lt;br /&gt;alias, the first servlet in the list is invoked, processed its task and&lt;br /&gt;sent the ouptut to the next servlet in the list as the request object.&lt;br /&gt;The output can be sent again to another servlets.&lt;br /&gt;To accomplish this method, you need to configure your servlet&lt;br /&gt;engine (JRun, JavaWeb server, JServ ...).&lt;br /&gt;For example to configure JRun for servlet chaining, you select the&lt;br /&gt;JSE service (JRun servlet engine) to access to the JSE Service&lt;br /&gt;Config panel. You have just to define a new mapping rule where&lt;br /&gt;you define your chaining servlet.&lt;br /&gt;Let say /servlets/chainServlet for the virtual path and a comma&lt;br /&gt;separated list of servlets as srvA,srvB.&lt;br /&gt;So when you invoke a request like&lt;br /&gt;http://localhost/servlets/chainServlet, internally the servlet srvA will&lt;br /&gt;be invoked first and its results will be piped into the servlet srvB.&lt;br /&gt;The srvA servlet code should look like :&lt;br /&gt;public class srvA extends HttpServlet {&lt;br /&gt;...&lt;br /&gt;public void doGet (...) {&lt;br /&gt;PrintWriter out =res.getWriter();&lt;br /&gt;rest.setContentType("text/html");&lt;br /&gt;...&lt;br /&gt;out.println("Hello Chaining servlet");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;All the servlet srvB has to do is to open an input stream to the&lt;br /&gt;request object and read the data into a BufferedReader object as&lt;br /&gt;for example :&lt;br /&gt;BufferedReader b = new BufferedReader( new&lt;br /&gt;InputStreamReader(req.getInputStream() ) );&lt;br /&gt;String data = b.readLine();&lt;br /&gt;b.close();&lt;br /&gt;After that you can format your output with the data.&lt;br /&gt;It should work straigthforward with Java Web Server or Jserv too.&lt;br /&gt;Just look at in their documentation to define an alias name. Hope&lt;br /&gt;that it'll help.&lt;br /&gt;18) Why there are no constructors in servlets?&lt;br /&gt;A servlet is just like an applet in the respect that it has an init()&lt;br /&gt;method that acts as a constrcutor. Since the servlet environment&lt;br /&gt;takes care of instantiating the servlet, an explicit constructor is not&lt;br /&gt;needed. Any initialization code you need to run should be placed in&lt;br /&gt;the init() method since it gets called when the servlet is first loaded&lt;br /&gt;by the servlet container.&lt;br /&gt;19) How to handle multiple concurrent database requests/updates when&lt;br /&gt;using JDBC with servlets?&lt;br /&gt;All the dbms provide the facility of locks whenever the data is being&lt;br /&gt;modified. There can be two scenarios:&lt;br /&gt;1. Multiple database updates on different rows, if you are using&lt;br /&gt;servlets the servlets will open multiple connections for different&lt;br /&gt;users. In this case there is no need to do additional programming.&lt;br /&gt;2. If database updates are on the same row then the rows are locked&lt;br /&gt;automatically by the dbms, hence we have to send requests to the&lt;br /&gt;dbms repeatatively until the lock is released by dbms.&lt;br /&gt;This issue is dealt with in the JDBC documentation; look up&lt;br /&gt;"Transactions" and "auto-commit". It can get pretty confusing.&lt;br /&gt;20) What is the difference between GenericServlet and HttpServlet?&lt;br /&gt;GenericServlet is for servlets that might not use HTTP, like for&lt;br /&gt;instance FTP servlets. Of course, it turns out that there's no such&lt;br /&gt;thing as FTP servlets, but they were trying to plan for future growth&lt;br /&gt;when they designed the spec. Maybe some day there will be&lt;br /&gt;another subclass, but for now, always use HttpServlet.&lt;br /&gt;21) How do you share session objects between servlets and JSP?&lt;br /&gt;Sharing sessions between a servlet and a JSP page is straight&lt;br /&gt;forward. JSP makes it a little easy by creating a session object and&lt;br /&gt;making it availabe already. In a servlet you would have to do it&lt;br /&gt;yourself. This is how:&lt;br /&gt;//create a session if one is not created already now&lt;br /&gt;HttpSession session = request.getSession(true);&lt;br /&gt;//assign the session variable to a value.&lt;br /&gt;session.putValue("variable","value");&lt;br /&gt;in the jsp page this is how you get the session value:&lt;br /&gt;&lt;%&lt;br /&gt;session.getValue("varible");&lt;br /&gt;%&gt;&lt;br /&gt;22) What is a servlet?&lt;br /&gt;A servlet is a way of extending your web server with a Java program to perform&lt;br /&gt;tasks previously dealt with by CGI scripts or proprietary server extension&lt;br /&gt;frameworks.&lt;br /&gt;23) Is there any method to unload a servlet from Web Server memory&lt;br /&gt;without restarting the server?&lt;br /&gt;There is no standard method/mechanism to unload a servlet from&lt;br /&gt;memory. Some servers, like JWS, provide the means to load and&lt;br /&gt;unload servlets from their administration module. Others, like&lt;br /&gt;Tomcat, require you to just replace the WAR file.&lt;br /&gt;24) What distinguishes a JavaBean from a Servlet?&lt;br /&gt;JavaBeans are a set of rules to follow to create reusable software&lt;br /&gt;components, or beans. This contains properties and events. At the&lt;br /&gt;end you have a component which could be examined by a program&lt;br /&gt;(like an IDE) to allow the user of your JavaBean component to&lt;br /&gt;configure it and to run in its Java programs.&lt;br /&gt;Servlets are Java classes running in a Servlet engine implementing&lt;br /&gt;a particular interface: Servlet, forcing you to implement some&lt;br /&gt;methods (service()). The servlet is an extension of your web server&lt;br /&gt;where this servlet is running on and only lets you know when a user&lt;br /&gt;requests a GET or POST calls from a web page to your servlet.&lt;br /&gt;So, both have nothing in common except Java.&lt;br /&gt;25) How much data we can store in a session object?&lt;br /&gt;Any amount of data can be stored there because the session is&lt;br /&gt;kept on the server side.&lt;br /&gt;The only limitation is sessionId length, which shouldn't exceed&lt;br /&gt;~4000 bytes - this limitation is implied by HTTP header length&lt;br /&gt;limitation to 4Kb since sessionId may be stored in the cookie or&lt;br /&gt;encoded in URL (using "URL rewriting") and the cookie&lt;br /&gt;specification says the size of cookie as well as HTTP request (e.g.&lt;br /&gt;GET /document.html\n) cannot be longer then 4kb.&lt;br /&gt;26) What is the difference between the doGet and doPost methods?&lt;br /&gt;doGet is called in response to an HTTP GET request. This happens&lt;br /&gt;when users click on a link, or enter a URL into the browser's&lt;br /&gt;address bar. It also happens with some HTML FORMs (those with&lt;br /&gt;METHOD="GET" specified in the FORM tag).&lt;br /&gt;doPost is called in response to an HTTP POST request. This&lt;br /&gt;happens with some HTML FORMs (those with METHOD="POST"&lt;br /&gt;specified in the FORM tag).&lt;br /&gt;Both methods are called by the default (superclass) implementation&lt;br /&gt;of service in the HttpServlet base class. You should override one or&lt;br /&gt;both to perform your servlet's actions. You probably shouldn't&lt;br /&gt;override service().&lt;br /&gt;27) What is the difference between encodeRedirectUrl and encodeURL?&lt;br /&gt;encodeURL and encodeRedirectURL are methods of the&lt;br /&gt;HttpResponse object. Both rewrite a raw URL to include session&lt;br /&gt;data if necessary. (If cookies are on, both are no-ops.)&lt;br /&gt;encodeURL is for normal links inside your HTML pages.&lt;br /&gt;encodeRedirectURL is for a link you're passing to&lt;br /&gt;response.sendRedirect(). It has slightly different syntax&lt;br /&gt;requirements too gory to get into here.&lt;br /&gt;28) Can I use System.exit() in servlets?&lt;br /&gt;Gack! No no no no no...&lt;br /&gt;At best, you'll get a security exception. At worst, you'll make the&lt;br /&gt;servlet engine, or maybe the entire web server, quit. You don't really&lt;br /&gt;want to do that, huh? :-)&lt;br /&gt;29) I am opening a single JDBC connection in my init() method. Do I need&lt;br /&gt;to synchronize on the Connection or the Statement object?&lt;br /&gt;You shouldn't have to. If your JDBC driver supports multiple&lt;br /&gt;connections, then the various createStatement methods will give&lt;br /&gt;you a thread-safe, reentrant, independent Statement that should&lt;br /&gt;work OK, even if other requests/threads are also accessing other&lt;br /&gt;Statements on the same Connection.&lt;br /&gt;Of course, crossing your fingers never hurts... Many early JDBC&lt;br /&gt;drivers were not re-entrant. The modern versions of JDBC drivers&lt;br /&gt;should work OK, but there are never any guarantees.&lt;br /&gt;Using connection pooling will avoid the whole issue, plus will lead&lt;br /&gt;to improved performance. See this FAQ for more information.&lt;br /&gt;30) How can I determine the name and version number of the servlet or JSP&lt;br /&gt;engine that I am using?&lt;br /&gt;From within a servlet, you can invoke the&lt;br /&gt;ServletContext.getServerInfo() method as follows:&lt;br /&gt;String thisServer=&lt;br /&gt;getServletConfig().getServletContext().getServerInfo();&lt;br /&gt;If you are using JSP, you can use this expression:&lt;br /&gt;&lt;%= application.getServerInfo() %&gt;&lt;br /&gt;1) How can I get the absolute URL of a servlet/JSP page at runtime ?&lt;br /&gt;You can get all the necessary information to determine the URL&lt;br /&gt;from the request object. To reconstruct the absolute URL from the&lt;br /&gt;scheme, server name, port, URI and query string you can use the&lt;br /&gt;URL class from java.net. The following code fragment will&lt;br /&gt;determine your page's absolute URL:&lt;br /&gt;String file = request.getRequestURI();&lt;br /&gt;if (request.getQueryString() != null) {&lt;br /&gt;file += '?' + request.getQueryString();&lt;br /&gt;}&lt;br /&gt;URL reconstructedURL = new URL(request.getScheme(),&lt;br /&gt;request.getServerName(),&lt;br /&gt;request.getServerPort(),&lt;br /&gt;file);&lt;br /&gt;out.println(URL.toString());&lt;br /&gt;32) Why do GenericServlet and HttpServlet implement the Serializable&lt;br /&gt;interface?&lt;br /&gt;GenericServlet and HttpServlet implement the Serializable interface&lt;br /&gt;so that servlet engines can "hybernate" the servlet state when the&lt;br /&gt;servlet is not in use and reinstance it when needed or to duplicate&lt;br /&gt;servlet instances for better load balancing. I don't know if or how&lt;br /&gt;current servlet engines do this, and it could have serious&lt;br /&gt;implications, like breaking references to objects gotten in the init()&lt;br /&gt;method without the programmer knowing it. Programmers should&lt;br /&gt;be aware of this pitfall and implement servlets which are stateless&lt;br /&gt;as possible, delegating data store to Session objects or to the&lt;br /&gt;ServletContext. In general stateless servlets are better because they&lt;br /&gt;scale much better and are cleaner code.&lt;br /&gt;33) How does one choose between overriding the doGet(), doPost(), and&lt;br /&gt;service() methods?&lt;br /&gt;The differences between the doGet() and doPost() methods are that&lt;br /&gt;they are called in the HttpServlet that your servlet extends by its&lt;br /&gt;service() method when it recieves a GET or a POST request from a&lt;br /&gt;HTTP protocol request.&lt;br /&gt;A GET request is a request to get a resource from the server. This&lt;br /&gt;is the case of a browser requesting a web page. It is also possible&lt;br /&gt;to specify parameters in the request, but the length of the&lt;br /&gt;parameters on the whole is limited. This is the case of a form in a&lt;br /&gt;web page declared this way in html: &lt;form method="GET"&gt; or&lt;br /&gt;&lt;form&gt;.&lt;br /&gt;A POST request is a request to post (to send) form data to a&lt;br /&gt;resource on the server. This is the case of of a form in a web page&lt;br /&gt;declared this way in html: &lt;form method="POST"&gt;. In this case the&lt;br /&gt;size of the parameters can be much greater.&lt;br /&gt;The GenericServlet has a service() method that gets called when a&lt;br /&gt;client request is made. This means that it gets called by both&lt;br /&gt;incoming requests and the HTTP requests are given to the servlet&lt;br /&gt;as they are (you must do the parsing yourself).&lt;br /&gt;The HttpServlet instead has doGet() and doPost() methods that get&lt;br /&gt;called when a client request is GET or POST. This means that the&lt;br /&gt;parsing of the request is done by the servlet: you have the&lt;br /&gt;appropriate method called and have convenience methods to read&lt;br /&gt;the request parameters.&lt;br /&gt;NOTE: the doGet() and doPost() methods (as well as other HttpServlet&lt;br /&gt;methods) are called by the service() method.&lt;br /&gt;Concluding, if you must respond to GET or POST requests made&lt;br /&gt;by a HTTP protocol client (usually a browser) don't hesitate to&lt;br /&gt;extend HttpServlet and use its convenience methods.&lt;br /&gt;If you must respond to requests made by a client that is not using&lt;br /&gt;the HTTP protocol, you must use service().&lt;br /&gt;34) How do servlets differ from RMI? What are the advantages and&lt;br /&gt;disadvantages of each technology?&lt;br /&gt;Servlets extend the server-side functionality of a website. Servlets&lt;br /&gt;communicate with other application(s) on that server (or any other&lt;br /&gt;server) and perform tasks above and beyond the "normal" static&lt;br /&gt;HTML document. A servlet can receive a request to get some&lt;br /&gt;information through EJB from one or more databases, then convert&lt;br /&gt;this data into a static HTML/WML page for the client to see, for&lt;br /&gt;example. Even if the servlet talks to many other applications all&lt;br /&gt;over the world to get this information, it still looks like it happened at&lt;br /&gt;that website.&lt;br /&gt;RMI (Remote Method Invocation) is just that - a way to invoke&lt;br /&gt;methods on remote machines. It is way for an application to talk to&lt;br /&gt;another remote machine and execute different methods, all the&lt;br /&gt;while appearing as if the action was being performed on the local&lt;br /&gt;machine.&lt;br /&gt;Servlets (or JSP) are mainly used for any web-related activity such&lt;br /&gt;as online banking, online grocery stores, stock trading, etc. With&lt;br /&gt;servlets, you need only to know the web address and the pages&lt;br /&gt;displayed to you take care of calling the different servlets (or&lt;br /&gt;actions within a servlet) for you. Using RMI, you must bind the RMI&lt;br /&gt;server to an IP and port, and the client who wishes to talk to the&lt;br /&gt;remote server must know this IP and port, unless of course you&lt;br /&gt;used some kind of in-between lookup utility, which you could do&lt;br /&gt;with (of all things) servlets.&lt;br /&gt;35) How can we use a servlet as a proxy for communications between two&lt;br /&gt;applets?&lt;br /&gt;One way to accomplish this is to have the applets communicate via&lt;br /&gt;TCP/IP sockets to the servlet. The servlet would then use a custom&lt;br /&gt;protocol to receive and push information between applets.&lt;br /&gt;However, this solution does have firewall problems if the system is&lt;br /&gt;to be used over and Internet verses an Intranet.&lt;br /&gt;36) How can I design my servlet/JSP so that query results get displayed on&lt;br /&gt;several pages, like the results of a search engine? Each page should&lt;br /&gt;display, say, 10 records each and when the next link is clicked, I should see&lt;br /&gt;the next/previous 10 records and so on.&lt;br /&gt;Use a Java Bean to store the entire result of the search that you have&lt;br /&gt;found. The servlet will then set a pointer to the first line to be displayed in&lt;br /&gt;the page and the number of lines to display, and force a display of the&lt;br /&gt;page. The Action in the form would point back to the servlet in the JSP&lt;br /&gt;page which would determine whether a next or previous button has been&lt;br /&gt;pressed and reset the pointer to previous pointer + number of lines and&lt;br /&gt;redisplay the page. The JSP page would have a scriplet to display data&lt;br /&gt;from the Java Bean from the start pointer set to the maximum number of&lt;br /&gt;lines with buttons to allow previous or next pages to be selected. These&lt;br /&gt;buttons would be displayed based on the page number (i.e. if first then&lt;br /&gt;don't display previous button).&lt;br /&gt;37) How do I deal with multi-valued parameters in a servlet?&lt;br /&gt;Instead of using getParameter() with the ServletRequest, as you&lt;br /&gt;would with single-valued parameters, use the&lt;br /&gt;getParameterValues() method. This returns a String array (or null)&lt;br /&gt;containing all the values of the parameter requested.&lt;br /&gt;38) How can I pass data retrieved from a database by a servlet to a JSP&lt;br /&gt;page?&lt;br /&gt;One of the better approaches for passing data retrieved from a&lt;br /&gt;servlet to a JSP is to use the Model 2 architecture as shown below:&lt;br /&gt;Basically, you need to first design a bean which can act as a&lt;br /&gt;wrapper for storing the resultset returned by the database query&lt;br /&gt;within the servlet. Once the bean has been instantiated and&lt;br /&gt;initialized by invoking its setter methods by the servlet, it can be&lt;br /&gt;placed within the request object and forwarded to a display JSP&lt;br /&gt;page as follows:&lt;br /&gt;com.foo.dbBean bean = new com.foo.dbBean();&lt;br /&gt;//call setters to initialize bean&lt;br /&gt;req.setAttribute("dbBean", bean);&lt;br /&gt;url="..."; //relative url for display jsp page&lt;br /&gt;ServletContext sc = getServletContext();&lt;br /&gt;RequestDispatcher rd = sc.getRequestDispatcher(url);&lt;br /&gt;rd.forward(req, res);&lt;br /&gt;The bean can then be accessed within the JSP page via the&lt;br /&gt;useBean tag as:&lt;br /&gt;&lt;jsp:useBean id="dbBean" class="com.foo.dbBean"&lt;br /&gt;scope="request"/&gt;&lt;br /&gt;...&lt;br /&gt;&lt;%&lt;br /&gt;//iterate through the rows within dbBean and&lt;br /&gt;//access the values using a scriptlet&lt;br /&gt;%&gt;&lt;br /&gt;Also, it is best to design your application such that you avoid&lt;br /&gt;placing beans into the session unless absolutely necessary. Placing&lt;br /&gt;large objects within the session imposes a heavy burden on the&lt;br /&gt;performance of the servlet engine. Of course, there may be&lt;br /&gt;additional design considerations to take care of - especially if your&lt;br /&gt;servlets are running under a clustered or fault-tolerant architecture.&lt;br /&gt;39) How can I use a servlet to generate a site using frames?&lt;br /&gt;In general, look at each frame as a unique document capable of sending its own&lt;br /&gt;requests and receiving its own responses. You can create a top servlet (say,&lt;br /&gt;FrameServlet) that upon invocation creates the frame layout you desire and sets&lt;br /&gt;the SRC parameters for the frame tags to be another servlet, a static page or any&lt;br /&gt;other legal value for SRC.&lt;br /&gt;---------------------- SAMPLE ----------------------&lt;br /&gt;public void doGet(HttpServletRequest request,&lt;br /&gt;HttpServletResponse response) throws&lt;br /&gt;ServletException, IOException&lt;br /&gt;{&lt;br /&gt;response.setContentType("text/html");&lt;br /&gt;PrintWriter out = new PrintWriter&lt;br /&gt;(response.getWriter());&lt;br /&gt;out.println("&lt;html&gt;");&lt;br /&gt;out.println("&lt;head&gt;Your Title&lt;/head&gt;");&lt;br /&gt;// definingthe three rows of Frames for the main&lt;br /&gt;page&lt;br /&gt;// top : frm_1&lt;br /&gt;// middle : frm_2&lt;br /&gt;// bottom : frm_3&lt;br /&gt;out.println("&lt;frameset rows=12%,70%,* cols=*&gt;");&lt;br /&gt;out.println("&lt;frame&lt;br /&gt;src=/servlets/MenuServlet name=frm_1&gt;");&lt;br /&gt;out.println("&lt;frame&lt;br /&gt;src=/servlets/DummyServlet?mode=full&lt;br /&gt;name=frm_2&gt;");&lt;br /&gt;out.println("&lt;frame&lt;br /&gt;src=/servlets/DummyServlet?mode=small&lt;br /&gt;name=frm_3&gt;");&lt;br /&gt;out.println("&lt;/frameset&gt;");&lt;br /&gt;out.println("&lt;body&gt;");&lt;br /&gt;out.println("&lt;/body&gt;&lt;/html&gt;");&lt;br /&gt;out.close();&lt;br /&gt;-------------------------- END&lt;br /&gt;------------------------------------------&lt;br /&gt;Where MenuServlet and DummyServlet provide content and&lt;br /&gt;behavior for the frames generated by FrameServlet.&lt;br /&gt;40) What is HTTP tunneling, in the general sense?&lt;br /&gt;HTTP tunneling is a general technique whereby arbitrary data may&lt;br /&gt;be sent via an HTTP connection to and from CGI scripts or Java&lt;br /&gt;Servlets on a Web server. This is done by serializing the data to be&lt;br /&gt;transmitted into a stream of bytes, and sending an HTTP message&lt;br /&gt;with content type "application/octet-stream".&lt;br /&gt;HTTP tunneling is also referred to as Firewall tunneling.&lt;br /&gt;41) How do I handle FORMs with multiple form elements (e.g. radio&lt;br /&gt;buttons) using the same name?&lt;br /&gt;For radio buttons, the HTML spec assumes that a given group of&lt;br /&gt;buttons will have the same NAME and different VALUEs; the&lt;br /&gt;browser makes sure that only one button per group name will be&lt;br /&gt;selected (at most). So you can just call&lt;br /&gt;request.getParameter("groupname").&lt;br /&gt;&lt;input type="radio" name="topping" value="cheese"&lt;br /&gt;checked&gt;Cheese&lt;br /&gt;&lt;input type="radio" name="topping"&lt;br /&gt;value="pepperoni"&gt;Pepperoni&lt;br /&gt;&lt;input type="radio" name="topping"&lt;br /&gt;value="anchovies"&gt;Anchovies&lt;br /&gt;If the user selects "Pepperoni" then&lt;br /&gt;request.getParameter("topping") will return the string "pepperoni".&lt;br /&gt;For lists using the &lt;select multiple&gt; FORM tag, multiple values can&lt;br /&gt;be returned for the same parameter name. When that can happen,&lt;br /&gt;use request.getParameterValues("param") which returns a String[]&lt;br /&gt;you can iterate through.&lt;br /&gt;It's bad form (so to speak), but you can also duplicate other&lt;br /&gt;element types, like&lt;br /&gt;Name 1: &lt;input type="text" name="name"&lt;br /&gt;value="Dick"&gt;&lt;br /&gt;Name 2: &lt;input type="text" name="name"&lt;br /&gt;value="Jane"&gt;&lt;br /&gt;These also get returned in an array by&lt;br /&gt;request.getParameterValues().&lt;br /&gt;42) How do I separate presentation (HTML) from business logic (Java)&lt;br /&gt;when using servlets?&lt;br /&gt;Almost anybody who has ever written a servlet can identify with this&lt;br /&gt;one. We all know it's bad for to embed HTML code in our java&lt;br /&gt;source; it's lame to have to recompile and re-deploy every time you&lt;br /&gt;want an HTML element to look a bit different. But what are our&lt;br /&gt;choices here? There are two basic options;&lt;br /&gt;1. Use JSP: Java Server Pages allows you to embed Java code or&lt;br /&gt;the results of a servlet into your HTML. You could, for instance,&lt;br /&gt;define a servlet that gives a stock quote, then use the &lt;servlet&gt; tag&lt;br /&gt;in a JSP page to embed the output. But then, this brings up the&lt;br /&gt;same problem; without discipline, your content/presentation and&lt;br /&gt;program logic are again meshed. I think the ideal here is to&lt;br /&gt;completely separate the two.&lt;br /&gt;2. Use a templating/parsing system: Hmm...I know you're about&lt;br /&gt;to rant about re-inventing the wheel, but it's not that bad (see&lt;br /&gt;below). Plus, it really does pay to take this approach; you can have&lt;br /&gt;a group of programmers working on the Java code, and a group of&lt;br /&gt;HTML producers maintaining the interface. So now you probably&lt;br /&gt;want to know how to do it...so read on.&lt;br /&gt;Use SSI!&lt;br /&gt;Remember SSI? It hasn't gotten much attention in recent years&lt;br /&gt;because of embeddable scripting languages like ASP and JSP, but&lt;br /&gt;it still remains a viable option. To leverage it in the servlet world, I&lt;br /&gt;believe the best way is to use an API called SSI for Java from&lt;br /&gt;Areane. This API will let you emulate SSI commands from a&lt;br /&gt;templating system, and much more. It will let you execute any&lt;br /&gt;command on any system, including executing java classes! It also&lt;br /&gt;comes with several utility classes for creating stateful HTML form&lt;br /&gt;elements, tables for use with iteration, and much more. It's also&lt;br /&gt;open source, so it's free and you can tweak it to your heart's&lt;br /&gt;content! You can read the SSI for Java documentation for detailed&lt;br /&gt;info, but the following is an example of its use.&lt;br /&gt;Here's the servlet:&lt;br /&gt;import javax.servlet.*;&lt;br /&gt;import javax.servlet.http.*;&lt;br /&gt;import java.io.*;&lt;br /&gt;import java.util.*;&lt;br /&gt;import com.areane.www.ssi.*;&lt;br /&gt;public class SSITemplatingServlet extends HttpServlet {&lt;br /&gt;private String templateFilesDirectory =&lt;br /&gt;"d:\\projects\\idemo\\templates\\"; //Holds path to template files&lt;br /&gt;/**Handles GET requests; defers every request to the POST&lt;br /&gt;processor*/&lt;br /&gt;public void doGet(HttpServletRequest req, HttpServletResponse&lt;br /&gt;res)&lt;br /&gt;throws ServletException, IOException,&lt;br /&gt;FileNotFoundException {doPost(req, res);}&lt;br /&gt;/**Handles all requests. Processes the request,&lt;br /&gt;*saves the values, parses the file, then feeds the file to the out&lt;br /&gt;stream*/&lt;br /&gt;public void doPost(HttpServletRequest req, HttpServletResponse&lt;br /&gt;res)&lt;br /&gt;throws ServletException, IOException,&lt;br /&gt;FileNotFoundException {&lt;br /&gt;HttpSession ses =&lt;br /&gt;req.getSession(true);&lt;br /&gt;Properties context = null;&lt;br /&gt;if((context = (Properties)ses.getValue("user.context"))&lt;br /&gt;== null) { //if properties doesn't already exist, create it.&lt;br /&gt;context = new Properties();&lt;br /&gt;}&lt;br /&gt;//Write parameters to Properties object&lt;br /&gt;Enumeration paramNames =&lt;br /&gt;req.getParameterNames();&lt;br /&gt;String curName, curVal;&lt;br /&gt;while(paramNames.hasMoreElements()) {&lt;br /&gt;curName =&lt;br /&gt;(String)paramNames.nextElement();&lt;br /&gt;curVal = req.getParameter(curName);&lt;br /&gt;context.setProperty(curName, curVal);&lt;br /&gt;}&lt;br /&gt;//Save the values to the session&lt;br /&gt;ses.putValue("user.context", context);&lt;br /&gt;//Parse the page and stream to the client&lt;br /&gt;String templateName =&lt;br /&gt;req.getParameter("template"); // Get the file name of the template&lt;br /&gt;to use&lt;br /&gt;res.setContentType("text/html");&lt;br /&gt;SsiPage page =&lt;br /&gt;SsiParser.parse(this.templateFilesDirectory + templateName);&lt;br /&gt;//Parsing occurs here&lt;br /&gt;page.write(res.getWriter(), context); //Stream to the&lt;br /&gt;client&lt;br /&gt;page = null; //clean up&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Now, just create a template file, pass the servlet the template file&lt;br /&gt;name, and have at it!&lt;br /&gt;43) For an HTML FORM with multiple SUBMIT buttons, how can a servlet&lt;br /&gt;ond differently for each button?&lt;br /&gt;The servlet will respond differently for each button based on the&lt;br /&gt;html that you have placed in the HTML page. Let's explain.&lt;br /&gt;For a submit button the HTML looks like &lt;input type=submit&lt;br /&gt;name="Left" value="left"&gt;. A servlet could extract the value of this&lt;br /&gt;submit by using the getParameter("Left") from the HttpRequest&lt;br /&gt;object. It follows then that if you have HTML within a FORM that&lt;br /&gt;appears as:&lt;br /&gt;&lt;input type=submit name="Direction" value="left"&gt;&lt;br&gt;&lt;br /&gt;&lt;input type=submit name="Direction" value="right"&gt;&lt;br&gt;&lt;br /&gt;&lt;input type=submit name="Direction" value="up"&gt;&lt;br&gt;&lt;br /&gt;&lt;input type=submit name="Direction" value="down"&gt;&lt;br&gt;&lt;br /&gt;Then the getParameter("Direction") from the HttpRequest would&lt;br /&gt;extract the value pressed by the user, either "left", "right", "up" or&lt;br /&gt;"down". A simple comparision in the servlet with the these values&lt;br /&gt;could occur and processing based on the submit button would be&lt;br /&gt;performed.&lt;br /&gt;Similiarly,for submit buttons with different names on a page, each of&lt;br /&gt;these values could be extracted using the getParameter() call and&lt;br /&gt;acted on. However, in a situation where there are multiple buttons,&lt;br /&gt;common practice would be to use one name and multiple values to&lt;br /&gt;identify the button pressed.&lt;br /&gt;44) What is meant by the term "business logic"?&lt;br /&gt;"Business logic" is just a fancy way of saying "code." :-)&lt;br /&gt;More precisely, in a three-tier architecture, business logic is any&lt;br /&gt;code that is not specifically related to storing and retrieving data&lt;br /&gt;(that's "data storage code"), or to formatting data for display to the&lt;br /&gt;user (that's "presentation logic"). It makes sense, for many reasons,&lt;br /&gt;to store this business logic in separate objects; the middle tier&lt;br /&gt;comprises these objects. However, the divisions between the three&lt;br /&gt;layers are often blurry, and business logic is more of an ideal than a&lt;br /&gt;reality in most programs. The main point of the term is, you want&lt;br /&gt;somewhere to store the logic and "business rules" (another&lt;br /&gt;buzzword) of your application, while keeping the division between&lt;br /&gt;tiers clear and clean.&lt;br /&gt;45) How can I explicitly unload a servlet or call the destroy method?&lt;br /&gt;In general, you can't. The Servlet API does not specify when a&lt;br /&gt;servlet is unloaded or how the destroy method is called. Your&lt;br /&gt;servlet engine (ie the implementation of the interfaces in the JSDK)&lt;br /&gt;might provide a way to do this, probably through its administration&lt;br /&gt;interface/tool (like Webshpere or JWS). Most servlet engines will&lt;br /&gt;also destroy and reload your servlet if they see that the class file(s)&lt;br /&gt;have been modified.&lt;br /&gt;46) What is a servlet bean?&lt;br /&gt;A servlet bean is a serializable servlet that follows the JavaBeans&lt;br /&gt;component architecture, basically offering getter/setter methods.&lt;br /&gt;As long as you subclass GenericServlet/HttpServlet, you are&lt;br /&gt;automatically Serializable.&lt;br /&gt;If your web server supports them, when you install the servlet in the&lt;br /&gt;web server, you can configure it through a property sheet-like&lt;br /&gt;interface.&lt;br /&gt;47) Why do we need to call super.init(config) in the init method of a servlet?&lt;br /&gt;Just do as you're told and you won't get hurt! :-)&lt;br /&gt;Because if you don't, then the config object will get lost. Just extend&lt;br /&gt;HttpServlet, use init() (no parameters) and it'll all work ok.&lt;br /&gt;From the Javadoc: init() - A convenience method which can be&lt;br /&gt;overridden so that there's no need to call super.init(config).&lt;br /&gt;48) What is a servlet engine?&lt;br /&gt;A "servlet engine" is a program that plugs in to a web server and&lt;br /&gt;runs servlets. The term is obsolete; the preferred term now is&lt;br /&gt;"servlet container" since that applies both to plug-in engines and to&lt;br /&gt;stand-alone web servers that support the Servlet API.&lt;br /&gt;49) Which is the most efficient (i.e. processing speed) way to create a&lt;br /&gt;server application that accesses a database: A Servlet using JDBC; a JSP&lt;br /&gt;page using a JavaBean to carry out the db access; or JSP combined with a&lt;br /&gt;Servlet? Are these my only choices?&lt;br /&gt;Your question really should be broken in two.&lt;br /&gt;1-What is the most efficient way of serving pages from a Java&lt;br /&gt;object?. There you have a clear winner in the Servlet. Althought if&lt;br /&gt;you are going to change the static content of the page often is&lt;br /&gt;going to be a pain because you'll have to change Java code. The&lt;br /&gt;second place in speed is for JSP pages. But, depending on your&lt;br /&gt;application, the difference in speed between JSP pages and raw&lt;br /&gt;servlets can be so small that is not worth the extra work of servlet&lt;br /&gt;programming.&lt;br /&gt;2-What is the most efficient way of accessing a database from&lt;br /&gt;Java?. If JDBC is the way you want to go the I'd suggest to pick as&lt;br /&gt;many drivers as you can (II,III,IV or wathever) and benchmark&lt;br /&gt;them. Type I uses a JDBC/ODBC bridge and usually has lousy&lt;br /&gt;performance. Again, go for the simplest (usually type IV driver)&lt;br /&gt;solution if that meets you performance needs.&lt;br /&gt;For database applications, the performance bottleneck is usually&lt;br /&gt;the database, not the web server/engine. In this case, the use of a&lt;br /&gt;package that access JDBC with connection pooling at the&lt;br /&gt;application level used from JSP pages (with or withouth beans as&lt;br /&gt;middleware) is the usual choice. Of course, your applications&lt;br /&gt;requirements may vary.&lt;br /&gt;50) How can I change the port of my Java Web Server from 8080 to&lt;br /&gt;something else?&lt;br /&gt;It is very simple. JAVA WEB SERVER comes with remote Web&lt;br /&gt;administration tool. You can access this with a web browser.&lt;br /&gt;Administration tool is located on port 9090 on your web server. To&lt;br /&gt;change port address for web server:&lt;br /&gt;1. Access tool (http://hostname:9090)&lt;br /&gt;2. Enter User Id/Password (by default it is admin/admin)&lt;br /&gt;3. Select service (Web service)&lt;br /&gt;4. Click on "manage" button. You will get a popup screen with all&lt;br /&gt;settings.&lt;br /&gt;5. Click on network tree node, On right hand side you will get text&lt;br /&gt;box for entering port no.&lt;br /&gt;6. Change port number with desire one.&lt;br /&gt;7. click on restart button.&lt;br /&gt;51) Can I send multiple responses for a single request?&lt;br /&gt;No. That doesn't even make sense :-)&lt;br /&gt;You can, however, send a "redirect", which tells the user's browser&lt;br /&gt;to send another request, possibly to the same servlet with different&lt;br /&gt;parameters. Search this FAQ on "redirect" to learn more.&lt;br /&gt;52) What is FORM based login and how do I use it? Also, what servlet&lt;br /&gt;containers support it?&lt;br /&gt;Form based login is one of the four known web based login&lt;br /&gt;mechanisms. For completeness I list all of them with a description&lt;br /&gt;of their nature:&lt;br /&gt;1. HTTP Basic Authentication&lt;br /&gt;An authentication protocol defined within the HTTP protocol&lt;br /&gt;(and based on headers). It indicates the HTTP realm for&lt;br /&gt;which access is being negotiated and sends passwords with&lt;br /&gt;base64 encoding, therefore it is not very secure. (See&lt;br /&gt;RFC2068 for more information.)&lt;br /&gt;2. HTTP Digest Authentication&lt;br /&gt;Like HTTP Basic Authentication, but with the password&lt;br /&gt;transmitted in an encrypted form. It is more secure than&lt;br /&gt;Basic, but less then HTTPS Authentication which uses&lt;br /&gt;private keys. Yet it is not currently in widespread use.&lt;br /&gt;3. HTTPS Authentication (SSL Mutual Authentication)&lt;br /&gt;This security mechanism provides end user authentication&lt;br /&gt;using HTTPS (HTTP over SSL). It performs mutual (client &amp;&lt;br /&gt;server) certificate based authentication with a set of different&lt;br /&gt;cipher suites.&lt;br /&gt;4. Form Based Login&lt;br /&gt;A standard HTML form (static, Servlet/JSP or script&lt;br /&gt;generated) for logging in. It can be associated with&lt;br /&gt;protection or user domains, and is used to authenticate&lt;br /&gt;previously unauthenticated users.&lt;br /&gt;The major advantage is that the look and feel of the login&lt;br /&gt;screen can be controlled (in comparison to the HTTP&lt;br /&gt;browsers' built in mechanisms).&lt;br /&gt;To support 1., 3., and 4. of these authentication mechanisms is a&lt;br /&gt;requirement of the J2EE Specification (as of v1.2, 3.4.1.3 Required&lt;br /&gt;Login Mechanisms). (HTTP Digest Authentication is not a&lt;br /&gt;requirement, but containers are encouraged to support it.)&lt;br /&gt;You can also see section 3.3.11.1 of the J2EE Specs. (User&lt;br /&gt;Authentication, Web Client) for more detailed descriptions of the&lt;br /&gt;mechanisms.&lt;br /&gt;Thus any Servlet container that conforms to the J2EE Platform&lt;br /&gt;specification should support form based login.&lt;br /&gt;To be more specific, the Servlet 2.2 Specification&lt;br /&gt;describes/specifies the same mechanisms in 11.5 including form&lt;br /&gt;based login in 11.5.3.&lt;br /&gt;This section (11.5.3) describes in depth the nature, the&lt;br /&gt;requirements and the naming conventions of form based login&lt;br /&gt;and I suggest to take a look at it.&lt;br /&gt;Here is a sample of a conforming HTML login form:&lt;br /&gt;&lt;form method="POST" action="j_security_check"&gt;&lt;br /&gt;&lt;input type="text" name="j_username"&gt;&lt;br /&gt;&lt;input type="password" name="j_password"&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;Known Servlet containers that support FORM-based login are:&lt;br /&gt;· iPlanet Application Server&lt;br /&gt;· Tomcat (the reference implementation of the Java Servlet API)&lt;br /&gt;53) How do I capture a request and dispatch the exact request (with all the&lt;br /&gt;parameters received) to another URL?&lt;br /&gt;As far as i know it depends on the location of the next target url.&lt;br /&gt;· If the next servlet url is in the same host, then you can use the&lt;br /&gt;forward method.&lt;br /&gt;Here is an example code about using forward:&lt;br /&gt;· RequestDispatcher rd = null;&lt;br /&gt;· String targetURL = "target_servlet_name";&lt;br /&gt;· ServletContext ctx = this.getServletContext();&lt;br /&gt;· rd = ctx.getRequestDispatcher(targetURL);&lt;br /&gt;· rd.forward(request, response);&lt;br /&gt;54) How can the data within an HTML form be refreshed automatically&lt;br /&gt;whenever there is a change in the database?&lt;br /&gt;JSP is intended for dynamically generating pages. The generated&lt;br /&gt;pages can include wml, html, dhtml or whatever you want...&lt;br /&gt;When you have a generated page, JSP has already made its work.&lt;br /&gt;From this moment you have a page.&lt;br /&gt;If you want automatic refreshing, then this should be acomplished&lt;br /&gt;by the technology included in the generated page (JSP will tell only&lt;br /&gt;what to include in the page).&lt;br /&gt;The browser can not be loaded by extern factors. The browser is&lt;br /&gt;the one who fetches url's since the http protocol is requestresponse&lt;br /&gt;based. If a server can reload a browser without its allow,&lt;br /&gt;it implies that we could be receiving pages which we haven't asked&lt;br /&gt;for from servers.&lt;br /&gt;May you could use applets and a ServerSocket for receiving&lt;br /&gt;incoming signals from the server for changed data in the DB. This&lt;br /&gt;way you can load new information inside the applet or try to force a&lt;br /&gt;page reload.&lt;br /&gt;[That's a nice idea -- it could use the showDocument() call to reload&lt;br /&gt;the current page. It could also use HTTP polling instead of&lt;br /&gt;maintaining an expensive socket connection. -Alex]&lt;br /&gt;Perhaps (if possible), could be simpler using an automatic&lt;br /&gt;JavaScript refreshing function that force page reload after a&lt;br /&gt;specified time interval.&lt;br /&gt;55) What is a web application (or "webapp")?&lt;br /&gt;A web application is a collection of servlets, html pages, classes, and&lt;br /&gt;other resources that can be bundled and run on multiple containers from&lt;br /&gt;multiple vendors. A web application is rooted at a specific path within a&lt;br /&gt;web server. For example, a catalog application could be located at http://&lt;br /&gt;www.mycorp.com/catalog. All requests that start with this prefix will be&lt;br /&gt;routed to the ServletContext which represents the catalog application.&lt;br /&gt;56) How can I call a servlet from a JSP page? How can I pass variables&lt;br /&gt;from the JSP that the servlet can access?&lt;br /&gt;You can use &lt;jsp:forward page="/relativepath/YourServlet" /&gt; or&lt;br /&gt;response.sendRedirect("http://path/YourServlet").&lt;br /&gt;Variables can be sent as:&lt;br /&gt;&lt;jsp:forward page=/relativepath/YourServlet&gt;&lt;br /&gt;&lt;jsp:param name="name1" value="value1" /&gt;&lt;br /&gt;&lt;jsp:param name="name2" value="value2" /&gt;&lt;br /&gt;&lt;/jsp:forward&gt;&lt;br /&gt;You may also pass parameters to your servlet by specifying&lt;br /&gt;response.sendRedirect("http://path/YourServlet?param1=val1").&lt;br /&gt;57) Can there be more than one instance of a servlet at one time ?&lt;br /&gt;It is important to note that there can be more than one instance of a&lt;br /&gt;given Servlet class in the servlet container. For example, this can&lt;br /&gt;occur where there was more than one servlet definition that utilized&lt;br /&gt;a specific servlet class with different initialization parameters. This&lt;br /&gt;can also occur when a servlet implements the SingleThreadModel&lt;br /&gt;interface and the container creates a pool of servlet instances to&lt;br /&gt;use.&lt;br /&gt;58) How can I measure the file downloading time using servlets?&lt;br /&gt;ServletOutputStream out = response.getOutputStream();&lt;br /&gt;String filename =&lt;br /&gt;getServletContext().getRealPath(request.getQueryString());&lt;br /&gt;FileInputStream fin = new FileInputStream(filename);&lt;br /&gt;long start = System.currentTimeMillis();&lt;br /&gt;byte data[] = new byte[1024];&lt;br /&gt;int len = 0;&lt;br /&gt;while ((len = fin.read(data)) &gt; 0) {&lt;br /&gt;out.write(data, 0, len);&lt;br /&gt;}&lt;br /&gt;out.flush();&lt;br /&gt;long stop = System.currentTimeMills();&lt;br /&gt;log("took " + (stop - start) + "ms to download " + filename);&lt;br /&gt;59) What is inter-servlet communication?&lt;br /&gt;As the name says it, it is communication between servlets. Servlets&lt;br /&gt;talking to each other. [There are many ways to communicate&lt;br /&gt;between servlets, including&lt;br /&gt;· Request Dispatching&lt;br /&gt;· HTTP Redirect&lt;br /&gt;· Servlet Chaining&lt;br /&gt;· HTTP request (using sockets or the URLConnection class)&lt;br /&gt;· Shared session, request, or application objects (beans)&lt;br /&gt;· Direct method invocation (deprecated)&lt;br /&gt;· Shared static or instance variables (deprecated)&lt;br /&gt;Search the FAQ, especially topic Message Passing (including&lt;br /&gt;Request Dispatching) for information on each of these techniques.&lt;br /&gt;-Alex]&lt;br /&gt;Basically interServlet communication is acheived through servlet&lt;br /&gt;chaining. Which is a process in which you pass the output of one&lt;br /&gt;servlet as the input to other. These servlets should be running in&lt;br /&gt;the same server.&lt;br /&gt;e.g. ServletContext.getRequestDispatcher(HttpRequest,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;HttpResponse).forward("NextServlet") ; You can pass in the current&lt;br /&gt;request and response object from the latest form submission to the&lt;br /&gt;next servlet/JSP. You can modify these objects and pass them so&lt;br /&gt;that the next servlet/JSP can use the results of this servlet.&lt;br /&gt;There are some Servlet engine specific configurations for servlet&lt;br /&gt;chaining.&lt;br /&gt;Servlets can also call public functions of other servlets running in&lt;br /&gt;the same server. This can be done by obtaining a handle to the&lt;br /&gt;desired servlet through the ServletContext Object by passing it the&lt;br /&gt;servlet name ( this object can return any servlets running in the&lt;br /&gt;server). And then calling the function on the returned Servlet object.&lt;br /&gt;e.g. TestServlet test=&lt;br /&gt;(TestServlet)getServletConfig().getServletContext().getServlet("Oth&lt;br /&gt;erServlet"); otherServletDetails= Test.getServletDetails();&lt;br /&gt;You must be careful when you call another servlet's methods. If the&lt;br /&gt;servlet that you want to call implements the SingleThreadModel&lt;br /&gt;interface, your call could conflict with the servlet's single threaded&lt;br /&gt;nature. (The server cannot intervene and make sure your call&lt;br /&gt;happens when the servlet is not interacting with another client.) In&lt;br /&gt;this case, your servlet should make an HTTP request to the other&lt;br /&gt;servlet instead of direct calls.&lt;br /&gt;Servlets could also invoke other servlets programmatically by&lt;br /&gt;sending an HTTP request. This could be done by opening a URL&lt;br /&gt;connection to the desired Servlet.&lt;br /&gt;60) How do I make servlet aliasing work with Apache+Tomcat?&lt;br /&gt;When you use Tomcat standalone as your web server, you can&lt;br /&gt;modify the web.xml in $TOMCAT_HOME/webapps/myApp/WEBINF&lt;br /&gt;to add a url-pattern:&lt;br /&gt;&lt;web-app&gt;&lt;br /&gt;&lt;servlet&gt;&lt;br /&gt;&lt;servlet-name&gt;&lt;br /&gt;myServlet&lt;br /&gt;&lt;/servlet-name&gt;&lt;br /&gt;&lt;servlet-class&gt;&lt;br /&gt;myServlet&lt;br /&gt;&lt;/servlet-class&gt;&lt;br /&gt;&lt;/servlet&gt;&lt;br /&gt;&lt;servlet-mapping&gt;&lt;br /&gt;&lt;servlet-name&gt;&lt;br /&gt;myServlet&lt;br /&gt;&lt;/servlet-name&gt;&lt;br /&gt;&lt;url-pattern&gt;&lt;br /&gt;/jsp-bin/*&lt;br /&gt;&lt;/url-pattern&gt;&lt;br /&gt;&lt;/servlet-mapping&gt;&lt;br /&gt;&lt;/web-app&gt;&lt;br /&gt;This will let you use: http://webserver:8080/myApp/jsp-bin/stuff.html instead&lt;br /&gt;of: http://webserver:8080/myApp/servlet/myServlet/stuff.html But it won't work&lt;br /&gt;on port 80 if you've integrated Tomcat with Apache. Graeme&lt;br /&gt;Wallace provided this trick to remedy the situation. Add the&lt;br /&gt;following to your tomcat-apache.conf (or to a static version of it,&lt;br /&gt;since tomcat re-generates the conf file every time it starts):&lt;br /&gt;&lt;LocationMatch /myApp/jsp-bin/* &gt;&lt;br /&gt;SetHandler jserv-servlet&lt;br /&gt;&lt;/LocationMatch&gt;&lt;br /&gt;This lets Apache turn over handling of the url pattern to your&lt;br /&gt;servlet.&lt;br /&gt;61) Is there any way to determine the number of concurrent connections&lt;br /&gt;my servlet engine can handle?&lt;br /&gt;Depends on whether or not your servlet container uses thread&lt;br /&gt;pooling. If you do not use a thread pool, the number of concurrent&lt;br /&gt;connections accepted by Tomcat 3.1, for example, is 10. This you&lt;br /&gt;can see for yourself by testing a servlet with the Apache JMeter&lt;br /&gt;tool.&lt;br /&gt;However, if your servlet container uses a thread pool, you can&lt;br /&gt;specify the number of concurrent connections to be accepted by&lt;br /&gt;the container. For Tomcat 3.1, the information on how to do so is&lt;br /&gt;supplied with the documentation in the&lt;br /&gt;TOMCAT_HOME/doc/uguide directory.&lt;br /&gt;62) What is a request dispatcher and how does it work?&lt;br /&gt;A RequestDispatcher object can forward a client's request to a&lt;br /&gt;resource or include the resource itself in the response back to the&lt;br /&gt;client. A resource can be another servlet, or an HTML file, or a JSP&lt;br /&gt;file, etc.&lt;br /&gt;You can also think of a RequestDispatcher object as a wrapper for the&lt;br /&gt;resource located at a given path that is supplied as an argument to&lt;br /&gt;the getRequestDispatcher method.&lt;br /&gt;For constructing a RequestDispatcher object, you can use either the&lt;br /&gt;ServletRequest.getRequestDispatcher() method or the&lt;br /&gt;ServletContext.getRequestDispatcher() method. They both do the same&lt;br /&gt;thing, but impose slightly different constraints on the argument&lt;br /&gt;path. For the former, it looks for the resource in the same webapp&lt;br /&gt;to which the invoking servlet belongs and the pathname specified&lt;br /&gt;can be relative to invoking servlet. For the latter, the pathname&lt;br /&gt;must begin with '/' and is interpreted relative to the root of the&lt;br /&gt;webapp.&lt;br /&gt;To illustrate, suppose you want Servlet_A to invoke Servlet_B. If they&lt;br /&gt;are both in the same directory, you could accomplish this by&lt;br /&gt;incorporating the following code fragment in either the service&lt;br /&gt;method or the doGet method of Servlet_A:&lt;br /&gt;RequestDispatcher dispatcher =&lt;br /&gt;getRequestDispatcher("Servlet_B");&lt;br /&gt;dispatcher.forward( request, response );&lt;br /&gt;where request, of type HttpServletRequest, is the first parameter of the&lt;br /&gt;enclosing service method (or the doGet method) and response, of type&lt;br /&gt;HttpServletResponse, the second. You could accomplish the same by&lt;br /&gt;RequestDispatcher&lt;br /&gt;dispatcher=getServletContext().getRequestDispatcher(&lt;br /&gt;"/servlet/Servlet_B" );&lt;br /&gt;dispatcher.forward( request, response );&lt;br /&gt;63) What is a Servlet Context?&lt;br /&gt;A Servlet Context is a grouping under which related servlets (and&lt;br /&gt;JSPs and other web resources) run. They can share data, URL&lt;br /&gt;namespace, and other resources. There can be multiple contexts in&lt;br /&gt;a single servlet container.&lt;br /&gt;The ServletContext object is used by an individual servlet to "call&lt;br /&gt;back" and obtain services from the container (such as a request&lt;br /&gt;dispatcher). Read the JavaDoc for javax.servlet.ServletContext for&lt;br /&gt;more information.&lt;br /&gt;You can maintain "application global" variables by using Servlet&lt;br /&gt;Context Attributes.&lt;br /&gt;64) Does the RequestDispatcher expect a relative URL to be relative to the&lt;br /&gt;originally-called servlet or to the current servlet (if different)?&lt;br /&gt;Since the RequestDispatcher will be passing the control (request&lt;br /&gt;object and response object) from the current Servlet, the relative&lt;br /&gt;URL must be relative to the current servlet.&lt;br /&gt;The originally called servlet has passed the control to the current&lt;br /&gt;servlet, and now current servlet is acting as controller to other&lt;br /&gt;resourses.&lt;br /&gt;65) What is the difference between in-process and out-of-process servlet&lt;br /&gt;containers?&lt;br /&gt;The in-process Servlet containers are the containers which work inside the JVM&lt;br /&gt;of Web server, these provides good performance but poor in scalibility.&lt;br /&gt;The out-of-process containers are the containers which work in the JVM outside&lt;br /&gt;the web server. poor in performance but better in scalibility&lt;br /&gt;In the case of out-of-process containers, web server and container talks with&lt;br /&gt;each other by using the some standard mechanism like IPC.&lt;br /&gt;In addition to these types of containers, there is 3rd type which is stand-alone&lt;br /&gt;servlet containers. These are an integral part of the web server.&lt;br /&gt;66) How is SingleThreadModel implemented in Tomcat? In other&lt;br /&gt;containers? [I would assume that Tomcat uses its connection thread pool,&lt;br /&gt;and creates a new instance of the servlet for each connection thread,&lt;br /&gt;instead of sharing one instance among all threads. Is that true?]&lt;br /&gt;The question mixes together two rather independent aspects of a&lt;br /&gt;servlet container: "concurrency control" and "thread pooling".&lt;br /&gt;Concurrency control, such as achieved by having a servlet&lt;br /&gt;implement the SingleThreadModel interface, addresses the issue of&lt;br /&gt;thread safety. A servlet will be thread-safe or thread-unsafe&lt;br /&gt;regardless of whether the servlet container used a thread pool.&lt;br /&gt;Thread pooling merely eliminates the overhead associated with the&lt;br /&gt;creation and destruction of threads as a servlet container tries to&lt;br /&gt;respond to multiple requests received simultaneously. It is for this&lt;br /&gt;reason that the specification document for Servlet 2.2 API is silent&lt;br /&gt;on the subject of thread pooling -- as it is merely an implementation&lt;br /&gt;detail. However, the document does indeed address the issue of&lt;br /&gt;thread safety and how and when to use SingleThreadModel servlets.&lt;br /&gt;Section 3.3.3.1 of the Servlet 2.2 API Specification document says&lt;br /&gt;that if a servlet implements the SingleThreadModel it is guaranteed&lt;br /&gt;"that only one request thread at time will be allowed in the service&lt;br /&gt;method." It says further that "a servlet container may satisfy this&lt;br /&gt;guarantee by serializing requests on a servlet or by maintaining a&lt;br /&gt;pool of servlet instances."&lt;br /&gt;Obviously, for superior performance you'd want the servlet&lt;br /&gt;container to create multiple instances of a SingleThreadModel type&lt;br /&gt;servlet should there be many requests received in quick&lt;br /&gt;succession. Whether or not a servlet container does that depends&lt;br /&gt;completely on the implementation. My experiments show that&lt;br /&gt;Tomcat 3.1 does indeed create multiple instances of a&lt;br /&gt;SingleThreadModel servlet, but only for the first batch of requests&lt;br /&gt;received concurrently. For subsequent batches of concurrent&lt;br /&gt;requests, it seems to use only one of those instances.&lt;br /&gt;67) Which servlet containers have persistent session support? Specifically,&lt;br /&gt;does Tomcat 3.1?&lt;br /&gt;All servlet containers that implement the Servlet 2.2 API must provide for session&lt;br /&gt;tracking through either the use of cookies or through URL rewriting. All Tomcat&lt;br /&gt;servlet containers support session tracking.&lt;br /&gt;68) Can I use JAAS as the authentication technology for servlets ?&lt;br /&gt;Yes, JAAS can be used as authentication technology for servlets.&lt;br /&gt;One important feature of JAAS is pure Java implementation. The&lt;br /&gt;JAAS infrastructure is divided into two main components: an&lt;br /&gt;authentication component and an authorization component. The&lt;br /&gt;JAAS authentication component provides the ability to reliably and&lt;br /&gt;securely determine who is currently executing Java code,&lt;br /&gt;regardless of whether the code is running as an application, an&lt;br /&gt;applet, a bean, or a servlet.&lt;br /&gt;69) How can I set a servlet to load on startup of the container, rather than&lt;br /&gt;on the first request?&lt;br /&gt;The Servlet 2.2 spec defines a load-on-startup element for just this&lt;br /&gt;purpose. Put it in the &lt;servlet&gt; section of your web.xml deployment&lt;br /&gt;descriptor. It is either empty (&lt;load-on-startup/&gt;) or contains "a&lt;br /&gt;positive integer indicating the order in which the servlet should be&lt;br /&gt;loaded. Lower integers are loaded before higher integers. If no&lt;br /&gt;value is specified, or if the value specified is not a positive integer,&lt;br /&gt;the container is free to load it at any time in the startup sequence."&lt;br /&gt;For example,&lt;br /&gt;&lt;servlet&gt;&lt;br /&gt;&lt;servlet-name&gt;foo&lt;/servlet-name&gt;&lt;br /&gt;&lt;servlet-class&gt;com.foo.servlets.Foo&lt;/servlet-class&gt;&lt;br /&gt;&lt;load-on-startup&gt;5&lt;/load-on-startup&gt;&lt;br /&gt;&lt;/servlet&gt;&lt;br /&gt;Some servlet containers also have their own techniques for&lt;br /&gt;configuring this; please submit feedback with information on these.&lt;br /&gt;70) Is it possible to write a servlet that acts as a FTP server?&lt;br /&gt;Yes. It would spawn a thread that opens a ServerSocket, then listens for&lt;br /&gt;incoming connections and speaks the FTP protocol.&lt;br /&gt;71) Is there a way to disable a user's ability to double-click a submit&lt;br /&gt;image/button (and therefore submitting duplicate data -- multiple submits)?&lt;br /&gt;Is there a way to do this with Javascript?&lt;br /&gt;Give the submit image (or button) an onClick() handler. Have the&lt;br /&gt;handler check if a flag is set and if not set the flag and submit the&lt;br /&gt;form and then clear the form.&lt;br /&gt;72) What are the main differences between Servlets and ISAPI?&lt;br /&gt;The first difference is obviously that Servlets is the technology from&lt;br /&gt;Sun Microsystems and ISAPI is from Microsoft.&lt;br /&gt;Other Differences are:&lt;br /&gt;ï‚· Servlet is a simple .class file and ISAPI is a DLL&lt;br /&gt;ï‚· Servlets run in the Servlet containers and may be in-process or&lt;br /&gt;out of process. ISAs run in the same address space as the HTTP&lt;br /&gt;server&lt;br /&gt;ï‚· Servlet container preprocesses and postprocesses the data&lt;br /&gt;communication between the client and server. ISAPI Filters provide&lt;br /&gt;the capability of pre-processing and post-processing of all data sent&lt;br /&gt;between the client and the server&lt;br /&gt;ï‚· Java is the only choice for writing Servlets, VC++/MFC is used&lt;br /&gt;to write ISAPI code&lt;br /&gt;ï‚· Servlets works on most of the Web servers plus third party&lt;br /&gt;containers can be integrated with other web servers to provide&lt;br /&gt;servlets on them. ISAPI works on only ISAPI-compliant Web server&lt;br /&gt;(for example, Microsoft Internet Information Server)&lt;br /&gt;ï‚· Servlets can connect to the Databases through JDBC as well as&lt;br /&gt;jdbc-odbc bridges. ISAPI can connect to Databases through only&lt;br /&gt;ODBC&lt;br /&gt;ï‚· Servlets have access to many server-side technologies like EJB&lt;br /&gt;and etc. ISAPI is limited in scope&lt;br /&gt;ï‚· Multiple commands can be implemented in a servlet by using&lt;br /&gt;pathinfo. ISAPI allows multiple commands in one DLL,&lt;br /&gt;implemented as member functions of the CHttpServer object in&lt;br /&gt;the DLL.&lt;br /&gt;ï‚· Content generation and content presentation can be done seperately&lt;br /&gt;in Servlets with the help of JSP. ISAPI code has to generate HTML code&lt;br /&gt;itself.&lt;br /&gt;73) Can I associate a servlet with a particular mime-type, so if the client&lt;br /&gt;requests a file of that type, my servlet will be executed?&lt;br /&gt;In web.xml you can use a mime-mapping to map the type with a&lt;br /&gt;certain extension and then map the servlet to that extension.&lt;br /&gt;e.g.&lt;br /&gt;&lt;mime-mapping&gt;&lt;br /&gt;&lt;extension&gt;&lt;br /&gt;zzz&lt;br /&gt;&lt;/extension&gt;&lt;br /&gt;&lt;mime-type&gt;&lt;br /&gt;text/plain&lt;br /&gt;&lt;/mime-type&gt;&lt;br /&gt;&lt;/mime-mapping&gt;&lt;br /&gt;&lt;servlet-mapping&gt;&lt;br /&gt;&lt;url&gt;&lt;br /&gt;*.zzz&lt;br /&gt;&lt;/url&gt;&lt;br /&gt;&lt;servlet-name&gt;&lt;br /&gt;MyServlet&lt;br /&gt;&lt;/servlet-name&gt;&lt;br /&gt;&lt;/servlet-mapping&gt;&lt;br /&gt;So, when a file for type zzz is requested, the servlet gets called.&lt;br /&gt;74) What are the different cases for using sendRedirect() vs.&lt;br /&gt;getRequestDispatcher()?&lt;br /&gt;When you want to preserve the current request/response objects&lt;br /&gt;and transfer them to another resource WITHIN the context, you&lt;br /&gt;must use getRequestDispatcher or getNamedDispatcher.&lt;br /&gt;If you want to dispatch to resources OUTSIDE the context, then&lt;br /&gt;you must use sendRedirect. In this case you won't be sending the&lt;br /&gt;original request/response objects, but you will be sending a header&lt;br /&gt;asking to the browser to issue a request to the new URL.&lt;br /&gt;If you don't need to preserve the request/response objects, you can&lt;br /&gt;use either.&lt;br /&gt;75) How do I access the value of a cookie using JavaScript?&lt;br /&gt;You can manipulate cookies in JavaScript with the document.cookie&lt;br /&gt;property. You can set a cookie by assigning this property, and&lt;br /&gt;retrieve one by reading its current value.&lt;br /&gt;The following statement, for example, sets a new cookie with a&lt;br /&gt;minimum number of attributes:&lt;br /&gt;document.cookie = "cookieName=cookieValue";&lt;br /&gt;And the following statement displays the property's value:&lt;br /&gt;alert(document.cookie);&lt;br /&gt;The value of document.cookie is a string containing a list of all&lt;br /&gt;cookies that are associated&lt;br /&gt;with a web page. It consists, that is, of name=value pairs for each&lt;br /&gt;cookie that matches the&lt;br /&gt;current domain, path, and date. The value of the document.cookie&lt;br /&gt;property, for instance,&lt;br /&gt;might be the following string:&lt;br /&gt;cookieName1=cookieValue1; cookieName2=cookieValue2;&lt;br /&gt;76) How do I write to a log file using JSP under Tomcat? Can I make use of&lt;br /&gt;the log() method for this?&lt;br /&gt;Yes, you can use the Servlet API's log method in Tomcat from&lt;br /&gt;within JSPs or servlets. These messages are stored in the server's&lt;br /&gt;log directory in a file called servlet.log.&lt;br /&gt;77) How can I use a servlet to print a file on a printer attached to the client?&lt;br /&gt;The security in a browser is designed to restrict you from&lt;br /&gt;automating things like this. However, you can use JavaScript in the&lt;br /&gt;HTML your servlet returns to print a frame. The browser will still&lt;br /&gt;confirm the print job with the user, so you can't completely&lt;br /&gt;automate this. Also, you'll be printing whatever the browser is&lt;br /&gt;displaying (it will not reliably print plug-ins or applets), so normally&lt;br /&gt;you are restricted to HTML and images.&lt;br /&gt;[The JavaScript source code for doing this is:&lt;br /&gt;&lt;input type="button" onClick="window.print(0)" value="Print This&lt;br /&gt;Page"&gt;&lt;br /&gt;78) How do you do servlet aliasing with Apache and Tomcat?&lt;br /&gt;Servlet aliasing is a two part process with Apache and Tomcat.&lt;br /&gt;First, you must map the request in Apache to Tomcat with the&lt;br /&gt;ApJServMount directive, e.g.,&lt;br /&gt;ApJServMount /myservlet /ROOT&lt;br /&gt;Second, you must map that url pattern to a servlet name and then&lt;br /&gt;to a servlet class in your web.xml configuration file. Here is a&lt;br /&gt;sample exerpt:&lt;br /&gt;&lt;servlet&gt;&lt;br /&gt;&lt;servlet-name&gt;myservlet&lt;/servlet-name&gt;&lt;br /&gt;&lt;servlet-class&gt;com.mypackage.MyServlet&lt;/servlet-class&gt;&lt;br /&gt;&lt;/servlet&gt;&lt;br /&gt;&lt;servlet-mapping&gt;&lt;br /&gt;&lt;servlet-name&gt;myservlet&lt;/servlet-name&gt;&lt;br /&gt;&lt;url-pattern&gt;/myservlet&lt;/url-pattern&gt;&lt;br /&gt;&lt;/servlet-mapping&gt;&lt;br /&gt;79 ) I want my servlet page to redirect to a login page if the session has&lt;br /&gt;timed out. How can I know if my session has timed out?&lt;br /&gt;If the servlet engine does the time-out, following code should help&lt;br /&gt;you:&lt;br /&gt;//assume you have a HttpServletRequest request&lt;br /&gt;if(request.getSession(false)==null) {&lt;br /&gt;//no valid session (timeouted=invalid)&lt;br /&gt;//code to redirect to login page&lt;br /&gt;}&lt;br /&gt;80) Can Tomcat be configured to interpret all, or selected, .html files within&lt;br /&gt;a given context as JSP? Or, do JSP files have to end with a .jsp extension?&lt;br /&gt;yes you can do that by modifying the web.xml file. You will have to invoke the&lt;br /&gt;org.apache.jasper.runtime.JspServlet for all the requests having extension&lt;br /&gt;.html. You can do that by changing the Servlet mapping code:&lt;br /&gt;&lt;servlet-mapping&gt;&lt;br /&gt;&lt;servlet-name&gt;&lt;br /&gt;jsp&lt;br /&gt;&lt;/servlet-name&gt;&lt;br /&gt;&lt;url&gt;*.html&lt;/url&gt;&lt;br /&gt;&lt;/servlet-mapping&gt;&lt;br /&gt;And comment out the following block&lt;br /&gt;&lt;mime-mapping&gt;&lt;br /&gt;&lt;extension&gt;&lt;br /&gt;html&lt;br /&gt;&lt;/extension&gt;&lt;br /&gt;&lt;mime-type&gt;&lt;br /&gt;text/html&lt;br /&gt;&lt;/mime-type&gt;&lt;br /&gt;&lt;/mime-mapping&gt;&lt;br /&gt;81) What is the difference between request attributes, session attributes,&lt;br /&gt;and ServletContext attributes?&lt;br /&gt;A ServletContext attribute is an object bound into a context through&lt;br /&gt;ServletContext.setAttribute() method and which is available to ALL&lt;br /&gt;servlets (thus JSP) in that context, or to other contexts via the&lt;br /&gt;getContext() method. By definition a context attribute exists locally&lt;br /&gt;in the VM where they were defined. So, they're unavailable on&lt;br /&gt;distributed applications.&lt;br /&gt;Session attributes are bound to a session, as a mean to provide&lt;br /&gt;state to a set of related HTTP requests. Session attributes are&lt;br /&gt;available ONLY to those servlets which join the session. They're&lt;br /&gt;also unavailable to different JVMs in distributed scenarios. Objects&lt;br /&gt;can be notified when they're bound/unbound to the session&lt;br /&gt;implementing the HttpSessionBindingListener interface.&lt;br /&gt;Request attributes are bound to a specific request object, and they&lt;br /&gt;last as far as the request is resolved or while it keep dispatched&lt;br /&gt;from servlet to servlet. They're used more as comunication channel&lt;br /&gt;between Servlets via the RequestDispatcher Interface (since you&lt;br /&gt;can't add Parameters...) and by the container. Request attributes&lt;br /&gt;are very useful in web apps when you must provide setup&lt;br /&gt;information between information providers and the information&lt;br /&gt;presentation layer (a JSP) that is bound to a specific request and&lt;br /&gt;need not be available any longer, which usually happens with&lt;br /&gt;sessions without a rigorous control strategy.&lt;br /&gt;Thus we can say that context attributes are meant for infrastructure&lt;br /&gt;such as shared connection pools, session attributes to&lt;br /&gt;contextual information such as user identification, and request&lt;br /&gt;attributes are meant to specific request info such as query results.&lt;br /&gt;82) Are singleton/static objects shared between servlet contexts?&lt;br /&gt;[Question continues: For example if I have two contexts on a single&lt;br /&gt;web server, and each context uses a login servlet and the login&lt;br /&gt;servlet connects to a DB. The DB connection is managed by a&lt;br /&gt;singleton object. Do both contexts have their own instance of the&lt;br /&gt;DB singleton or does one instance get shared between the two?]&lt;br /&gt;It depends on from where the class is loaded.&lt;br /&gt;The classes loaded from context's WEB-INF directory are not&lt;br /&gt;shared by other contexts, whereas classes loaded from&lt;br /&gt;CLASSPATH are shared. So if you have exactly the same&lt;br /&gt;DBConnection class in WEB-INF/classes directory of two different&lt;br /&gt;contexts, each context gets its own copy of the singleton (static)&lt;br /&gt;object.&lt;br /&gt;83) When building web applications, what are some areas where&lt;br /&gt;synchronization problems arrise?&lt;br /&gt;In general, you will run into synchronization issues when you try to&lt;br /&gt;access any shared resource. By shared resource, I mean anything&lt;br /&gt;which might be used by more than one request.&lt;br /&gt;Typical examples include:&lt;br /&gt;· Connections to external servers, especially if you have any&lt;br /&gt;sort of pooling.&lt;br /&gt;· Anything which you include in a HttpSession. (Your user&lt;br /&gt;could open many browser windows and make many&lt;br /&gt;simultaneous requests within the one session.)&lt;br /&gt;· Log destinations, if you do your own logging from your&lt;br /&gt;servlets.&lt;br /&gt;84) What is the difference between apache webserver, java webserver and&lt;br /&gt;tomcat server?&lt;br /&gt;Apache is an HTTP server written in C that can be compiled and&lt;br /&gt;run on many platforms.&lt;br /&gt;Java WebServer is an HTTP server from Sun written in Java that&lt;br /&gt;also supports Servlets and JSP.&lt;br /&gt;Tomcat is an open-source HTTP server from the Apache&lt;br /&gt;Foundation, written in Java, that supports Servlets and JSP. It can&lt;br /&gt;also be used as a "plug-in" to native-code HTTP servers, such as&lt;br /&gt;Apache Web Server and IIS, to provide support for Servlets (while&lt;br /&gt;still serving normal HTTP requests from the primary, native-code&lt;br /&gt;web server).&lt;br /&gt;85) How can you embed a JavaScript within servlets / JSP pages?&lt;br /&gt;You don't have to do anything special to include JavaScript in&lt;br /&gt;servlets or JSP pages. Just have the servlet/JSP page generate the&lt;br /&gt;necessary JavaScript code, just like you would include it in a raw&lt;br /&gt;HTML page.&lt;br /&gt;The key thing to remember is it won't run in the server. It will run&lt;br /&gt;back on the client when the browser loads the generate HTML, with&lt;br /&gt;the included JavaScript.&lt;br /&gt;86) How can I make a POST request through response.sendRedirect() or&lt;br /&gt;response.setStatus() and response.setHeader() methods?&lt;br /&gt;You can't. It's a fundamental limitation of the HTTP protocol. You'll&lt;br /&gt;have to figure out some other way to pass the data, such as&lt;br /&gt;· Use GET instead&lt;br /&gt;· Make the POST from your servlet, not from the client&lt;br /&gt;· Store data in cookies instead of passing it via GET/POST&lt;br /&gt;87) How do I pass a request object of one servlet as a request object to&lt;br /&gt;another servlet?&lt;br /&gt;Use a Request Dispatcher.&lt;br /&gt;88) I call a servlet as the action in a form, from a jsp. How can I redirect the&lt;br /&gt;response from the servlet, back to the JSP? (RequestDispatcher.forward&lt;br /&gt;will not help in this case, as I do not know which resource has made the&lt;br /&gt;request. request.getRequestURI will return the uri as contained in the&lt;br /&gt;action tag of the form, which is not what is needed.)&lt;br /&gt;You'll have to pass the JSP's URI in to the servlet, and have the&lt;br /&gt;servlet call sendRedirect to go back to the JSP. For example:&lt;br /&gt;&lt;FORM ACTION="/foo/myservlet"&gt;&lt;br /&gt;&lt;INPUT TYPE="HIDDEN" NAME="redirect"&lt;br /&gt;VALUE="/foo/thisjsp.jsp"&gt;&lt;br /&gt;Shoe size: &lt;INPUT NAME="shoesize"&gt;&lt;br /&gt;&lt;INPUT TYPE="SUBMIT"&gt;&lt;br /&gt;&lt;/FORM&gt;&lt;br /&gt;Then in the servlet...&lt;br /&gt;response.sendRedirect(request.getParameter("redirect"));&lt;br /&gt;89) What is the ServletConfig object, and why is it useful?&lt;br /&gt;The ServletConfig object is an interface. It contains the methods&lt;br /&gt;getInitParameter&lt;br /&gt;getInitParameterNames&lt;br /&gt;getServletContext&lt;br /&gt;getServletName&lt;br /&gt;You can use the methods to determine the Servlet's initialization&lt;br /&gt;parameters, the name of the servlets instance, and a reference to&lt;br /&gt;the Servlet Context the servlet is running in.&lt;br /&gt;getServletContext is the most valuable method, as it allows you to&lt;br /&gt;share information accross an application (context).&lt;br /&gt;90) I have a global variable in a servlet class. What will happen to this&lt;br /&gt;global variable if two requests hit on the same time?&lt;br /&gt;What will happen is an unforeseeable event.&lt;br /&gt;The best way to establish a default occurrence (the servlet handles a request at&lt;br /&gt;a time) is to synchronize the access to the global variable or alternatively to&lt;br /&gt;create a servlet that implements the SingleThreadModel interface.&lt;br /&gt;91) Suppose I have 2 servers, server1 and server2. How can I take data in a&lt;br /&gt;cookie from server1, and send it to server2?&lt;br /&gt;You'll have to create a (new) similar cookie on server 2.&lt;br /&gt;Have a ReadCookieServlet running on server1 that&lt;br /&gt;· Reads the cookie, using request.getCookies()&lt;br /&gt;· Redirects to WriteCookieServlet running on server2,&lt;br /&gt;passing the cookie name, value and expiration date as&lt;br /&gt;request parameters, using response.sendRedirect().&lt;br /&gt;Have a WriteCookieServlet running on server2 that&lt;br /&gt;· Reads the cookie name, value and expiration date request&lt;br /&gt;parameters, using request.getParameter().&lt;br /&gt;· Creates a similar cookie, using response.addCookie().&lt;br /&gt;92) How can I pass data from a servlet running in one context (webapp) to a&lt;br /&gt;servlet running in another context?&lt;br /&gt;There are three ways I can think of off the top of my head:&lt;br /&gt;1. Store the information you want to share in a persistant&lt;br /&gt;format, such as in a file system or database. That way, any&lt;br /&gt;servlet that is running in a JVM that can "see" these&lt;br /&gt;resources can get to this information.&lt;br /&gt;2. If persisting this information is not an option, you can bind&lt;br /&gt;this information to a context that is accessible to all servlet&lt;br /&gt;contexts, such as the application server's context. This way,&lt;br /&gt;you can keep the data you want to share in memory.&lt;br /&gt;3. Use the old fashion way of passing information to a servlet -&lt;br /&gt;HTTP. One servlet could foward a request to another servlet&lt;br /&gt;and include the data that needs to be shared as parameters&lt;br /&gt;in the request.&lt;br /&gt;93) How can I write an "error page" -- that is, a servlet or JSP to report&lt;br /&gt;errors of other servlets?&lt;br /&gt;The Servlet 2.2 specification allows you to specify an error page (a&lt;br /&gt;servlet or a JSP) for different kinds of HTTP errors or&lt;br /&gt;ServletExceptions. You can specify this in deployment descriptor of&lt;br /&gt;the web application as:&lt;br /&gt;&lt;error-page&gt;&lt;br /&gt;&lt;exception-type&gt;FooException&lt;/exception-type&gt;&lt;br /&gt;&lt;location&gt;/error.jsp&lt;/location&gt;&lt;br /&gt;&lt;/error-page&gt;&lt;br /&gt;where FooException is a subclass of ServletException.&lt;br /&gt;The web container invokes this servlet in case of errors, and you&lt;br /&gt;can access the following information from the request object of&lt;br /&gt;error servlet/JSP: error code, exception type, and a message.&lt;br /&gt;94) What is the difference between ServletContext and ServletConfig?&lt;br /&gt;A ServletContext represents the context in a servlet container of a&lt;br /&gt;servlet instance operates. A servlet container can have several&lt;br /&gt;contexts (or web applications) at one time. Each servlet instance is&lt;br /&gt;running in one of these contexts. All servlets instances running in&lt;br /&gt;the same context are part of the same web application and,&lt;br /&gt;therefore, share common resources. A servlet accesses these&lt;br /&gt;shared resource (such as a RequestDispatcher and application&lt;br /&gt;properties) through the ServletContext object.&lt;br /&gt;This notion of a web application became very significant upon the&lt;br /&gt;Servlet 2.1 API, where you could deploy an entire web application&lt;br /&gt;in a WAR file. Notice that I always said "servlet instance", not&lt;br /&gt;servlet. That is because the same servlet can be used in several&lt;br /&gt;web applications at one time. In fact, this may be common if there&lt;br /&gt;is a generic controller servlet that can be configured at run time for&lt;br /&gt;a specific application. Then, you would have several instances of&lt;br /&gt;the same servlet running, each possibly having different&lt;br /&gt;configurations.&lt;br /&gt;This is where the ServletConfig comes in. This object defines how a&lt;br /&gt;servlet is to be configured is passed to a servlet in its init method.&lt;br /&gt;Most servlet containers provide a way to configure a servlet at runtime&lt;br /&gt;(usually through flat file) and set up its initial parameters. The&lt;br /&gt;container, in turn, passes these parameters to the servlet via the&lt;br /&gt;ServetConfig.&lt;br /&gt;95) Under what circumstances will a servlet be reloaded?&lt;br /&gt;That depends on the Servlet container.&lt;br /&gt;Most of the Servlet containers reload the servlet only it detects the&lt;br /&gt;code change in the Servlet, not in the referenced classes.&lt;br /&gt;In Tomcat's server.xml deployment descriptor, if you have&lt;br /&gt;mentioned&lt;br /&gt;&lt;Context path="/myApp"&lt;br /&gt;docBase="D:/myApp/webDev"&lt;br /&gt;crossContext="true"&lt;br /&gt;debug="0"&lt;br /&gt;reloadable="true"&lt;br /&gt;trusted="false" &gt;&lt;br /&gt;&lt;/Context&gt;&lt;br /&gt;The reloadable = true makes the magic. Every time the Servlet&lt;br /&gt;container detects that the Servlet code is changed, it will call the&lt;br /&gt;destroy on the currently loaded Servlet and reload the new code.&lt;br /&gt;But if the class that is referenced by the Servlet changes, then the&lt;br /&gt;Servlet will not get loaded. You will have to change the timestamp&lt;br /&gt;of the servlet or stop-start the server to have the new class in the&lt;br /&gt;container memory.&lt;br /&gt;96) What is a Servlet Filter?&lt;br /&gt;A filter is basically a component that is invoked whenever a resource is invoked&lt;br /&gt;for which the filter is mapped. The resource can be something like a servlet, or a&lt;br /&gt;URL pattern. A filter normally works on the request, response, or header&lt;br /&gt;attributes, and does not itself send a response to the client.&lt;br /&gt;97) I am using the RequestDispatcher's forward() method to redirect to a&lt;br /&gt;JSP. The problem is that the jsp's url is now relative to the servlet's url and&lt;br /&gt;all my url's in the jsp such as &lt;img src="pic.gif"&gt; will be corrupt. How do I&lt;br /&gt;solve this problem?&lt;br /&gt;You can use absolute urls like:&lt;br /&gt;&lt;BODY&gt;&lt;br /&gt;&lt;% String base = request.getContextPath(); %&gt;&lt;br /&gt;&lt;IMG src="&lt;%=base%&gt;/img/pic.gif"&gt;&lt;br /&gt;&lt;/BODY&gt;&lt;br /&gt;or write out a BASE tag like:&lt;br /&gt;&lt;% String base = request.getContextPath(); %&gt;&lt;br /&gt;&lt;HEAD&gt;&lt;br /&gt;&lt;BASE HREF="&lt;%=base%&gt;"&gt;&lt;br /&gt;&lt;/HEAD&gt;&lt;br /&gt;&lt;BODY&gt;&lt;br /&gt;&lt;IMG src="img/pic.gif"&gt;&lt;br /&gt;&lt;/BODY&gt;&lt;br /&gt;That should take care of the problem.&lt;br /&gt;98) How can I return a readily available (static) HTML page to the user&lt;br /&gt;instead of generating it in the servlet?&lt;br /&gt;To solve your problem, you can either send a "Redirect" back to the&lt;br /&gt;client or use a RequestDispatcher and forward your request to another&lt;br /&gt;page:&lt;br /&gt;1. Redirect:&lt;br /&gt;A redirection is made using the HttpServletResponse object:&lt;br /&gt;2. if(condition) {&lt;br /&gt;3. response.sendRedirect("page1.html");&lt;br /&gt;4. } else {&lt;br /&gt;5. response.sendRedirect("page2.html");&lt;br /&gt;6. }&lt;br /&gt;7. RequestDispatcher:&lt;br /&gt;A request dispatcher can be obtained through the&lt;br /&gt;ServletContext. It can be used to include another page or to&lt;br /&gt;forward to it.&lt;br /&gt;8. if(condition) {&lt;br /&gt;9. this.getServletContext()&lt;br /&gt;10. .getRequestDispatcher("page1.html").forward();&lt;br /&gt;11. } else {&lt;br /&gt;12. this.getServletContext()&lt;br /&gt;13. .getRequestDispatcher("page2.html").forward();&lt;br /&gt;14. }&lt;br /&gt;Both solutions require, that the pages are available in you&lt;br /&gt;document root. If they are located somewhere else on your&lt;br /&gt;filesystem, you have to open the file manually and copy their&lt;br /&gt;content to the output writer.&lt;br /&gt;If your application server is set up in combination with a normal web&lt;br /&gt;server like Apache, you should use solution (1), because the the&lt;br /&gt;web server usually serves static files much faster than the&lt;br /&gt;application server.&lt;br /&gt;99) What is the difference between static variables and instance variables&lt;br /&gt;in a servlet?&lt;br /&gt;According to the Java Language definition, a static variable is&lt;br /&gt;shared among all instances of a class, where a non-static variable&lt;br /&gt;-- also called an instance variable -- is specific to a single instance&lt;br /&gt;of that class.&lt;br /&gt;According to the Servlet specification, a servlet that does not&lt;br /&gt;declare SingleThreadModel usually has one and only one instance,&lt;br /&gt;shared among all concurrent requests hitting that servlet.&lt;br /&gt;That means that, in servlets (and other multithreaded applications),&lt;br /&gt;an instance variable behaves very much like a static variable, since&lt;br /&gt;it is shared among all threads. You have to be very careful about&lt;br /&gt;synchronizing access to shared data.&lt;br /&gt;The big difference between instance variables and static variables&lt;br /&gt;comes when you have configured your servlet engine to instantiate&lt;br /&gt;two instances of the same servlet class, but with different init&lt;br /&gt;parameters. In this case, there will be two instances of the same&lt;br /&gt;servlet class, which means two sets of instance variables, but only&lt;br /&gt;one set of static variables.&lt;br /&gt;Remember that you can store data in lots of different places in a&lt;br /&gt;servlet. To wit:&lt;br /&gt;· Local variables - for loop iterators, result sets, and so forth&lt;br /&gt;· Request attributes - for data that must be passed to other&lt;br /&gt;servlets invoked with the RequestDispatcher&lt;br /&gt;· Session attributes - persists for all future requests from the&lt;br /&gt;current user only&lt;br /&gt;· Instance variables - for data that persists for the life of the&lt;br /&gt;servlet, shared with all concurrent users&lt;br /&gt;· Static variables - for data that persists for the life of the&lt;br /&gt;application, shared with all concurrent users -- including any&lt;br /&gt;other servlet instances that were instantiated with different&lt;br /&gt;init parameters&lt;br /&gt;· Context attributes - for data that must persist for the life of&lt;br /&gt;the application, and be shared with all other servlets&lt;br /&gt;100) How can I share data between two different web applications?&lt;br /&gt;Different servlets may share data within one application via&lt;br /&gt;ServletContext. If you have a compelling to put the servlets in&lt;br /&gt;different applications, you may wanna consider using EJBs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7266580669968450373-4442442067257827780?l=thesandeepsaxena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thesandeepsaxena.blogspot.com/feeds/4442442067257827780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7266580669968450373&amp;postID=4442442067257827780' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/4442442067257827780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/4442442067257827780'/><link rel='alternate' type='text/html' href='http://thesandeepsaxena.blogspot.com/2009/05/j2ee-technolgy-concept.html' title='J2EE Technolgy Concept .......'/><author><name>Sandeep</name><uri>http://www.blogger.com/profile/11401210729852266730</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_BUWbGMq2OqY/S6r8PfJsMRI/AAAAAAAAABU/N6KSsnR3KD8/S220/0619_133223.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7266580669968450373.post-9114882192186868461</id><published>2009-05-26T03:56:00.000-07:00</published><updated>2009-05-26T03:57:33.122-07:00</updated><title type='text'>Java Technology Job Interview Questions</title><content type='html'>OOPS and CORE JAVA&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What is JVM (Java Virtual Machine)?&lt;br /&gt;What is JIT (Just-in-Time) Compilation?&lt;br /&gt;What is Object Oriented Programming?&lt;br /&gt;What's a Class?&lt;br /&gt;What's an Object?&lt;br /&gt;What's the relation between Classes and Objects?&lt;br /&gt;What are different properties provided by Object-oriented systems?&lt;br /&gt;How do you implement inheritance in Java?&lt;br /&gt;How can we implement polymorphism in Java?&lt;br /&gt;What's an interface and how will you go about implementing an&lt;br /&gt;interface?&lt;br /&gt;What is an Abstract class?&lt;br /&gt;What are Abstract methods?&lt;br /&gt;What's the difference between "Abstract" classes and&lt;br /&gt;"Interfaces"?&lt;br /&gt;What's difference between Static and Non-Static fields of a class?&lt;br /&gt;What are inner classes and what's the practical implementation of&lt;br /&gt;inner classes?&lt;br /&gt;What are packages?&lt;br /&gt;What is a constructor in class?&lt;br /&gt;Can constructors be parameterized?&lt;br /&gt;Can you explain transient and volatile modifiers?&lt;br /&gt;What is the use if "instanceof " keyword?&lt;br /&gt;What are Native methods in Java?&lt;br /&gt;Explain in depth Garbage collector?&lt;br /&gt;How does the garbage collector determine that the object has to be&lt;br /&gt;marked for deletion?&lt;br /&gt;Can you explain "finalize()" method?&lt;br /&gt;How can we force the garbage collector to run?&lt;br /&gt;What's the main difference between "Switch" and "If "&lt;br /&gt;comparison?&lt;br /&gt;What's the use of JAVAP tool?&lt;br /&gt;What are applets?&lt;br /&gt;In which package is the applet class located?&lt;br /&gt;What are native interfaces in Java?&lt;br /&gt;what are Class loader's?&lt;br /&gt;what is Bootstrap, Extension and System Class loader?&lt;br /&gt;Can you explain the flow between bootstrap, extension and system class&lt;br /&gt;loader?&lt;br /&gt;Can you explain how can you practically do dynamic loading?&lt;br /&gt;How can you copy one array in to a different array?&lt;br /&gt;Can you explain the core collection interfaces?&lt;br /&gt;Can you explain in brief the collection classes which implement the&lt;br /&gt;collection interfaces?&lt;br /&gt;What's the difference between standard JAVA array and ArrayList&lt;br /&gt;class?&lt;br /&gt;What's the use of "ensureCapacity" in ArrayList class?&lt;br /&gt;How can we obtain an array from an ArrayList class?&lt;br /&gt;What is "LinkedList" class for?&lt;br /&gt;Can you explain HashSet class in collections?&lt;br /&gt;what is LinkedHashSet class?&lt;br /&gt;what is a TreeSet class?&lt;br /&gt;what's the use of Comparator Interface?&lt;br /&gt;How can we access elements of a collection?&lt;br /&gt;What is Map and SortedMap Interface?&lt;br /&gt;Have you used any collection algorithm?&lt;br /&gt;Why do we use collections when we had traditional ways for collection?&lt;br /&gt;Can you name the legacy classes and interface for collections?&lt;br /&gt;What is Enumeration Interface?&lt;br /&gt;what's the main difference between ArrayList / HashMap and Vector /&lt;br /&gt;Hashtable?&lt;br /&gt;Are String object Immutable, Can you explain the concept?&lt;br /&gt;what is a StringBuffer class and how does it differs from String class?&lt;br /&gt;what is the difference between StringBuilder and StringBuffer class?&lt;br /&gt;What is Pass by Value and Pass by reference? How does JAVA handle the&lt;br /&gt;same?&lt;br /&gt;What are access modifiers?&lt;br /&gt;what is Assertion?&lt;br /&gt;Can you explain the fundamentals of deep and shallow Cloning?&lt;br /&gt;How do we implement Shallow cloning?&lt;br /&gt;How do we implement deep cloning?&lt;br /&gt;What's the impact of private constructor?&lt;br /&gt;What are the situations you will need a constructor to be private?&lt;br /&gt;Can you explain final modifier?&lt;br /&gt;What are static Initializers?&lt;br /&gt;If we have multiple static initializer blocks how is the sequence&lt;br /&gt;handled?&lt;br /&gt;Define casting? What are the different types of Casting?&lt;br /&gt;Can you explain Widening conversion and Narrowing conversion?&lt;br /&gt;Can we assign parent object to child objects?&lt;br /&gt;Define exceptions?&lt;br /&gt;Can you explain in short how JAVA exception handling works?&lt;br /&gt;Can you explain different exception types?&lt;br /&gt;Can you explain checked and unchecked exceptions?&lt;br /&gt;Can we create our own exception class?&lt;br /&gt;What are chained exceptions?&lt;br /&gt;What is serialization?&lt;br /&gt;How do we implement serialization actually?&lt;br /&gt;What's the use of Externalizable Interface?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Threading&lt;br /&gt;&lt;br /&gt;What's difference between thread and process?&lt;br /&gt;What is thread safety and synchronization?&lt;br /&gt;What is semaphore?&lt;br /&gt;What are monitors?&lt;br /&gt;What's the importance of synchronized blocks?&lt;br /&gt;How do we create threads?&lt;br /&gt;what's the difference in using runnable and extends in threads?&lt;br /&gt;Can you explain Thread.sleep?&lt;br /&gt;How to stop a thread?&lt;br /&gt;What is wait() and notify() ?&lt;br /&gt;Can you explain how Scheduling and Priority works in threads?&lt;br /&gt;Can you explain Yielding in threading?&lt;br /&gt;what are daemon threads?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;JDBC&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How does JAVA interact with databases?&lt;br /&gt;Can we interact with non-relational sources using JDBC?&lt;br /&gt;Can you explain in depth the different sections in JDBC?&lt;br /&gt;Can you explain in short how you go about using JDBC API in code?&lt;br /&gt;How do you handle SQL exceptions?&lt;br /&gt;If there is more than one exception in SQLException" class how to go&lt;br /&gt;about displaying&lt;br /&gt;it?&lt;br /&gt;Explain Type1, Type2, Type3 and Type4 drivers in JDBC?&lt;br /&gt;What are the advantages and disadvantages of using JDBC-ODBC bridge&lt;br /&gt;driver?&lt;br /&gt;What are the advantages and disadvantages of using Native-API/&lt;br /&gt;Partially Java Driver?&lt;br /&gt;What are the advantages and disadvantages of using Net-Protocol/&lt;br /&gt;All-Java driver?&lt;br /&gt;What are the advantages and disadvantages of using Native-protocol/&lt;br /&gt;All-Java driver?&lt;br /&gt;Define meta-data?&lt;br /&gt;What is DatabaseMetaData?&lt;br /&gt;Can you explain "ConnectionFactory" class?&lt;br /&gt;I want to display tables of a database how do I do it?&lt;br /&gt;Define "ResultSetMetaData"?&lt;br /&gt;What is the difference between "ResultSet" and "RowSet"?&lt;br /&gt;Can "ResultSet" objects be serialized?&lt;br /&gt;Can you explain "ResultSet", "RowSet", "CachedRowset",&lt;br /&gt;"JdbcRowset" and&lt;br /&gt;"WebRowSet" relation ship?&lt;br /&gt;what are the different types of resultset?&lt;br /&gt;Explain the concept of "PreparedStatement "statement interface?&lt;br /&gt;What's the difference between "Statement" and&lt;br /&gt;"PreparedStatement"?&lt;br /&gt;How can we call stored procedure using JDBC?&lt;br /&gt;Can you explain "CallableStatement" interface in detail?&lt;br /&gt;How do you get a resultset object from stored procedure?&lt;br /&gt;How can we do batch updates using "CallableStatement" Interface?&lt;br /&gt;Define transactions?&lt;br /&gt;what is ACID in transaction?&lt;br /&gt;what are the four essential properties of a transaction?&lt;br /&gt;Explain concurrency and locking?&lt;br /&gt;What are different types of locks?&lt;br /&gt;What are the different types of levels of resource on which locks can&lt;br /&gt;be placed?&lt;br /&gt;Define lock escalation?&lt;br /&gt;What is Table level and Row level locking?&lt;br /&gt;What are the problems that can occur if you do not implement locking&lt;br /&gt;properly?&lt;br /&gt;What are different transaction levels?&lt;br /&gt;Twist: - what are different types of locks?&lt;br /&gt;What is difference between optimistic and pessimistic locking?&lt;br /&gt;What are deadlocks?&lt;br /&gt;How can we set transaction level through JDBC API?&lt;br /&gt;Can you explain transaction control in JDBC?&lt;br /&gt;What are Savepoints in a transaction?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Servlets and JSP&lt;br /&gt;&lt;br /&gt;What are Servlets?&lt;br /&gt;What are advantages of servlets over CGI?&lt;br /&gt;Can you explain Servlet life cycle?&lt;br /&gt;What are the two important API's in for Servlets?&lt;br /&gt;Can you explain in detail "javax.servlet" package?&lt;br /&gt;What's the use of ServletContext?&lt;br /&gt;How do we define an application level scope for servlet?&lt;br /&gt;What's the difference between GenericServlet and HttpServlet?&lt;br /&gt;Can you explain in detail javax.servlet.http package?&lt;br /&gt;What's the architecture of a Servlet package?&lt;br /&gt;Why is HTTP protocol called as a stateless protocol?&lt;br /&gt;What are the different ways we can maintain state between requests?&lt;br /&gt;What is URL rewriting?&lt;br /&gt;What are cookies?&lt;br /&gt;What are sessions in Servlets?&lt;br /&gt;What's the difference between getSession(true) and getSession(false)&lt;br /&gt;?&lt;br /&gt;What's the difference between "doPost" and "doGet" methods?&lt;br /&gt;Which are the different ways you can communicate between servlets?&lt;br /&gt;What is functionality of "RequestDispatcher" object?&lt;br /&gt;How do we share data using "getServletContext ()"?&lt;br /&gt;Explain the concept of SSI?&lt;br /&gt;What are filters in JAVA?&lt;br /&gt;Can you explain in short how do you go about implementing filters using&lt;br /&gt;Apache Tomcat?&lt;br /&gt;Twist: - Explain step by step of how to implement filters?&lt;br /&gt;what's the difference between Authentication and authorization?&lt;br /&gt;Explain in brief the directory structure of a web application?&lt;br /&gt;Can you explain JSP page life cycle?&lt;br /&gt;What is EL?&lt;br /&gt;how does EL search for an attribute?&lt;br /&gt;What are the implicit EL objects in JSP?&lt;br /&gt;How can we disable EL?&lt;br /&gt;what is JSTL?&lt;br /&gt;Can you explain in short what the different types of JSTL tags are?&lt;br /&gt;How can we use beans in JSP?&lt;br /&gt;What is &lt;jsp:forward&gt; tag for ?&lt;br /&gt;What are JSP directives?&lt;br /&gt;what are Page directives?&lt;br /&gt;what are include directives?&lt;br /&gt;Can you explain taglib directives?&lt;br /&gt;How does JSP engines instantiate tag handler classes instances?&lt;br /&gt;what's the difference between JavaBeans and taglib directives?&lt;br /&gt;what are the different scopes an object can have in a JSP page?&lt;br /&gt;what are different implicit objects of JSP?&lt;br /&gt;what are different Authentication Options available in servlets?&lt;br /&gt;Can you explain how do we practically implement security on a resource?&lt;br /&gt;How do we practically implement form based authentication?&lt;br /&gt;How do we authenticate using JDBC?&lt;br /&gt;Can you explain JDBCRealm?&lt;br /&gt;Can you explain how do you configure JNDIRealm?&lt;br /&gt;How did you implement caching in JSP?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;EJB&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What is EJB?&lt;br /&gt;what are the different kind of EJB's?&lt;br /&gt;you are designing architecture for a project how do you decide whether&lt;br /&gt;you should use&lt;br /&gt;session, entity or message driven bean?&lt;br /&gt;Can you explain "EJBHome" and "EJBObject" in EJB?&lt;br /&gt;Can client directly create object of session or entity beans?&lt;br /&gt;Can you explain the concept of local interfaces?&lt;br /&gt;What are the limitations of using Local object?&lt;br /&gt;Which application server have you used for EJB ?&lt;br /&gt;Can you explain step by step practically developing and deploying EJB&lt;br /&gt;component?&lt;br /&gt;what is Passivation and Activation in EJB?&lt;br /&gt;Can beans who are involved in transaction have "Passivation"&lt;br /&gt;process?&lt;br /&gt;How does the server decide which beans to passivate and activate?&lt;br /&gt;In what format is the conversational data written to the disk?&lt;br /&gt;Can you explain in brief Life cycle for Stateless and Stateful beans?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Struts&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What's MVC pattern?&lt;br /&gt;Define struts?&lt;br /&gt;Can you explain the directory structure for a struts folder in brief ?&lt;br /&gt;Can you give an overview of how a struts application flows?&lt;br /&gt;Twist: - What are action and action form classes in Struts?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;XML and Web Services&lt;br /&gt;&lt;br /&gt;What is XML?&lt;br /&gt;What is the version information in XML?&lt;br /&gt;What is ROOT element in XML?&lt;br /&gt;If XML does not have closing tag will it work?&lt;br /&gt;Is XML case sensitive?&lt;br /&gt;What is the difference between XML and HTML?&lt;br /&gt;Is XML meant to replace HTML?&lt;br /&gt;Can you explain why your project needed XML?&lt;br /&gt;What is DTD (Document Type definition)?&lt;br /&gt;What is well formed XML?&lt;br /&gt;What is a valid XML?&lt;br /&gt;What is CDATA section in XML?&lt;br /&gt;What is CSS?&lt;br /&gt;What is XSL?&lt;br /&gt;What is element and attributes in XML?&lt;br /&gt;What are the standard ways of parsing XML document?&lt;br /&gt;In What scenarios will you use a DOM parser and SAX parser?&lt;br /&gt;What is XSLT?&lt;br /&gt;Define XPATH?&lt;br /&gt;What is the concept of XPOINTER?&lt;br /&gt;What is a Web Service ?&lt;br /&gt;What is DISCO ?&lt;br /&gt;What is SOAP ?&lt;br /&gt;What is WSDL ?&lt;br /&gt;Can you explain UDDI ?&lt;br /&gt;Can you explain JAXP ?&lt;br /&gt;What is a XML registry?&lt;br /&gt;What is JAXR?&lt;br /&gt;What is JAXM?&lt;br /&gt;Can you explain how JAXM messaging model works?&lt;br /&gt;Can you explain JAX-RPC?&lt;br /&gt;Internationalization&lt;br /&gt;Can you explain i18n and l10n?&lt;br /&gt;Can you explain internationalization and localization?&lt;br /&gt;What is Locale?&lt;br /&gt;How do we display numbers, currency and Dates according to proper&lt;br /&gt;Locale format?&lt;br /&gt;what are resource bundles?&lt;br /&gt;How do we load a resource bundle file?&lt;br /&gt;How can we do inheritance in resource bundles?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;JNI&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What is Native Interface in JAVA?&lt;br /&gt;Can you say in brief steps required to implement Native interfaces in&lt;br /&gt;Java?&lt;br /&gt;Can JNI be used for VB6, C# or VB.NET directly?&lt;br /&gt;What are JNI functions and pointers?&lt;br /&gt;How does the garbage collector know JNI objects are no more used?&lt;br /&gt;Twist: - What are the different types of references JNI supports?&lt;br /&gt;Twist: - How to do you delete global objects?&lt;br /&gt;how does the native language C or C++ understand data types in JAVA?&lt;br /&gt;Can you explain exception handling in JNI?&lt;br /&gt;What are limitations for "JNIEnv" pointer in multi-threading&lt;br /&gt;scenarios?&lt;br /&gt;What are the advantages and disadvantages of using "JNI"?&lt;br /&gt;Architecture&lt;br /&gt;What are design patterns ?&lt;br /&gt;What is the difference between Factory and Abstract Factory Patterns?&lt;br /&gt;What is MVC pattern?&lt;br /&gt;Twist: - How can you implement MVC pattern in Servlets and JSP?&lt;br /&gt;How can we implement singleton pattern in JAVA?&lt;br /&gt;How do you implement prototype pattern in JAVA?&lt;br /&gt;Twist: - How to implement cloning in JAVA? What is shallow copy and&lt;br /&gt;deep copy ?&lt;br /&gt;Can you give a practical implementation of FAÇADE patterns?&lt;br /&gt;How can we implement observer pattern in JAVA?&lt;br /&gt;What is three tier architecture?&lt;br /&gt;What is Service Oriented architecture?&lt;br /&gt;What is aspect oriented programming?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Project Management&lt;br /&gt;&lt;br /&gt;What is project management?&lt;br /&gt;Is spending in IT projects constant through out the project?&lt;br /&gt;Who is a stakeholder ?&lt;br /&gt;Can you explain project life cycle ?&lt;br /&gt;Twist :- How many phases are there in software project ?&lt;br /&gt;Are risk constant through out the project ?&lt;br /&gt;Can you explain different software development life cycles ?&lt;br /&gt;What is triple constraint triangle in project management ?&lt;br /&gt;What is a project baselines ?&lt;br /&gt;What is effort variance?&lt;br /&gt;How is normally a project management plan document organized ?&lt;br /&gt;How do you estimate a project?&lt;br /&gt;What is CAR (Causal Analysis and Resolution)?&lt;br /&gt;What is DAR (Decision Analysis and Resolution) ?&lt;br /&gt;What is a fish bone diagram ?&lt;br /&gt;Twist:- What is Ishikawa diagram ?&lt;br /&gt;What is pareto principle ?&lt;br /&gt;Twist :- What is 80/20 principle ?&lt;br /&gt;How do you handle change request?&lt;br /&gt;What is internal change request?&lt;br /&gt;What is difference between SITP and UTP in testing ?&lt;br /&gt;What is the software you have used for project management?&lt;br /&gt;What are the metrics followed in project management?&lt;br /&gt;Twist: - What metrics will you look at in order to see the project is&lt;br /&gt;moving successfully?&lt;br /&gt;You have people in your team who do not meet there deadlines or do not&lt;br /&gt;perform what&lt;br /&gt;are the actions you will take ?&lt;br /&gt;Twist :- Two of your resources have conflicts between them how would&lt;br /&gt;you sort it out ?&lt;br /&gt;What is black box testing and White box testing?&lt;br /&gt;What's the difference between Unit testing, Assembly testing and&lt;br /&gt;Regression testing?&lt;br /&gt;What is V model in testing?&lt;br /&gt;How do you start a project?&lt;br /&gt;How did you do resource allocations?&lt;br /&gt;How will you do code reviews ?&lt;br /&gt;What is CMMI?&lt;br /&gt;What are the five levels in CMMI?&lt;br /&gt;What is continuous and staged representation?&lt;br /&gt;Can you explain the process areas?&lt;br /&gt;What is SIX sigma?&lt;br /&gt;What is DMAIC and DMADV ?&lt;br /&gt;What are the various roles in Six Sigma implementation?&lt;br /&gt;What are function points?&lt;br /&gt;Twist: - Define Elementary process in FPA?&lt;br /&gt;What are the different types of elementary process in FPA?&lt;br /&gt;What are the different elements in Functions points?&lt;br /&gt;Can you explain in GSC and VAF in function points?&lt;br /&gt;What are unadjusted function points and how is it calculated?&lt;br /&gt;Can you explain steps in function points?&lt;br /&gt;What is the FP per day in your current company?&lt;br /&gt;Twist :- What is your company's productivity factor ?&lt;br /&gt;Do you know Use Case points?&lt;br /&gt;What is COCOMO I, COCOMOII and COCOMOIII?&lt;br /&gt;What is SMC approach of estimation?&lt;br /&gt;How do you estimate maintenance project and change requests?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;UML&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What is UML?&lt;br /&gt;How many types of diagrams are there in UML ?&lt;br /&gt;Twist :- Explain in short all types of diagrams in UML ?&lt;br /&gt;What are advantages of using UML?&lt;br /&gt;Twist: - What is Modeling and why UML ?&lt;br /&gt;What is the sequence of UML diagrams in project?&lt;br /&gt;Twist: - How did you implement UML in your project?&lt;br /&gt;Just a small Twist: - Do I need all UML diagrams in a project?&lt;br /&gt;Give a small brief explanation of all Elements in activity diagrams?&lt;br /&gt;Explain Different elements of a collaboration diagram ?&lt;br /&gt;Explain Component diagrams ?&lt;br /&gt;Explain all parts of a deployment diagram?&lt;br /&gt;Describe the various components in sequence diagrams?&lt;br /&gt;What are the element in State Chart diagrams ?&lt;br /&gt;Describe different elements in Static Chart diagrams ?&lt;br /&gt;Explain the different elements of a Use Case ?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7266580669968450373-9114882192186868461?l=thesandeepsaxena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thesandeepsaxena.blogspot.com/feeds/9114882192186868461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7266580669968450373&amp;postID=9114882192186868461' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/9114882192186868461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/9114882192186868461'/><link rel='alternate' type='text/html' href='http://thesandeepsaxena.blogspot.com/2009/05/java-technology-job-interview-questions.html' title='Java Technology Job Interview Questions'/><author><name>Sandeep</name><uri>http://www.blogger.com/profile/11401210729852266730</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_BUWbGMq2OqY/S6r8PfJsMRI/AAAAAAAAABU/N6KSsnR3KD8/S220/0619_133223.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7266580669968450373.post-859064804785290499</id><published>2009-02-25T03:52:00.000-08:00</published><updated>2009-06-11T00:49:12.824-07:00</updated><title type='text'>Now MS from India ???</title><content type='html'>SSN SASE ,Chennai is an excellent college for MS . This Software School is started by Mr.Shiv Nadir(HCL Giant ) for the excellence of indian it industry .&lt;br /&gt;This program is of 18 months and the degree will be rewarded of CARNEGIE MELLON UNIVERSITY.&lt;br /&gt;Placement is excellent i.e. average salary is $ 90,000 pa .For more details please visit college website &lt;cite&gt;&lt;b&gt;sase&lt;/b&gt;.&lt;b&gt;ssn&lt;/b&gt;.edu.in/&lt;/cite&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7266580669968450373-859064804785290499?l=thesandeepsaxena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thesandeepsaxena.blogspot.com/feeds/859064804785290499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7266580669968450373&amp;postID=859064804785290499' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/859064804785290499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/859064804785290499'/><link rel='alternate' type='text/html' href='http://thesandeepsaxena.blogspot.com/2009/02/now-ms-from-india.html' title='Now MS from India ???'/><author><name>Sandeep</name><uri>http://www.blogger.com/profile/11401210729852266730</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_BUWbGMq2OqY/S6r8PfJsMRI/AAAAAAAAABU/N6KSsnR3KD8/S220/0619_133223.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7266580669968450373.post-8494744405287389323</id><published>2009-02-25T03:47:00.000-08:00</published><updated>2009-02-25T03:49:51.166-08:00</updated><title type='text'>ISB Now in North....</title><content type='html'>Its a great news ..that ISB(Indian School of Business) is going to open its center in Mohali&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7266580669968450373-8494744405287389323?l=thesandeepsaxena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thesandeepsaxena.blogspot.com/feeds/8494744405287389323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7266580669968450373&amp;postID=8494744405287389323' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/8494744405287389323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/8494744405287389323'/><link rel='alternate' type='text/html' href='http://thesandeepsaxena.blogspot.com/2009/02/isb-now-in-north.html' title='ISB Now in North....'/><author><name>Sandeep</name><uri>http://www.blogger.com/profile/11401210729852266730</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_BUWbGMq2OqY/S6r8PfJsMRI/AAAAAAAAABU/N6KSsnR3KD8/S220/0619_133223.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7266580669968450373.post-7611835518559585033</id><published>2009-02-25T03:28:00.000-08:00</published><updated>2009-02-25T03:35:23.287-08:00</updated><title type='text'>Suzuki has launched new bike in 150 cc segment</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_BUWbGMq2OqY/SaUs418cPRI/AAAAAAAAAAY/AvGhzTeL3NU/s1600-h/GS-150R.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 314px;" src="http://3.bp.blogspot.com/_BUWbGMq2OqY/SaUs418cPRI/AAAAAAAAAAY/AvGhzTeL3NU/s320/GS-150R.jpg" alt="" id="BLOGGER_PHOTO_ID_5306697090990882066" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Suzuki India has launched new bike named GS150 R.&lt;br /&gt;Check the specifications....&lt;br /&gt;&lt;table width="90%" border="0" cellpadding="0" cellspacing="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2" class="red" bgcolor="#f0f0f0" height="20"&gt; Dimensions And Dry Mass&lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2"&gt;&lt;table width="100%" border="0" cellpadding="0" cellspacing="1"&gt;                                 &lt;tbody&gt;&lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td width="48%" height="20"&gt; Fuel Tank Capacity (L)&lt;/td&gt;                                 &lt;td width="52%"&gt; 15.5&lt;/td&gt;                               &lt;/tr&gt;          &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td width="48%" height="20"&gt; Overall Length (mm)&lt;/td&gt;                                 &lt;td width="52%"&gt; 2,095 &lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Overall Width (mm)&lt;/td&gt;                                 &lt;td&gt; 775&lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Overall Height (mm)&lt;/td&gt;                                 &lt;td&gt;  1,120&lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Wheelbase (mm)&lt;/td&gt;                                 &lt;td&gt; 1,340 &lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Ground Clearance (mm)&lt;/td&gt;                                 &lt;td&gt; 160 &lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Seat Height (mm) &lt;/td&gt;                                 &lt;td&gt; 790 &lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Dry Weight (kg) &lt;/td&gt;                                 &lt;td&gt; 134 &lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Curb Mass (kg)&lt;/td&gt;                                 &lt;td&gt; 149&lt;/td&gt;                               &lt;/tr&gt;                             &lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2" height="25"&gt;&lt;br /&gt;&lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2" class="red" bgcolor="#f0f0f0" height="20"&gt; Engine&lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2"&gt;&lt;table width="100%" border="0" cellpadding="0" cellspacing="1"&gt;                               &lt;tbody&gt;&lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td width="48%" height="20"&gt; Type&lt;/td&gt;                                 &lt;td width="52%"&gt;4-stroke, Air-cooled, SOHC&lt;/td&gt;                               &lt;/tr&gt;                              &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Bore x Stroke (mm)&lt;/td&gt;                                 &lt;td&gt;  57.0 x 58.6&lt;/td&gt;                               &lt;/tr&gt;                                &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Displacementn (cm&lt;sup&gt;&lt;strong&gt;3&lt;/strong&gt;&lt;/sup&gt;)&lt;/td&gt;                                 &lt;td&gt; 149.5&lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Max Power &lt;/td&gt;                                 &lt;td&gt; 13.8bhp@8,500rpm   &lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Max Torque &lt;/td&gt;                                 &lt;td&gt; 13.4Nm@6,000rpm&lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Compression Ratio &lt;/td&gt;                                 &lt;td&gt; 9.35:1&lt;/td&gt;                               &lt;/tr&gt;          &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Carburetor&lt;/td&gt;                                 &lt;td&gt; BS26 with TPS&lt;/td&gt;                               &lt;/tr&gt;           &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Ignition&lt;/td&gt;                                 &lt;td&gt; CDI&lt;/td&gt;                               &lt;/tr&gt;                                         &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Transmission&lt;/td&gt;                                 &lt;td&gt; 6-speed (1-down, 5-up) &lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Starting&lt;/td&gt;                                 &lt;td&gt; Electric &amp;amp; kick &lt;/td&gt;                               &lt;/tr&gt;                                                            &lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2"&gt; &lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2" class="red" bgcolor="#f0f0f0" height="20"&gt;&lt;strong&gt;Suspension&lt;/strong&gt;&lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2"&gt;&lt;table width="100%" border="0" cellpadding="0" cellspacing="1"&gt;                               &lt;tbody&gt;&lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td width="48%" height="20"&gt; Front&lt;/td&gt;                                 &lt;td width="52%"&gt; Telescopic, Coil Spring, Oil Damped &lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Rear&lt;/td&gt;                                 &lt;td&gt; Swingarm Type Coil Spring, Oil and Damped &lt;/td&gt;                               &lt;/tr&gt;                                                                                           &lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2"&gt; &lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2" class="red" bgcolor="#f0f0f0" height="20"&gt;&lt;strong&gt;Brake&lt;/strong&gt;&lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2"&gt;&lt;table width="100%" border="0" cellpadding="0" cellspacing="1"&gt;                               &lt;tbody&gt;&lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td width="48%" height="20"&gt; Front&lt;/td&gt;                                 &lt;td width="52%"&gt; Hydraulic single disc  &lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Rear&lt;/td&gt;                                 &lt;td&gt; Drum &lt;/td&gt;                               &lt;/tr&gt;                             &lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2"&gt; &lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2" class="red" bgcolor="#f0f0f0" height="20"&gt;&lt;strong&gt;Tyre&lt;/strong&gt;&lt;strong&gt; Size &lt;/strong&gt;&lt;/td&gt;                           &lt;/tr&gt;                           &lt;tr&gt;                             &lt;td colspan="2"&gt;&lt;table width="100%" border="0" cellpadding="0" cellspacing="1"&gt;                               &lt;tbody&gt;&lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td width="48%" height="20"&gt; Front&lt;/td&gt;                                 &lt;td width="52%"&gt; 2.75-18 42P &lt;/td&gt;                               &lt;/tr&gt;                               &lt;tr class="text" bgcolor="#e8e8e8"&gt;                                 &lt;td height="20"&gt; Rear&lt;/td&gt;                                 &lt;td&gt; 100/90-18 M/C 56P &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;In Delhi its Rs: 58,431 ex show room.&lt;br /&gt;&lt;br /&gt;The good thing is that the bike has 6 speed gear box with a refined engine.&lt;br /&gt;We can hope with this bike Suzuki will fire the road.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7266580669968450373-7611835518559585033?l=thesandeepsaxena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thesandeepsaxena.blogspot.com/feeds/7611835518559585033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7266580669968450373&amp;postID=7611835518559585033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/7611835518559585033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/7611835518559585033'/><link rel='alternate' type='text/html' href='http://thesandeepsaxena.blogspot.com/2009/02/suzuki-has-launched-new-bike-in-150-cc.html' title='Suzuki has launched new bike in 150 cc segment'/><author><name>Sandeep</name><uri>http://www.blogger.com/profile/11401210729852266730</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_BUWbGMq2OqY/S6r8PfJsMRI/AAAAAAAAABU/N6KSsnR3KD8/S220/0619_133223.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_BUWbGMq2OqY/SaUs418cPRI/AAAAAAAAAAY/AvGhzTeL3NU/s72-c/GS-150R.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7266580669968450373.post-5355277835791952997</id><published>2008-05-01T09:35:00.000-07:00</published><updated>2008-05-01T10:00:51.939-07:00</updated><title type='text'>Remembering God...............</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Every one remembers God , in each and every second . Is it true ???? Or in his bad time???&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sandeep's Fact :&lt;/span&gt;Every one remember god it is true but i think mostly he remembers God only in his bad time to make  God responsible for that.&lt;br /&gt;The Trend of Human Being is if something around him or concerned to him is not in his favor  the responsibility of all mis happening is  of God.&lt;br /&gt;The following questions are asked by human being to God.&lt;br /&gt;"Why all these things are happening to me?"&lt;br /&gt;"What is my Fault?"&lt;br /&gt;"Why me?"&lt;br /&gt;" Why are you taking my so tough examination?"&lt;br /&gt;And When all things are well and days are good never ever a human gives credit to God for all god things.&lt;br /&gt;In good days he has following statements.&lt;br /&gt;"It is my hard work which is now rewarded."&lt;br /&gt;"I knew that i can do it."&lt;br /&gt;"How i performed it only i know ".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It is my fact and  my opinion regarding to remembering God and it is not a universal truth.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Spread Smile,&lt;br /&gt;Sandeep Saxena&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7266580669968450373-5355277835791952997?l=thesandeepsaxena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thesandeepsaxena.blogspot.com/feeds/5355277835791952997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7266580669968450373&amp;postID=5355277835791952997' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/5355277835791952997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7266580669968450373/posts/default/5355277835791952997'/><link rel='alternate' type='text/html' href='http://thesandeepsaxena.blogspot.com/2008/05/remembering-god.html' title='Remembering God...............'/><author><name>Sandeep</name><uri>http://www.blogger.com/profile/11401210729852266730</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_BUWbGMq2OqY/S6r8PfJsMRI/AAAAAAAAABU/N6KSsnR3KD8/S220/0619_133223.jpg'/></author><thr:total>0</thr:total></entry></feed>
