Quantcast
Channel: Top Servlets Interview Questions :: ALLInterview.com
Browsing latest articles
Browse All 15 View Live

can we override service method in my servlet class..?? if yes or no

yes, we can override service() in our servlet, but not preferable. if we want use these service from any protocol like ftp,telnet, then we have to override.

View Article



What is difference between Forward() and sendRedirect() methode?

In the case of forward() the server will redirect to the next page but in the case of sendRedirct() the server will inform the browser to redirect the url to the next page.

View Article

how can we create object to a class in a jsp file?

use the page import tag to import ur class and execute methods of the class Please check for some docu

View Article

What are different types of Servlets?

The different types of servlets are Generic Servlets Http Servlets

View Article

What is HTTP Session ?

HTTP Session mainly used for associated with HTTP Client and HTTP sever.session will maintain the state with unque Id for each client req.

View Article


we cant Override Jsp Service method?Why?

_jspService() method will be written by the container hence any methods which are not to be overridden by the end user are typically written starting with an '_'. This is the reason why we don't...

View Article

How to run a servlet program?

We have to Make a WEB-INF folder and under it classes folder. In WEB-INF we have to write web.xml . Our compled servelet class file should be stored in classes folder. Make a war file using jar &...

View Article

How to make servlet thread safe?

There are situations where we want to protect your servlet member variables from being modified by different clients.In this case you can have your servlet by implementing the marker interface...

View Article


What is Single Threaded Model in Servlets? Explain this with an exam

Single Thread Model ensures that servlet handles only one request at a time.When YOUR CLASS IMPLEMENTS THIS INTERFACE WE ARE GUARENTEED THAT no two threads run simultaneously in service() method. this...

View Article


What is the difference between servlet config and servlet context.

Servlet config is a private area for every servlet.Any variable stored there is accessible to only that servlet while sevlet context is a shared area for every servlet in an application.In an...

View Article

What is the use of RequestDispatcher in servlet?

RequestDispatcher is used to connect to another webresource with in the same context. RequestDispatcher rd=ServletContext.getRequestDispatcher("url of resource"); rd.forward(req,res);----used to...

View Article

How do you pass the data from one servlet to another servlet?

Using Request Dispatcher, you can send the values and forward to another page. ServletContext.getRequestDispatcher(); reqDispatcher.forward(req,res) Forwards a request from a servlet to another...

View Article

Difference between Include, Forward and sendRedirect in Servlet?

Response.sendRedirect () This function is used, when we want to redirect the client request to some other site (i.e out of our context) or when ever we want to redirect errors. If you are using...

View Article


What is ServletContext() and what is its use?

Assume that ServletContext is shared momeroy for all servelts which are existed in a web application, we can place an object on to the servletcontext, and that can uses all other servlets which are...

View Article

what is the difference between Servlet and JSP?Advantage of JSP over

. The main difference between them is, In servlets both the presentation and business logic are place it together. Where as in jsp both are saparated by defining by java beans . In jsp's the overall...

View Article

Browsing latest articles
Browse All 15 View Live




Latest Images