Shared Flashcard Set

Details

JSP/Servlet Qs
n/a
35
Computer Science
Graduate
04/29/2013

Additional Computer Science Flashcards

 


 

Cards

Term

What is <% ... %>, and what code can be put into it?

Definition

It is a Scriplet, and any java code can be put into it.

Term

What is <%! ... %>, and what does it do?

Definition

It is a Declaration, and it creates an instance or static variables.

Term

What is <%-- ... --%>, and what code can be put into it?

Definition

It is a Comment for the server-side jsp.

Term

What is <%= ... %>, and what code can be put into it?

Definition

It is a Expression, and prints the statement to the screen.

Term

What is <%@ ... %>, and what does it do?

Definition

It is a Directive, and it retrieves page specific information (page, include, and taglib).

Term

What are Servlets?

Definition

Servlets are java classes/programs that reside on the server side and extend HTTPServlet.

Term

What are the rules of a Servlet.

Definition

Extend HTTPServlet and override doGet & doPost.

Term

What are the four major categories of markup tags?

Definition

Directives, Scripting, Comments, and Actions.

Term

Define Scripting elements, and how many Scripting elements does JSP provide?

Definition

Scripting elements are used to embed programming instructions. There are three, Declartions, Scriplets, and Expressions.

Term

What are the nine implicit objects in JSP

Hint: SEACRROPP

Definition

Session, Exception, Application, Config, Request, Response, Out, Page, PageContext

Term

What is the Generic Servlet?

Definition

An abstract class that implements the Servlet interface, and provides implementation for all methods except the service() method.

Javax.servlet.GenericServlet

Term

What is the HTTPServlet?

Definition

A HTTP capable servlet and is an abstract class that extends GenericServlet. It also provides support for the HTTP protocol.

Javax.servlet.http.HTTPServlet.

 

Term

What does the Scripting element Declaration do?

Definition

It allows the developer to define variables and methods for a page.

<%! … %> or <jsp:declaration>

Term

What does the Scripting element Scriptlets do?

Definition

They are blocks of code to be executed each time the JSP page is processed for a request. <% …. %>

Term

Which objects are related to a JSP Page's Servlet?

Definition

Page: the page's servlet instance.

Config: servlet configuration data.

Term

Which objects deal with page input and output?

Definition

Request: request data including parameters.

Response: response data.

Out: output stream for page content.

Term

Which objects provide information about context within a JSP page while it's being processed.

Definition

Session: user specific session data.

Application: data shared by all application pages.

PageContext: context data for page execution.

Term

Which objects result from errors?

Definition

Exception: uncaught error exception.

 

Term

Define Standard Action tag.

Definition

A standard action is a action that has been defined in the JSP Standard. Standard actions are associated with the namespace jsp and appear with a prefix jsp.

Term
Define the page object.
Definition
Page's Servlet instance (represents the Servlet itself).
Term
Define the config object
Definition
Servlet configuration data.
Term
Define the request object.
Definition
Requests data including  parameters.
Term
Define the out object.
Definition
Output stream for page content.
Term
Define the session object.
Definition
User specific session data.
Term
Define the application object.
Definition
Data shared by all application pages.
Term
Define the pageContext object.
Definition
Context data for page execution.
Term
What implicit objects are available during the Application scope?
Definition
Application.
Term
What implicit objects are available to the Session scope?
Definition
Session.
Term
What implicit objects are available to the Request scope?
Definition
Request and Response.
Term
What implicit objects are available to the Page scope?(Hint: 5)
Definition
Exception, Config, Out, Page, and PageContext.
Term
Define the Application scope.
Definition
Data that is available throughout the application.
Term
Define the Request scope.
Definition
Data that is available from one page to another, as long as it's forwarded.
Term
Define the Session scope.
Definition
Data that is time-limit defined and user-specific.
Term
Define the Page scope.
Definition
Data that is only available on that page.
Term

Explain the JSP Life Cycle.

(Translation, Compilation, Load, Instaniate,

Init(), Service(), Destroy() )

Definition

    1. Translation - a java servlet file is made from the JSP source file.
    2. Compilation - the jave servlet file is compiled into a java servlet   class.
    3. Loading - the java servlet class is loaded into a JSP container.
    4. Intialize - the container manages one or more instances of the class in response to requests and other events.
    5. init() - the jsp_init() method is called immediately after the instance was created (called only once during cycle).
    6. service() - method is called for every request of this JSP during its life cycle.
    7. destroy() - method is called when this JSP is destroyed.

Supporting users have an ad free experience!