Servlets together with JSP Interview Questions are pith of whatever J2EE Interview. Its expected from candidate to convey adept cognition of Servlet, JSP, EJB , Struts or Spring inwards whatever J2EE interview. Consequently Servlets together with JSP Interview Questions are real mutual inwards whatever J2EE Interviews along amongst to a greater extent than or less questions from pith Java, Some interview Questions from Spring together with Some EJB interview questions. Since J2EE is primary platform for edifice company together with spider web application using Java programming language, its of import to fix good for J2EE interview, peculiarly If you lot are inwards application evolution space. Servlet together with JSP forms spider web layer of J2EE framework where Java Server pages is primary persuasion technology together with Servlets are primary Controller constituent of criterion MVC architecture. In this article nosotros volition meet couplet of nearly mutual or oftentimes asked JSP together with Servlet Interview questions together with answers, which tin assistance you lot on your J2EE interview grooming together with agreement to a greater extent than or less key concept of Java spider web applications.
JSP Servlet Interview Questions Answers
Here is my listing of oftentimes asked JSP Servlet Interview questions to whatever Java programmer. Most of these Servlet JSP questions has appeared inwards diverse score of J2EE interviews including 2 to iii together with 2 to four years sense level. None of these questions require special inquiry together with neither of them are tricky questions, they all are focused on fundamentals which is key to clear whatever interview.
Question 1: What is JSESSIONID inwards Java? When does JSESSIONID gets created ?
One of my favourite Servlet JSP Interview inquiry for 2 to four years sense programmers on spider web development. JSESSION id is a cookie which is used to handle session inwards Java spider web application. JSESSIONID is created past times Web Container whenever a novel session is created. See What is JSESSIONID inwards Servlet JSP for to a greater extent than details.
Question 2: What is departure betwixt include activity together with include directive inwards JSP?
Another real pop JSP Interview questions, to a greater extent than often than non asked to 2 to iii years experienced J2EE programmer. There are couplet of differences, nearly of import of them is that include activity is request time inclusion piece include directive is translation fourth dimension inclusion of to a greater extent than or less other resources e.g. JSP or html pages. This questions is likewise asked every bit departure betwixt file include together with page include. See Include activity vs Include directive for to a greater extent than differences.
Question 3: How create you lot define application broad mistake page inwards JSP?
Almost inwards every Servlet JSP interview you lot volition meet inquiry from mistake handling. You tin define 2 kinds of mistake pages inwards Java spider web application, i is using tag <error-page> inwards web.xml together with other is past times using mistake page JSP which uses isErrorpage to declare that this jsp page tin survive used every bit mistake page. Other JSP uses that page past times using attribute errorpage="error.jsp". Whenever you lot larn an unhandled exception inwards JSP, asking volition survive routed to mistake page. See How to utilisation mistake page inwards JSP for detailed reply of this question.
Question 4: Difference betwixt sendredirect together with forrad inwards Servlet ?
One of the classical Interview Question from Servlet together with JSP. This inquiry is every bit sometime every bit Vector vs ArrayList inwards pith Java. Anyway meet difference betwixt sendredirect together with forward to reply this Servlet Interview question.
Question 5: How create take variable using <c:set> tag from JSTL ?
This is i of the tricky Servlet JSP question. Many people assumes that <c:set> tin alone add together or laid variables inwards a particular range only you lot tin likewise take whatever variable from whatever range using JSTL <c:set> tag. See How to utilisation <c:set> JSTL tag inwards JSP for exact agency to take whatever variable from whatever range inwards JSP page.
Question 6: What is departure betwixt Web Server together with Application Server ?
This is rather unproblematic Servlet JSP inquiry to answer. If you lot convey used EJB together with then you lot should know that , Web Server doesn't comprise EJB container together with EJB tin non survive deployed on that. Application Server is used to deploy together with run EJB inwards J2EE environment. See 5 departure betwixt Application together with Web Server to meet to a greater extent than differences.
Question 7: What is departure betwixt URL Encoding together with URL rewriting ?
URL Encoding together with URL rewriting is full general spider web concept irrespective of Java programming language. URL Encoding refers to encoding URL e.g. replacing infinite amongst %20, you lot tin meet this when browser sends asking to Server. On the other mitt URL Rewriting is agency to handle Session inwards spider web application. See URL Encoding vs URL Rewriting for to a greater extent than differences.
Question 8: How create you lot larn ServletContext reference within Servlet ?
ServletContext is real of import object inwards Java Web application. ServletContext object is i per spider web application together with serves every bit application range together with utilisation to shop mutual config together with things which doesn't alter on per session. Its slowly to larn reference of ServletContext inwards jsp using application implicit variable only inwards Servlet is non available inwards HttpServletRequest until version 3.0. You demand HttpSession object to remember ServletContext inwards whatever Servlet. Influenza A virus subtype H5N1 adept follow-up questions is How create you lot larn ServletContext inwards Struts Action shape or Spring Controller classes. See How to remember ServletContext inwards Servlet, Spring together with Struts for to a greater extent than details.
Question 9: What is departure betwixt ServletContext together with ServletConfig inwards Java ?
One of those classical Servlet Interview Questions which you lot can't afford to miss. Again ServletContext is used to supply application broad configure piece ServletConfig is used to configure together with supply initialization parameter to i Servlet. See ServletContext vs ServletConfig for to a greater extent than differences.
Question 10: Which opened upwards origin tag library convey you lot used ?
This is an interesting Servlet JSP questions together with gives an chance to exhibit how many tag library you lot are familiar amongst together with which ones convey you lot used. Most J2EE programmer reply this inquiry amongst maxim JSTL pith tag library, Struts tag library , Spring tag library or display tag, which is quite pop tag library to display tabular information together with provides lot of characteristic out of box e.g. paging, sorting together with export functionality.
Question 11: What is departure betwixt GET together with POST method inwards HTTP protocol?
Another classical spider web interview question, non specific to Servlet or JSP only real of import inwards context of spider web evolution which is based on HTTP protocol. There several differences betwixt GET together with POST method including length of information required to Send to Server. GET is less secure together with tin alone post express information thus non useful to transfer sensitive information. See GET vs POST HTTP method for to a greater extent than differences.
Question 12: What does load-on-start-up chemical element inwards web.xml do?
One of the tough Servlet JSP Interview inquiry peculiarly to 2 years sense guy, who may non survive exposed to all tags of web.xml. load-on-startup is related to loading of Servlet. See What is load-on-startup tag inwards web.xml for to a greater extent than details.
These were to a greater extent than or less Servlet together with JSP Interview questions together with reply you lot tin human face for quick revision purpose. If you lot convey faced whatever interesting Servlet JSP inquiry or if you lot are looking reply for whatever Servlet JSP inquiry than delight share.
Further Learning
Top 10 Spring MVC Interview question
No comments:
Post a Comment