|
1
|
|
|
2
|
|
|
3
|
- Extends Servlet-Controller in a function-specific Action
- Uses struts-config.xml file to define all function-actions
- Collects the data from the web forms into specific ActionForm classes
that keep data state between requests
- Maps each Action to its ActionForm in the struts-config.xml
- Introduces a powerful set of tag libraries
- And more…
|
|
4
|
|
|
5
|
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
|
|
10
|
|
|
11
|
|
|
12
|
|
|
13
|
|
|
14
|
|
|
15
|
|
|
16
|
|
|
17
|
|
|
18
|
|
|
19
|
- Extends Servlet-Controller ….
- Uses struts-config.xml file to ….
- Collects the data from the web forms into …
- Maps each Action to its … in the …
- Introduces a powerful set of …
|
|
20
|
- Extends Servlet-Controller in a function-specific Action
- Uses struts-config.xml file to define all function-actions
- Collects the data from the web forms into specific ActionForm classes
that keep data state between requests
- Maps each Action to its ActionForm in the struts-config.xml
- Introduces a powerful set of tag libraries
- And more…
|
|
21
|
|
|
22
|
|
|
23
|
|
|
24
|
|
|
25
|
- Uses OO query language called HQL
- Uses objects instead of tables and fields instead of columns
- Provides object-to-relational mapping for most DBs
- Separates data layer from business logics
- Uses DB connection info to retrieve DB schema
- Generates DAO beans with data fields mapping table columns
- Generates Insert/Update/Delete/Select statements for DB tables
|
|
26
|
|
|
27
|
|
|
28
|
|
|
29
|
|
|
30
|
|
|
31
|
|
|
32
|
|
|
33
|
|
|
34
|
|
|
35
|
|
|
36
|
|
|
37
|
|
|
38
|
|
|
39
|
|
|
40
|
|
|
41
|
|
|
42
|
|
|
43
|
- Include the library “com.its.util.jar” in the CLASSPATH and import
com.its.util.DataService
- // execute insert/delete/update SQL statements stored in the
“sqlLocation”
- @ param sqlStatementName for example “getLogin” stored as the
“getLogin.sql”
- @ param map of key-values to replace SQL <<keys>> with
run-time values
- @ return numberOfRowsEffected
- public static int setData(String sqlStatementName, HashMap map)
- // use other than “DataSource” connection pool
- public static int setData(String sqlStatementName, HashMap map, String
dsName)
- // execute select statement and return a list of record-beans
- @ param sqlStatementName for example “getLogin” stored as the
“getLogin.sql”
- @ param map of key-values to replace SQL <<keys>> with
run-time values
- @ param beanClass (e.g. LoginBean.class) supports records retrieved by
the SQL statement
- @ return list of objects of the beanClass
- public static List getData(String sqlStatementName, HashMap map, Class
beanClass)
- // use other than “DataSource” connection pool
- public static List getData(String sqlName, HashMap map, Class beanClass,
String dsName)
- @param dataSource your DataSource specified in JNDI context
- @param dataSourceName of your DataSource specified as JNDI name
- public static void setDataSource(DataSource dataSource, String dsName)
- public static void setDataSource(DataSource dataSource)
|
|
44
|
|
|
45
|
|
|
46
|
|
|
47
|
|
|
48
|
|
|
49
|
|
|
50
|
- 1. Struts
- 2 Spring
- 3 Hibernate
- 4 DataService
|