Summary

 < Free Open Study > 



In this chapter, we discussed numerous aspects of resource handling and configuration for servlet applications, in relation to real-life application scenarios. We looked at:

  • Servlet initialization parameters and how they can be used to locate XML documents and directory entities

  • The use of XML files for servlet configuration

  • The use of XML and initialization parameters to implement a servlet that configures and registers a database connection factory at application startup

  • How to implement a generic servlet authentication framework that can be dynamically configured to work with different types of data stores, including LDAP and JDBC

  • How to persist servlet and session state, using relational databases and serialized Java objects

In the next chapter we will look at a new feature of the Servlet specification that allow us to add to the request and response processing within a web application - filters.

A

attributeAdded() method

  • persisting session state example, 44

authenticate() method

  • Authenticator interface, 21

  • JDBC, 26

Authentication application

  • configuring framework, 22

  • custom exceptions, 21

  • deploying, 24

  • illustrates Data Access Object pattern, 19

AuthenticationConfig class

  • Authentication application, 22

AuthenticationServlet implementing

  • Authentication application, 23

Authenticator interface

  • Authentication application, 21

B

binding

  • DataSource objects, 11

C

classes

  • DataSourceConfig class, 13

  • LdapAuthenticator class, 33

  • LdapConfig class, 31

Config class

  • implementing, 6

configuring framework

  • Authentication application, 22

Context> element

  • Tomcat, server.xml deployment descriptor, 10

contextInitialized() method

  • ServletContextListener interface, 17

context-param> element

  • setting context-wide parameters, 4

context-wide parameters

  • servlet initialization, 4

custom exceptions

  • Authentication application, 21

D

Data Access Object pattern, 19

  • Authentication application illustrates, 19

  • web site, 19

data binding

  • DataSource objects, 11

data servlet framework example

  • deploying, 39

  • persisting servlet state, 36

  • testing, 39

data source binding, 11

  • built-in, 12

  • built-in, using, 12

  • custom, 12

  • custom, using, 13

database connectivity

  • standard method, 11

DatabaseAuthenticator

  • using, 28

DatabaseAuthenticator class

  • JDBC implementing, 26

DatabaseName> element

  • DataSourceConfig class, 14

DatabasePassword> element

  • DataSourceConfig class, 14

databases

  • JDBC, accessing with, 2

  • servlets working with persistent data, 2

DatabaseUser> element

  • DataSourceConfig class, 14

DataSource objects

  • binding, 11

DataSource> element

  • DataSourceConfig class, 14

DataSourceConfig class

  • custom data source binding, 13

  • generic solution, 17

  • implementing, 13

  • Oracle implementation using, 15

  • SQL implementation using, 16

  • standard elements, 13

DataSourceListener

  • deploying the application, 18

DataSourceListener class

  • binding Datasource object, 17

DataSourceListener context listener

  • custom data source binding, 13

DefaultContext> element

  • Tomcat, server.xml deployment descriptor, 10

destroy() method

  • data servlet framework example, 39

  • servlet persistence, 35

directory services, 2

  • difference to SQL, 2

  • LDAP (Lightweight Directory Access Protocol), 3

E

elements

  • Context> element, 10

  • context-param> element, 4

  • DatabaseName> element, 14

  • DatabasePassword> element, 14

  • DatabaseUser> element, 14

  • DataSource> element, 14

  • DefaultContext> element, 10

  • env-entry> element, 9

  • init-param> element, 5

  • param-value> element, 39

  • resource-env-ref> element, 9

  • ResourceParams> element, 10

  • resource-ref> element, 9, 10, 12

  • res-ref-name> element, 11

  • ServerName> element, 14

  • ServerPort> element, 14

  • session-timeout> element, 47

env-entry> element

  • JNDI initial context elements, 9

externalization

  • persisting servlet state, 36

F

forName() method, Class

  • database connectivity, 11

G

getElementText() method

  • implementing Config class, 7

getInitParameter() method, ServletContext

  • context-wide parameters, 4

  • servlet-specific parameters, 5

getInitParameterNames() method, ServletContext

  • context-wide parameters, 4

  • servlet-specific parameters, 5

getResourceAsStream() method

  • implementing Config class, 7

Group class

  • Authentication application, 20

H

HttpSession object

  • persisting session state, 40

HttpSessionAttributeListener

  • persisting session state example, 43

