How we can declare the variable, which we can access through-out the session in servlet & JSP?
What is difference between servlet and applet
I don t know
Hello sir, Everywhere I read that Servlet does not work on GUI but applet works. What is meaning of this line?
An applet get downloaded onto the client system and executes over the client system and gives the results..where as a servlet gets executed in a server and only the results are sent to the client.
do get is like a open store, let come take what you want...but match the address....then
dopost is posting the all data to where is a address like all information in one box.
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 ...
they both r service methods.....
do get() has a disadvantage of sending very less amt of
information as it can send 24 to 255 character........
do post() is used for posting d information.....
in doPost() data of the client is send as apart of request body and in doGet() data of the client is send as a part of url
OK,but my question is... In HttpServlet class service method calls doGet() or doPost() method .Intead of overriding doGet() or doPost(),why should we not override service() method itself?????
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 ...
Why do we need to implement 3rd party support for using connection pooling ?
It will provide better service
What is difference between cgi and servlet in interview point?
Each time whenever a request comes to a CGI from server,it opens a new connection for that request.If a number of clients make request to the same serve,CGI will open a new connection to serve their r...
CGI and Servlets are used to develop web application only. CGI is a oldest technique and the main drawback of CGI is
1. Starting process is very expensive
2. It performs very poor.
How many objects are created when same or different client send 100 requests to a servlet?
Only one instance create remain are composite object
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...
In which conditions we have to use the servletcontext
http://tomcat.apache.org/tomcat-4.1-doc/servletapi/javax/servlet/ServletContext.html go through this link u will find setAttribute() method.
Do we have setAttribute for ServletContext object...??
How many ways we can destroy the servlet in ur program
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...
Service() method of servlet class is not synchronize then how will it work as thread-safe for every request at the same time?
Servlets are not thread safe. If you want to make it Servlet as Thread safe, you can implement SingleThreadInterface
What is the difference between genericservlet and httpservlet?
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...
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(). It supports state programming also. It is platform-dependent. It handles only Http protocol.
Genericservlet is protocol independent, httpservlet is protocol dependent
Genericservlet contains p v service(-,-),
httpservlet contains p v service(-,-), protected v service(-,-), doGet(-,), doPost(-,-), doPut(-,-),--------etc
httpservlet is one of the predefined subclass of genericservlet
What is the modifier for the httpservlet class service method?
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, ...
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...
What is the diff b/w doget() and service() method
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 handler methods(doXXX) for each HTTP request type
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...
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...
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...
How will you provide security to web application?
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...
Using POST method we can provide security
What are forward & include methods? Why these are used?
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...
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...
How many servlet objects are created if we have 10 servlets in web application?
No.. for each servlet one instance is created.
ThreadPool ---> Servlet instace
Thread1 -----> servlet1
Thread2 servlet2
Thread3 servlet3
As per client request thread1,2,3 can access same servlet1 instance.We need instace for each servlet to access it.
Only one object is created but for 10 servlets web container creates 10 threads
What is difference between servlet container and servlet config?
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...
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,processing and destroying it.