Total Pageviews

Thursday, May 29, 2014

J2EE - JSP - Interview Questions


J2EE - JSP - Interview Questions


What is a JSP and what is it used for?
Java Server Pages (JSP) is a platform independent presentation layer technology that comes with SUN s J2EE platform. JSPs are normal HTML pages with Java code pieces embedded in them. JSP pages are saved to *.jsp files. A JSP compiler is used in the background to generate a Servlet from the JSP page.
What is difference between custom JSP tags and beans?
Custom JSP tag is a tag you defined. You define how a tag, its attributes and its body are interpreted, and then group your tags into collections called tag libraries that can be used in any number of JSP files. To use custom JSP tags, you need to define three separate components:
1. the tag handler class that defines the tag\'s behavior
2. the tag library descriptor file that maps the XML element names to the tag implementations
3. the JSP file that uses the tag library
When the first two components are done, you can use the tag by using taglib directive:
<%@ taglib uri="xxx.tld" prefix="..." %>
Then you are ready to use the tags you defined. Let's say the tag prefix is test:
MyJSPTag or
JavaBeans are Java utility classes you defined. Beans have a standard format for Java classes. You use tags to declare a bean and use to set value of the bean class and use to get value of the bean class.

<%=identifier.getclassField() %>
Custom tags and beans accomplish the same goals -- encapsulating complex behavior into simple and accessible forms. There are several differences:
Custom tags can manipulate JSP content; beans cannot.
Complex operations can be reduced to a significantly simpler form with custom tags than with beans. Custom tags require quite a bit more work to set up than do beans.
Custom tags usually define relatively self-contained behavior, whereas beans are often defined in one servlet and used in a different servlet or JSP page.
Custom tags are available only in JSP 1.1 and later, but beans can be used in all JSP 1.x versions.
What are the two kinds of comments in JSP and what's the difference between them ?
<%-- JSP Comment --%>
<!-- HTML Comment -->
What is JSP technology?
Java Server Page is a standard Java extension that is defined on top of the servlet Extensions. The goal of JSP is the simplified creation and management of dynamic Web pages. JSPs are secure, platform-independent, and best of all, make use of Java as a server-side scripting language.
What is JSP page?
A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format such as HTML, SVG, WML, and XML, and JSP elements, which construct dynamic content.


For further details of JAVA Training / OCJP Certification contact:

Placement opportunities are given for successful student who passes OCJP Certification in JAVA Software Development in Software companies

SUGA JAVA Training Institute,
SUGA Employment Services (providing placement opportunities for those who finish OCJP Certification through our JAVA Training)
(A division of SUGA Consulting Services)
Office No.26, TNHB Complex,
180, Luz Church Road, Mylapore, Chennai - 600004

N.Sugavanam, M.A., F.I.I.I, MBA,  
CEO, SUGA Consulting Services

Phone: Vodafone: 91762-44989, Landline: 044-2498-4149

Landmark: Near Luz Signal, Luz Pillaiyar Koil, behind 'MAX' Show Room

No comments:

Post a Comment