JSP Interview : JSP Interview Questions -2

Page of the JSP Interview Questions.
Question: What is JSP Custom tags?
Answer: JSP Custom tags are user defined JSP language element. JSP
custom tags are user defined tags that can encapsulate common functionality.
For example you can write your own tag to access the database and performing
database operations. You can also write custom tag for encapsulate
both simple and complex behaviors in an easy to use syntax and greatly
simplify the readability of JSP pages.
Question: What is JSP?
Answer: JavaServer Pages (JSP) technology is the Java platform
technology for delivering dynamic content to web clients in a portable,
secure and well-defined way. The JavaServer Pages specification extends the
Java Servlet API to provide web application developers
Question: What is the role of JSP in MVC Model?
Answer: JSP is mostly used to develop the user interface, It plays are
role of View in the MVC Model.
Question: What do you understand by context
initialization parameters?
Answer: The context-param element contains the declaration of a web application's servlet context initialization parameters.
<context-param>
<param-name>name</param-name>
<param-value>value</param-value>
</context-param>
The Context Parameters page lets you manage parameters that are accessed through the ServletContext.getInitParameterNames and ServletContext.getInitParameter methods.
Question: Can you extend JSP technology?
Answer: JSP technology lets the programmer to extend the jsp to make the
programming more easier. JSP can be extended and custom actions and tag
libraries can be developed.
Question: What do you understand by JSP
translation?
Answer: JSP translators generate standard Java code for a JSP page implementation class. This class is essentially a servlet class wrapped with features for JSP functionality.
Question: What you can stop the browser to cash
your page?
Answer: Instead of deleting a cache, you can force the browser not to catch the page.
<%
response.setHeader("pragma","no-cache");//HTTP 1.1
response.setHeader("Cache-Control","no-cache");
response.setHeader("Cache-Control","no-store");
response.addDateHeader("Expires", -1);
response.setDateHeader("max-age", 0);
//response.setIntHeader ("Expires", -1); //prevents caching at the proxy server
response.addHeader("cache-Control", "private");
%>
put the above code in your page.
Question: What you will handle the runtime
exception in your jsp page?
Answer: The errorPage attribute of the page directive can be used
to catch run-time exceptions automatically and then forwarded to an error processing page.
For example:
<%@ page errorPage="customerror.jsp" %>
above code forwards the request to "customerror.jsp" page if an uncaught exception is encountered during request processing. Within
"customerror.jsp", you must indicate that it is an error-processing page, via the directive: <%@ page
isErrorPage="true" %>.

|
Current Comments
10 comments so far (post your own) View All Comments Latest 10 Comments:Need FAQs On J2ee & Java
Posted by Eswar on Friday, 06.15.07 @ 10:30am | #19286
It is a good page for the people who attend the interview.
Posted by suku on Wednesday, 05.16.07 @ 11:20am | #16107
This site is Very hepful to job seekers.Thanq.
Posted by prasanthi on Wednesday, 04.18.07 @ 18:10pm | #14504
it's a very good and is there a any facility to insert new interview question on your page. then it is very nice to us.
Posted by Mrityunjay Gupta on Tuesday, 03.27.07 @ 01:07am | #12752
really,
these are marvellous.
rajesh
Posted by Rajesh on Saturday, 02.10.07 @ 00:01am | #7040
So jsp is in java can we create the object by saying
jspobj abc= new jspobj();
if yes then how?
if no then why?
Posted by Sanat Biswal on Friday, 02.2.07 @ 12:54pm | #5399
if u need FAQs on j2ee & java, send a mail 2 me, i will suggest one site which dedicated 4 j2ee & java FAQs..nearly 200pages of java & j2ee faqs it contain..my mail id is visu_itsme@yahoo.co.in..bi friends
Posted by vissu on Saturday, 12.23.06 @ 01:23am | #1476
nice cllection/
Posted by laxmi on Friday, 12.8.06 @ 04:08am | #612
Thanks, its a good question with a good explanation
Posted by Harshali on Thursday, 12.7.06 @ 00:53am | #540
thanks its a nice page
Posted by anurag on Friday, 11.24.06 @ 02:19am | #65