Lecture 1B Flashcards

1
Q

What is a Java EE server?

A

A Java program, a web server extended with Java EE functionality. (JBoss). Code on business and web tier rub on Java EE server. Client and data tier don’t.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

API?

A

Application Programming Interface. Allow you to use Java EE technology, ie servlets used through the Servlet API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some implementations of JavaEE?

A

Glassfish, Apache Geronimo, JBoss/Wildfly (RedHat). These also called Java Enterprise Servers, or Application Servers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Name the three containers of Java EE:

A

EJB container, Web container (servlets, JSP), client containers. Apache tomcat example of web container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

XML?

A

Extensible markup language. Standard configuration language. JSON and HTML types of XML. Also used for data transfer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

XML features:

A

One root element, closing end-tags, Attributes, nested, use html comments, special characters must be escaped (&apos &quot), , well-formed XML observes these constraints,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How is XML stored?

A

As a file (.xml) or in memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a DTD?

A

Documents Type Definition. Defines what is allowed in an XML. A schema contains rules for elements and attributes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is purpose of servlet?

A

To provide content for the client (web browser). Java code server side creates html code for client side. Also processes data retrieved from client side.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Features of servlet:

A

Can handle multiple requests on currently, can synchronize requests (ie online conferencing), forward requests (balance work load - load balancing), JSP based on servlets. Only web container Tomcat is needed, ie not entire Java EE server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to program a servlet?

A

A servlet is a Java object whose class implements the Servlet interface (part of JavaEE). Most implement by extending HttpServlet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are http servlets?

A

They use the http protocol, support both GET and POST methods. Subclass of HTTPServlet needs to override the doPost() and doGet() method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Servlet life cycle:

A

Client calls servlet by URL, JavaEE loads and invokes servlet, servlet processes client data using doGet() or doPost(), servlet returns HTML page which is passed to client via web server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What do the doGet/doPost methods of HttpServlet class provide?

A

A HttpServletRequest object which encapsulates data from client form. And a HttpServletResponse object (a stream) which is used to send the servlets response back to the client.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to retrieve data from the HttpSevletRequest object?

A

Public String getParameter (String name)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to write HTML code using HttpServletResponse object

A

GetWriter or getOutputStream methods. Usually: PrintWriter out = response.getWriter();
out.println(“”);