Saturday, 14 March 2015

Servlet and JSP interview questions

1.       What is JSESSIONID in Java? When does JSESSIONID gets created ?
2.       What is difference between include action and include directive in JSP?
3.       How do you define application wide error page in JSP?
4.       Difference between sendredirect and forward in Servlet ?
5.        How do remove variable using <c:set> tag from JSTL ?
6.       What is difference between Web Server and Application Server ?
7.        What is difference between URL Encoding and URL rewriting ?
8.        How do you get ServletContext reference inside Servlet ?
9.       What is difference between ServletContext and ServletConfig in Java ?
10.   What is difference between GET and POST method in HTTP protocol?
11.   What does load-on-start-up element in web.xml do?
12.   What are the phases of the servlet life cycle?
13.   What are the phases of the servlet life cycle?
14.   What is the difference between doGet() and doPost()?
15.   What is the difference between the include() and forward() methods?
100.            What is the purpose of <load-on-startup>?
103.            Explain about GenericServlet?
106.            Explain best way of overriding init()?
108.            Explain the difference between GET&POST?
109.            What are various HttpReuest methods?
110.            What is the difference between HEAD&GET?
111.            What is the difference between PUT&GPOST?
112.            Which Http methods are non-idempotent?
113.            Which Http methods are idempotent?
114.            In how many ways we can trigger a GET reuest?
115.            What is the default method for the form?
118.            Explain life cycle of getReuest?
120.            If you are sending Get reuest but our Servlet contains doGet() & service() Methods then which method will be executed?
124.            What is the purpose of  reuest Headers?
126.            To what value is a variable of the String type automatically initialized?How we can retrieve cookies from the reuest?
130.            What is the MIME type?
137.            How we can add cookies to the response?
142.            Explain about web.xml?
149.            Can you specify any 10 tags of web.xml?
151.            What is the purpose of <servlet-name>
167.            What is the default welcome-file?
170.            How to send ErrorCode programmatically?
171.            What is the purpose of <mime-mapping>?
173.            What is the purpose of META-INF folder?
174.            Explain about MANIFEST.MF?
180.            What are the difference between parameters & attributes?classhierarchy?
181.            What is the purpose of an attribute?
183.            Explain the cases where we should go for each scope?
184.            explain the methods to perform following activities?
a)      Adding an attribute?
b)     Get the name of an attribute?
c)      Remove an attribute?
d)     Modify the value of an attribute?
e)      To display all attribute names present in a specified scope?
186.            What is the purpose of ReuestDispatcher?
192.            What are various attributes added by web container while forwarding & including?      What is the purpose of these attributes?
195.             What is the purpose of FilterChain?
196.            How we can configure filter in web.xml?
197.            In how many ways we can map a filter?
198.            What is the purpose of <dispatcher> tag?
204.            What is the purpose of wrapper?
205.            Explain the types of wrappers?
206.            Explain Decorator design pattern?
208.            What is the need of Session Management? Explain cases where   Session Management is reuired with example?
213.            How we can invalidate a Session?
214.            Define Session management?
219.            What is the default session timeout?
224.            What is URL Rewriting?
225.            By using which Methods we can implement URLRewriting?
227.            Explain advantages & disadvantages of cookies, URL Writing, Session API
228.            Explain the purpose of Listener?
231.            How to configure listener in web.xml?
234.            What is the difference between HSAL & HSBL?
235.            What are various methods present in binding listeners?
244.            What is the difference between declarative Security & programmatic security?
247.            How we can configure users in Tomcat?

No comments:

Post a Comment