JSP-Servlet Interview Questions You'll Most Likely Be Asked

Price: $19.95

JSP-Servlet Interview Questions You'll Most Likely Be Asked is a perfect companion to stand a head above the rest in today's competitive job market. Rather than going through comprehensive, textbook-sized reference guides, this book includes only the information required immediately for job search to build an IT career. This book puts the interviewee in the driver's seat and helps them steer their way to impress the interviewer.
Table of Contents
1. Servlet
2. Servlet Lifecycle
3. Servlet Reloading / Loading
4 . Servlet Context
5. Session Management
6. Session Object
7. Servlet Event Listeners
8. Servlet Filter
9. JSP and Servlet
10. JSP Lifecycle and Methods
11. JSP Implicit Object
12. JSP Tags
13. JSP Actions
14. GetParameter()
15. Response Object
16. PrintWriter, JspWriter
17. Miscellaneous
HR Questions
a) 280 JSP-Servlet Interview Questions, Answers and proven strategies for getting hired as an IT professional
b) Dozens of examples to respond to interview questions
c) 78 HR Questions with Answers and proven strategies to give specific, impressive, answers that help nail the interviews
d) 2 Aptitude Tests download available on  www.vibrantpublishers.com
Sample from the book
(Below Questions and Answers are randomly taken from different pages of the book)
9: If we need to perform a login validation before hitting our application servlet, what could be done?
To perform a login validation, we can use ServletFilter. This is mainly to provide authorization for all the pages given in the application. Only a single filter is needed to enable the authorization.
100: What is the difference between request.getSession(true) and request.getSession(false)?
The difference between request.getSession(true) and request.getSession(false) are:
a) getSession(true): Will check if any session already exists for this user. If a session exists, it will return the session object; else it will create a new session and return it.
b) getSession(false): Will check if any session already exists for this user. If a session exists, it will return the session object, else it will return null. It is used when the user needs to logout i.e. request for session to be invalidated or timing out.
207: Compare JspWriter and PrintWriter.
a) JspWriter: It is the buffered version of PrintWriter and denoted by “out” implicit object for sending output back to the client. It throws java.io.IOException. For example, if HTTP connection is broken for some reason, JSP would not send any data to the broken connection
b) PrintWriter: It does not support buffering and does not throw any exception. It is obtained from response.getWriter()
260: How would you send a file to a browser from your application or download a file from the application?
If the user clicks the file to download, it should invoke the servlet where the content type of the response and the Content-disposition for the response header would be set. The servlet would return the file data to the browser using ServletOutputStream and its write() method.Content-disposition of response header contains “attachment” which is used to invoke Save As dialog.
protectedvoiddoGet(HttpServletRequest request,
HttpServletResponse response) throwsServletException, IOException{
ServletOutputStreamoutStream = response.getOutputStream();
String contentType = "application/x-download";
response.setHeader("Content-disposition", "attachment;filename=" + downloadFileName+ """);
Servlet, Servlet LifecycleServlet Reloading / Loading, Servlet Context Session Management, Session Object, Servlet Event Listeners, Servlet Filter, JSP and Servlet, JSP Lifecycle and Methods, JSP Implicit Object, JSP Tags, JSP Actions, GetParameter(),Response Object, PrintWriter, JspWriter, Miscellaneous