Jsp

Index

*Jsp Class Hierarchy

JspClassHierarchy

*Jsp Life Cycle

Jsp page transalation => Jsp page compilation => loading => instantiation => call jspInit() method => call jspService() method => call jspDestroy() method.

*<%@ page          %>  => Directive

<%=                      %>    => Expression

<%!                      %>     => Declaration

<%                       %>      =>Scriplets

*Jsp page consists of => template text, scripting elements(comments, expressions, declarations, directives, scriplets), standard & custom actions, expression language elements.

*Template text, expressions & scriplets are all translated.

*Jsp Implicit Objects.

  1. Request
  2. Response
  3. Out
  4. Session
  5. Config
  6. Application
  7. PageContext
  8. Context
  9. Exception

*Jsp Scopes

  1. Request
  2. Application
  3. Page
  4. Session

Index

Servlet

Index
* “load-on-startup” tag is called in init() method.

*”filter-mapping” tag =>This will be applied to the particular “servlet-name” tag that we specify. If we want to apply this filter to all the servlets within the context then we have to use “url-pattern” tag instead of “servlet-name” tag.

*javax.Servlet.Servlet contains the following

Servlet, ServletConfig, ServletContext, ServletRequest, ServletResponse, SingleThreadModel, GenericServlet, ServletInputStream, ServletOutputStream, ServletException, UnavailableException. etc.,

*Javax.Servlet.Servlet.Http contains the following

HttpSevletRequest, HttpServletResponse, HttpSession, HttpSessionContext, HttpSessionBindingListener, Cookies, HttpServlet, HttpSessionBindingEvent, HttpUtils. etc.,

*Http 1.0 Methods=>Get, Head, Post

*Http 1.1 Methods=>Get, Head, Post, Put, Options, Trace, Delete, Connect

*Default mime type for put request is =>application/x-www-form-urlencoded

*GenericServlet class is an abstract class.

* Instance pooling & Request Serialization is used for thread safe Servlets

*HttpServlet class extends the GenericServlet & implements Serializable interface

*Servlet Container calls the public Service() method. The public Service() method calls the protected service() method after casting all the arguments to the HttpServletReqeust & HttpServletResponse. The protected Service() method calls one of the doXXX() methods depending upon the http request method.

*HttpServletClass provides the implementations for doTrace() & doOptions() methods.

*getLastModified(HttpServletRequest) implements the conditional get operation.

* 4 approaches to session tracking.

  1. Url writing
  2. Hidden form fields
  3. Cookies
  4. sessions using SSL

*SessionListener should be mentioned in DD(deployment descriptor).

*HttpSessionActivateListener =>Used for notification of the session activation & passivation

*HttpSessionBindingListener=>Used to notify object when it’s placed in the session & removed from the session.

*HttpSessionListener =>Used to notify object when the state of the session changes.

*ServletContext is the servlet view of the web application.

*You can use the RequestDispatcher to delegate request/response process to the other resources with the web application.

*RequestDispatcher interface encapsulate a reference to the other web resource at a specified path within the context of the web application.

*Web Authentication types

  1. Http digest Authentication
  2. Http basic Authentication
  3. Http client Authentication
  4. From based Authentication

*Calling the Servlet

URL=>HttpServletRequest=>Sent to Appropriate Server=>Maps the request to the specific resource in the application=>server is dynamically loaded in the server space=>server invoked init()=>service()=>destroy()

*Servlet relations in one image.ServlesInOneImage

*Servlet Life(in Sequence)

ServletLifeSequence
Index

XML

Index
*XML Schema element content types

  1. Element content
  2. Simple content
  3. Mixed content

*Attributes can’t contain multiple values. Attributes cant be expandable. Attributes can’t describe the structure.

*DTD=Document Type Definition.=>which is used to define the legal elements in the document.

*MetaData =>Data about the data should be stored in attributes. The data itself is stored in element.

*Parsers(ParserFactories) =>Javax.xml.Parsers

  1. SaxParserFactory
  2. DocumentBuilderFactory
  3. TransformerFactory

SAX
Index

JDBC

Java 2-Part 6   Index   Java-Part 7
*4 Types of JDBC Drivers.

  1. JDBC-ODBC Bridge Driver                      -Type 1
  2. Native Api, Partly Java Driver               -Type 2
  3. JDBC-Net, Pure Java Driver                    -Type 3
  4. Native Protocol, Purge Java Driver      -Type 4

*Type 1JDBCTYPE1

*Type 2JDBCTYPE2

Type 3JDBCTYPE3

Type 4

JDBCTYPE2

*java.sql  =>is having only one class remaining all are interfaces.

class= DriverManager

interfaces = Connection, Statement, PreparedStatement, CallableStatement, ResultSet, ResultSetMetaData, DatabaseMetaData.
Java 2-Part 6   Index   Java-Part 7