Notes
Slide Show
Outline
1
Creating Web Application
with BEA WebLogic Workshop 8.1
2
e-Business      e-Government      e-Training

Common Use Cases
3
Data Intensive Web Application
4
Sequence Diagram
5
OMD
6
Generic DataAction Code
7
Specific Action Implementation
8
Start a New Project in SampleApp area
9
Start a New Page Flow
10
Flow View and Action View
11
Source View
12
Create a Form and a FormBean
13
Customize Your Action
14
Re-arrange the Flow View
15
Add Jar files to the Application Build Facilities
16
Import Extra Libraries to WEB-INF/lib
17
Create the Login Bean Class
18
LoginBean Class Example
19
The CheckLogin() Method in the LoginController
20
Example of Using the Session in the JSP
Add the scriplet to the index.jsp
21
Build and Debug
22
ServletContextListener Reads Config
23
Configure the Application via web.xml
24
Build your Web Application
using the last section material
  • Install WebLogic Workshop
  • Build the Login page according to the section material
  • Add Product and Registration pages
  • Prepare SQL statements for existing data and store as files
  • in the “sqlLocation” that is set in the web.xml and MyServletContectListener
  • (No SQL is needed if application creates data from scratch)
  • Create bean classes like the LoginBean that support data structures used with data access and in the forms.
  • Create the LoginController with the checkLogin() method.
  • Note, that the data access in the controller is performed with the DataService.getData() method that uses the SQL statement-file “getLogin.sql” stored in the “sqlLocation”
  • Prepare HashMap to replace SQL <<keys>> with run-time values
25
DataService API
  • Include the library “com.its.util.jar” in the CLASSPATH and import com.its.util.DataService
  • @param directoryName to set the location where your SQL statement files are stored
  • public static void setSqlLocation(String directoryName)
  • @param driverName your jdbc driver name
  • public static void setDriverName(String driverName)
  • @param set Connection URL for database access
  • public static void setConURL(String connectionURL)
  • // 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)
  • @ 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)
  • @param dataSource your DataSource specified in JNDI context
  • public static void setDataSource(DataSource dataSource)
26
DataService Usage Example
27
More DataService API