Tags

links:
http://www.journaldev.com/2015/servlet-interview-questions-and-answers
http://javarevisited.blogspot.com/2011/09/servlet-interview-questions-answers.html

summary:
– ServletConfig for init parameter, 1 per servlet (1 thread), read-only?
– ServletContext for keeping (get or set) attributes/ properties/ values, 1 per whole application
– RequestDispatcher, the IPC to forward()/include() the request to another “resource” (servlet, JSP file, HTML file, etc).
– no use of constructor, need to override init() where ServletConfig is avail

– how to communicate between two servlet (servlet collaboration)?
– RequestDispatchers include () and forward()
– Using sendRedirect() method of Response
– Using servlet Context methods

Advertisements