Que1: What is JSP?
Que2: Define JSP Life Cycle?
The JSP page follows these phases.
Que3: Which method we can override in JSP Life Cycle?
Que5: Difference between Include directive and Include Action in JSP?
Que6: What is the different scope available in JSP?
There are 4 scope available in JSP
Que7: Difference between pageContext include and jsp:include?
Que8: Write the syntax of forward in JSP?
The <jsp:forward> action forwards a response from servlet or JSP page to another page
Syntax:
<jsp:forward page="/target_page"/>
target_page may be jsp, html or servlet
Que9: Write the syntax of include in JSP?
Syntax:
<jsp:include page="target_page" flush="true"/>
Que10: What are the standard actions available in JSP?
The standard actions available in JSP are,
<jsp:include>
<jsp:forward>
<jsp:usebean?
<jsp:setProperty>
<jsp:getProperty>
<jsp:param>
<jsp:plugin>
Que11: What are the different types of tags in JSP?
There are 4 types of tags in JSP
Note: If you like this post then share it or have any question then just drop a comment.
- JSP is an abbreviation of Java Server Pages
- It is use to create dynamic web application.
- JSP is an extension of servlet because all the features of servlet are available in JSP, In addition to this, it also have some additional features like expression language, predefined tags, implicit objects, custom tags etc.
- It is mainly use for presentation logic but we can also use it for presentation and business logic.
- It is easy to maintain because we can easily separate our business logic and presentation logic.
- Fast development: if JSP page is modified, we don't need to redeploy the project the servlet code needs to be updated and recompiled if we have to change the look and feel of the application.
Que2: Define JSP Life Cycle?
The JSP page follows these phases.
- Translation of JSP page
- Page Compilation: Page is compiled into a class file.
- Page Loading: This class file is loaded
- Create an Instance: Instance of servlet is created.
- jspInit() Method is called only once when a jsp page is initialize.
- _jspService is called to handle service class.
- _jspDestroy is called to destroy it when the servlet is not required.
Que3: Which method we can override in JSP Life Cycle?
We can override jspInit() and jspDestroy method but we can not override jspService method. jspInit can be use for allocating resources like database connections, network connections etc. jspDestroy is use to free any allocated resources.
Other Related Post
Que4: What are Implicit objects in JSP? How many Implicit objects are there write there names?
Implicit objects in JSP are the Java objects that the JSP container makes available to developers in each page.
There are 9 implicit objects are there,- Request
- Response
- pageContext
- Session
- Application
- out
- config
- page
- exception
Que5: Difference between Include directive and Include Action in JSP?
- Include directive, includes the content of the specified file during the translation phase when the page is converted to a servlet. Include action, includes the response generated by executing the specified page (a JSP or a Servlet) during the request processing phase when the page is requested by a user.
- Include directive is used to statically insert the contents of a resource into the current JSP. Include action enables the current JSP page to include a static or a dynamic resource at runtime.
Que6: What is the different scope available in JSP?
There are 4 scope available in JSP
- Page: within the same page
- Request: After forward or include also you will get the request scope data.
- Session: After sendRedirect also you will get the session scope data. All data stored in session is available to end user till session closed or browser closed.
- Application: Data will be available throughout the application.
Que7: Difference between pageContext include and jsp:include?
Both are used to include resources at runtime however the pageContext.include() method always flushes the output of the current page before including the other components where as <jsp:include> flushes the output of the current page only if the value of flush is explicitly set to true.
Que8: Write the syntax of forward in JSP?
The <jsp:forward> action forwards a response from servlet or JSP page to another page
Syntax:
<jsp:forward page="/target_page"/>
target_page may be jsp, html or servlet
Que9: Write the syntax of include in JSP?
Syntax:
<jsp:include page="target_page" flush="true"/>
Que10: What are the standard actions available in JSP?
The standard actions available in JSP are,
<jsp:include>
<jsp:forward>
<jsp:usebean?
<jsp:setProperty>
<jsp:getProperty>
<jsp:param>
<jsp:plugin>
Que11: What are the different types of tags in JSP?
There are 4 types of tags in JSP
- Directive tag <%@ />
- Expression tag <%= %>
- Declaration tag <%! %>
- Scriptlet <% %>
Note: If you like this post then share it or have any question then just drop a comment.
13 Comments
The JSP interview question shared is really interesting and informative moreover it give idea for us for answering the question my sincere thanks for sharing these information
ReplyDeleteJava Training in Chennai
Very impressive and attractive one.. it is very useful for me to learn and understand, thanks for sharing your valuable information and time.. keep rocks and updating...
ReplyDeleteJava Training in chennai | Java Training institutes in chennai
Good one, very informative.. thanks for sharing your views and ideas.. it is very useful to me..CCNA Training Institute in Chennai | CCNA Training Institute in Velachery.
ReplyDeleteGood Post..Really it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing. MCSE Training in Chennai | Hardware and Networking Training in Chennai
ReplyDeleteThis blog is really useful and it is very interesting thanks for sharing, it is really good and exclusive. Digital Marketing Summer Camp in Velachery | Digital Marketing Summer Classes in Chennai | Digital Marketing Summer courses in Taramani
ReplyDeleteVery Useful information that i have found. don't stop and Please keep updating us..... Thanks
ReplyDeleteSummer Courses in Adyar | Summer Courses in OMR | Summer Courses in Velachery
All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information... Great work
ReplyDeleteGood Summer Courses for Photoshop in Guindy | No.1 Vacation Classes in Chennai
I really love reading and following your post as I find them extremely informative and interesting. This post is equally informative as well as interesting Summer Courses for Android in Perungudi | Summer Courses for IOS in Velachery | Summer Courses in OMR
ReplyDeleteGood Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
ReplyDeleteSummer Camp for Kids in Chennai | Summer courses in Shozhinganallur | Summer classes in Chennai
ReplyDeleteGood Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
Summer Courses for Android in Perungudi | Summer Courses for IOS in Velachery | Summer Courses in OMR
Thank you for sharing this information and Very good looking blog. Good AWS Certification Center in Chennai | AWS Certification Exam in Velachery
ReplyDeleteHi Thanks for the nice information its very useful to read your blog.
ReplyDeleteAdvanced SEO Training
I am really interested to continue reading your blog. You have shared valid info. Waiting for more updates from you.
ReplyDeleteEnglish Speaking Classes in Mumbai
English Speaking Course in Mumbai
Best English Speaking Classes in Mumbai
Spoken English Classes in Mumbai
English Classes in Mumbai