J2EEOnlineJ2EE





JSP FAQ  «Prev  Next»

JSP Questions

  1. What is JSP technology?
    Answer: 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.
  2. What is a JSP page?
    Answer: 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.
  3. What are the implicit objects?
    Answer: Implicit objects are objects that are created by the web container and contain information related to a particular request, page, or application. They are:
    1. request
    2. response
    3. pageContext
    4. session
    5. application
    6. out
    7. config
    8. page
    9. exception
  4. How many JSP scripting elements and what are they?
    Answer: There are three scripting language elements:
    1. declarations
    2. scriptlets
    3. expressions
  5. Why are JSP pages the preferred API for creating a web-based client program?
    Answer: Because no plug-ins or security policy files are needed on the client systems(applet does). Also, JSP pages enable cleaner and more module application design because they provide a way to separate applications programming from web page design. This means personnel involved in web page design do not need to understand Java programming language syntax to do their jobs.
  6. Is JSP technology extensible?
    YES. JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries.
  7. What are the two kinds of comments in JSP and what's the difference between them?
    Answer:

    <%-- JSP Comment --%>
    <! HTML Comment -->

  8. In the Servlet 2.4 specification SingleThreadModel has been deprecates, why?
    Answer: Because it is not practical to have such model. Whether you set isThreadSafe to true or false, you should take care of concurrent client requests to the JSP page by synchronizing access to any shared objects defined at the page level.

  9. What is difference between custom JSP tags and beans?
    Answer: 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