Lecture 1B Flashcards
What is a Java EE server?
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.
API?
Application Programming Interface. Allow you to use Java EE technology, ie servlets used through the Servlet API.
What are some implementations of JavaEE?
Glassfish, Apache Geronimo, JBoss/Wildfly (RedHat). These also called Java Enterprise Servers, or Application Servers.
Name the three containers of Java EE:
EJB container, Web container (servlets, JSP), client containers. Apache tomcat example of web container.
XML?
Extensible markup language. Standard configuration language. JSON and HTML types of XML. Also used for data transfer.
XML features:
One root element, closing end-tags, Attributes, nested, use html comments, special characters must be escaped (&apos "), , well-formed XML observes these constraints,
How is XML stored?
As a file (.xml) or in memory.
What is a DTD?
Documents Type Definition. Defines what is allowed in an XML. A schema contains rules for elements and attributes.
What is purpose of servlet?
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.
Features of servlet:
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 to program a servlet?
A servlet is a Java object whose class implements the Servlet interface (part of JavaEE). Most implement by extending HttpServlet.
What are http servlets?
They use the http protocol, support both GET and POST methods. Subclass of HTTPServlet needs to override the doPost() and doGet() method.
Servlet life cycle:
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.
What do the doGet/doPost methods of HttpServlet class provide?
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 to retrieve data from the HttpSevletRequest object?
Public String getParameter (String name)