Académique Documents
Professionnel Documents
Culture Documents
Asked By: sadashivarao | Asked On: Sep 13th, 2006 Answered by: Satendra Mishra on: Jan 30th, 2012 14 answers
when the request comes from the same client/browser for the 100 times the existing Servlet Object is retrieved i.e if at all the request comes from the same browser/client new Servlet Object is not cr... Answer Question Select Best Answer
Do we have setAttribute for ServletContext object...?? I couldn't find the method name in the API... Answer Question Select Best Answer
We can destroy servlet in two ways one is when the server time out and another one is when power off. Guys pls refer these ... Please ensure your answer is not mislead some body..http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Servlet.htmlpublic void destroy()Called by the servlet co... Answer Question Select Best Answer
Is servlets thread-safe?
Asked By: Mukeshtop | Asked On: Dec 21st, 2011 1 answer
Service() method of servlet class is not synchronize then how will it work as thread-safe for every request at the same time?
Answered by: pradeep on: Jan 19th, 2012
Servlets are not thread safe. If you want to make it Servlet as Thread safe, you can implement SingleThreadInterface Answer Question Select Best Answer
Genericservlet is for servlets that might not use http, like for instance ftp service.As of only http is implemented completely in httpservlet. The genericservlet has a service() method that gets called when a client request is made. This means that it gets called by both incoming requests and the http...
Answered by: ajaykumargurrala on: Jan 11th, 2012
GenericServlet suppports only service(). It handles simple requests, It is platform-independent. It handles all types of protocols like http, smtp, ftp. HttpServlet supports both doget() & dopost(). ...
Answered by: gayathri on: Nov 30th, 2011
Genericservlet is protocol independent, httpservlet is protocol dependent Genericservlet contains p v service(-,-), httpservlet contains p v service(-,-), protected v service(-,-), doGet(-,), doPost... Answer Question Select Best Answer
Protected.
Sorry i was not clear with my previous answer.So posting answer again We have two service methods in httpServlet public void service(ServletRequest req, ServletResponse res) throws ServletException, ...
Answered by: delindia fathima on: Dec 20th, 2011
We have two service methods in httpServlet Dispatches client requests to the protected service method. Theres no need to override this method. public void service(ServletRequest req, ServletResponse... Answer Question Select Best Answer
Service method orginates from Generic Servlet and so service method is used to do something which does not involve http protocol. service handles standard HTTP requests by dispatching them to the han...
Answered by: Rajkumar on: Nov 8th, 2006
When we make a request to the application webcontainer makes the request and response object and creates the servlet instance.After it calls the servlet life cycles methods like init().After completin... Answer Question Select Best Answer
What is the difference betweem getrequestdispatcher() available as part of servletcontext and servletrequest
Asked By: divya_a | Asked On: Feb 22nd, 2006 Answered by: Delindia fathima on: Dec 20th, 2011 14 answers
requestDispatcher() of a servlet context will takes absolute path Whereas requestDispatcher() of ServletRequest will takes relative path ServletRequest has current request path to evaluate the relati...
Answered by: Ambar Ray on: Sep 4th, 2011
Hey Folks, In my above post, I missed adding this line which is the MOST IMP change above all one has to make in Tomcat's context.xml file in order to make the above code snipet work-- {geshibot langu... Answer Question Select Best Answer
Struts security
Asked By: s_narasimharao | Asked On: Nov 16th, 2010 3 answers
Servlet provides below security options to web applications 1. Providing Authentication username/password 2. Providing Authorization - whether user has right access to requested resource. Like doc...
Answered by: varun on: Aug 19th, 2011
Using POST method we can provide security Answer Question Select Best Answer
2 answers
What are forward & include methods? Why these are used?
Answered by: delindia fathima on: Dec 20th, 2011
The RequestDispatcher include() method inserts the the contents of the specified resource directly in the flow of the servlet response, as if it were part of the calling servlet. The RequestDispatch...
Answered by: javaguru1979 on: Jun 30th, 2008
Both forward() and include() are concrete methods of the RequestDispatcher class in the Servlet context. forward() - this method is used to show a different resource in place of the servlet originally... Answer Question Select Best Answer
How many servlet objects are created if we have 10 servlets in web application?
Asked By: cvachandu | Asked On: Jun 10th, 2011 Answered by: fathima on: Dec 20th, 2011 4 answers
No.. for each servlet one instance is created. ThreadPool ---> Servlet instace Thread1 -----> servlet1 Thread2 servlet2 Thread3 servlet3 As per client request thread1,2,3...
Answered by: kumar on: Sep 8th, 2011
Only one object is created but for 10 servlets web container creates 10 threads Answer Question Select Best Answer
Servlet container
Asked By: gopalraop | Asked On: Apr 14th, 2008 3 answers
A servlet config object is used by a servlet container, to pass information to a servlet during initialization. The webserver uses separate module to load and run the servlets called servlet containe...
Answered by: srini235 on: May 20th, 2008
servlet container is part of web server which provides run time environment for servlets i.e it manages the entaire life cycle for the servlets like it creates instance,initialization,proces... Answer Question Select Best Answer
What is the difference between doget methods,doget()and service() used in servlet?Can we use service() methods replace of doget() and dopost()?
Asked By: ajay | Asked On: Aug 22nd, 2007 Answered by: Delindia Fathima on: Dec 20th, 2011 12 answers
Yes we can override the service method in our servlet class. If we override the service method then we lose the functionality provided by the httpServlet class and doXXX() methods will not be called ...
Answered by: jitendrab31 on: Sep 11th, 2009
We must override either doget or do post but we should not override the service method and leave this on HTTPservlet. Answer Question Select Best Answer
Access or load the servlet from the servlet context and access the context information
Answered by: Suresh Yerra on: Dec 11th, 2011 Answered by: bharathwatch on: Jul 9th, 2011
We can get the Servlet Context informaiton by using getNamedDispatcher() method in ServletContext. By using ServletContext object... Answer Question Select Best Answer
Write a Java servlet which reads two parameters from the web page,say,value 1 and value 2,which are of type integers,and finds the sum of the two values and return back the result as a web page
Answered by: kamal Mehta on: Dec 11th, 2011
String value1=request.getParameter("value 1"); String value2=request.getParameter("value 2"); Int sum; Int val1=Integer.parseInt("value1"); Int val2=Integer.parseInt("value2"); sum=val1+val2; resp... Answer Question Select Best Answer
when you are overriding any abstract class, you have to override all the methods of that class.
Answered by: dhruv_saksena on: Mar 14th, 2008
GenericServlet is an abstract class because its upto the user how he wants it to use the life-cycle methods of the servlet and also the server needs to make sure that all the life cycle methods of the... Answer Question Select Best Answer
Servlet is Java class. Then why there is no constructor in servlet ? can we write the constructor in servlet
Asked By: Interview Candidate | Asked On: Sep 8th, 2005 Answered by: webdynamics on: Oct 31st, 2011 13 answers
Yes, you can write a constructor in your Servlet if required. But you must understand how the sequence of flows. 1. Servlet instance is created i.e. constructor is called. Note: ServletConfig is not ...
Answered by: suraj20p on: Oct 28th, 2011
Servlet is a java class,whose object will be created by servlet container,and then container will call 3 life cycle method on that object. container creates our servlet class object using 0-args cons... Answer Question Select Best Answer
What is the difference between doget() and dopost() methods of a httpservlet and when to use each one?
Asked By: rs | Asked On: Nov 6th, 2006 Answered by: Ashok Kumar Gogula(MCA) on: Oct 15th, 2011 15 answers
A doGet() method is limited with 2k of data to be sent, and doPost() method doesn't have this limitation. A request string for doGet() looks like the following: http://www.allapplabs.com/svt1?p1=v1&p...
Answered by: papia on: Sep 24th, 2011
1) In doGet Method the parameters are appended to the URL and sent along with header information. In doPost, parameters are sent in separate line in the body 2) Maximum size of data that can be sent ... Answer Question Select Best Answer
Servlets are to servers. Applets are to browsers. Unlike applets, however, servlets have no graphical user interface.
Answered by: shubhra on: Sep 30th, 2011
Applet have no main method. It executes in browser but servlet is a server side program it executes in application server.
Answered by: jimmy514in on: Jul 3rd, 2010
But Servlet is a Server Side Component. It is a Controller in the MVC architecture, It is used to perform business logic and does not deal with the visual implementation. The visual part is done by us...