1)what is Jsp?
JSP stands for Java Server Pages. It is a presentation layer technology independent of platform. They are like HTML pages but with Java code pieces embedded in them. They are saved with a .jsp extension. It is used for viewing the page to the user. Jsp is for an dynamic pages.
2)Explain Implicit objects in JSP?
objects are created from the web container. They are
1)response
2)exception
3)application
4)request
5)config
6)out
8)page
9)pagecontex
3) Differentiate between response.sendRedirect(url) and <jsp:forward page = …> .?
response.sendRedirect(url): It will create a new request for each and everytime. It based on the http address.
<jsp:forward page ="extension.jsp"> : It will forward the jsp page from one to the another, but it should be a same application context.
4)what are the java Lifecycle?
jspinit();
jspservice()
jspdestroy()
5)Which implicit object is not available in normal JSP pages?
JSP exception implicit object is not available in normal JSP pages and it's used in JSP error pages only to catch the exception thrown by the JSP pages and provide useful message to the client.
6)Why don't we need to configure JSP standard tags in web.xml?
We don't need to configure JSP standard tags in web.xml because the TLD files are inside the META-INF directory of the JSTL jar files. When container loads the web application and find TLD files inside the META-INF directory of JAR file, it automatically configures them to be used directly in the application JSP pages. All we need to do it to include it in the JSP page using taglib directive. taglib will take care of everything to configure and execute the jsp page. We need define the taglib in the jsp page itself.
7)what is Experience Language?
It simplifies the accessibility of the data stored in the java bean.
8)what are the scripting elements in java?
- Scriplet tag
- Expression tag
- Declaration tag
9)what is Scriplet Tag?
A Scriplet tag is used to execute java code.
<%java code%>
example:
<html>
<body>
<% out.println("Welcome to the jsp")%>
</body>
</html>
10)What is Expression Tag?
It is used to written the to the output stream of the response.
Syntax:
<%= statement %>
11)What is Declaration tag?
It is used to declare fields and methods
syntax:
<%! declare here %>
12)what is the purpose of using JSP page?
Jsp technology enables the web developers to add the java code and some predefined action into static content. Java server page get converted into java servlet by the JSP complier.
13)What are the advantages of jsp?
Jsp technology enables the web developers to add the java code and some predefined action into static content. Java server page get converted into java servlet by the JSP complier.
13)What are the advantages of jsp?
- JSP represents an HTML page embed with Java code.
- JSP is cross-platform technology.
- JSP can create database-driven Web applications.
- JSP enables Server-side programming abilities.
14)Which of the JSP life cycle methods you can override?
You can’t override the _jspService() Method within a JSP page. However, there are two approaches you can take to override the jspInit() and jspDestroy() methods within the JSP page.
jspInit() Can be quite useful for reserving resources like DB connections, N/W connections, and so forth for the JSP page.To free any allocated resources in the jspDestroy() method.
15)How many tags are exist in JSTL tags?
Comments
Post a Comment