HttpSessionListener

  • persisting session state example, 43

HttpSessionListener interface

  • persisting session state, 40

I

init() method

  • DataSourceConfig class, 15

  • implementing Config class, 7

initialization parameters

  • servlet initialization, 4

init-param> element

  • setting servlet-specific parameters, 5

J

J2EE specification

  • standard resource factories, 10

JDBC (Java DataBase Connectivity)

  • accessing relational databases, 2

  • accessing resources, 25

  • authenticate() method, 26

  • creating database, 25

  • DatabaseAuthenticator class, implementing, 26

  • web site, 2

JNDI (Java Naming and Directory Interface)

  • directory service, 3

  • inherent JNDI support, 8

  • initial context elements, 8

  • resource binding, 8

JNDI namespace, 9

JSP (JavaServer Pages)

  • DatabaseAuthenticator, 28

L

LDAP (Lightweight Directory Access Protocol)

  • accessing resources, 31

  • directory service, 3

  • service provider extension, web site, 31

LdapAuthenticator class

  • implementing, 33

LdapConfig class

  • implementing, 31

M

methods

  • attributeAdded() method, 44

  • getElementText() method, 7

  • getInitParameter() method, ServletContext, 4, 5

  • getInitParameterNames() method, ServletContext, 4, 5

  • getResourceAsStream() method, 7

  • init() method, 7, 15

MySQL

  • download web site, 2

MySQL JDBC driver

  • download web site, 16

N

naming services, 2

O

Oracle implementation

  • DataSourceConfig class, using, 15

Oracle JDBC drivers

  • web site, 15

P

param-value> element

  • data servlet framework example, 39

persistent resources

  • accessing, 19

persisting session state example, 40

  • creating database, 41

  • deploying, 46

  • implementing Request filter, 42

  • implementing Requester class, 41

  • implementing Session listener, 43

R

readResource() method

  • data servlet framework example, 36, 37

readSerialize() method

  • data servlet framework example, 36

readSerialized() method

  • data servlet framework example, 38

references to web sites

  • Data Access Object pattern, 19

  • JDBC (Java DataBase Connectivity), 2

  • LDAP service provider extension, web site, 31

  • MySQL download, 2

  • MySQL JDBC driver, 16

  • Oracle JDBC drivers, 15

  • resource configuration with Tomcat, 11

  • Tyrex implementation, 12

relational databases see databases.

Request filter

  • persisting session state example, 42

Requester class

  • persisting session state example, 41

resource binding

  • JNDI, 8

  • standard, 10

resource-env-ref> element

  • JNDI initial context elements, 9

ResourceParams> element

  • Tomcat, server.xml deployment descriptor, 10

resource-ref> element

  • built-in data source binding, 12

  • configuring standard resource factory, 10

  • JNDI initial context elements, 9

res-ref-name> element

  • resource use, 11

S

Serializable interface, java.io

  • persisting servlet state, 36

ServerName> element

  • DataSourceConfig class, 14

ServerPort> element

  • DataSourceConfig class, 14

servlet initialization parameters, 4

  • context-wide, 4

  • custom XML file or, 6

  • purpose of, 6

  • servlet-specific, 5

  • using, 5

servlet persistence, 35

  • data servlet framework example, 36

  • persisting servlet state, 36

servlet XML configuration, 6

  • implementing Config class, 6

ServletContextListener

  • persisting session state example, 43

ServletContextListener interface

  • contextInitialized() method, 17

  • DataSourceListener class implements, 17

servlets

  • persistent data, working with, 1

servlet-specific parameters

  • servlet initialization, 5

Session listener

  • persisting session state example, 43

session state

  • persisting, 40

session-timeout> element

  • persisting session state example, 47

SQL implementation

  • DataSourceConfig class, using, 16

standard resource factories

  • J2EE specification, 10

T

Tomcat

  • resource configuration, web sites, 11

Tyrex implementation, web site, 12

U

User class

  • Authentication application, 20

W

writeSerialized() method

  • data servlet framework example, 37

X

XML (eXtensible Markup Language), 3

  • custom XML file or servlet initialization parameters, 6



 < Free Open Study > 



Professional Java Servlets 2.3
Professional Java Servlets 2.3
ISBN: 186100561X
EAN: 2147483647
Year: 2006
Pages: 130

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net