Please enable JavaScript.
Coggle requires JavaScript to display documents.
browser (後端 (商業邏輯(view.py)EJB (SQL(DB)), data access logic(models.py)JPA,…
browser
後端
商業邏輯(view.py)EJB
SQL(DB)
data access logic(models.py)JPA
UI Logic(view.py)JSF
W8:Enterprise Bean Container(.ear)
RMI(Romate Method Invokation)/IIOP
Romate call
Application Client
pass by value(object)-serializable
pass by reference(address)
Enterprise Bean Container(.jar)
WebContainer(.war)
webConponent
local java method cells
Enterprise Bean
前端W3
html
Form
component
Beans
Data type convertion
Data validation
POST Back Request
Restore(make component tree)
Apply request value
Process validations
update model values
Invoke application
render response
UiViewRoot
process application
1 more item...
Init request(life cycle)
create viwes
Render Response
W4 Graph-h:grapImage
library
name
value
input
text
textArea
output
Text-h:outputText
FormatText-h:outputFormat-f:param
Action
POST(command)
f:param
Request(Http協定)
f:attribute
UiCompornent
Bottom
Action
String
Back Method:String(Null-返回目前頁面)
value
GET
Link
JSF Request Processing
Facets Page
JSF server
component tree
Bean
W6 EL Implicit Objects
App server AppResources
Implicit Objects(page author)
scope
applicationScope:Map
seesionScope
viewSpoce(JSF2.0 only)
requestSpoce
flash(2.0 only)
HTTP
request:servletRequest
cookie
header
headerValues
param
paramValues
season:HTTPSeesion
JSF Page
view
resource
facesContext
W7:Request Processing Life Cycle
Create/restore View
Apply Request Value
conuersion/validation
update model
Inoke App Method
render
APP
apk download
make form to DB
select
one
menu
selectOneMenu
listBox
Radio
many
listBox
selectItem
itemLable+ItemValue
checkBox
selectItems
boolean
checkBox
W5 Component Hierarchy
ValueHolder
EditableValueHolder
UIinput
ActionSource
StateHolder
UIComponent
UIComponentBase
UIGraphic
UICommand
UIData
UINamingContainer
UIFrom
UIPanel
UISelectItem
UISelectItems
UIParameter
UIViewRoot
UIMessage
UIColumn
UIOutput
UIInput
UIselectOne
UISelectMany
UIselectBoolean
NamingContianer
Navigation
implicit Nav
f:param
ActionLintener
Nag Model
Navigation Rule(faces-config.xml)
from-view-id
To-view-id
W5 CDI runtime
Available CDI beans
CDI Bean instance(Manage)
java class
Injection point
Produce
Consumer
W8:Session Bean
Stateless Bean
Statefule Bean
w7:face-config
case<from-view-id>
target
cause
from-action
from-outcome
if
W10
Host Application
Java Persistence API
ROM Layer
Database
Java Persistence
Vendor JPA Implementation
ORM
Object and relational mapping
Field of entity class:DB table column
Entity Class:Database table
Entity instance:DB table row
Entity lifecycle
Persistence Context
Persistent Unit
Persistence Identity
Entity Manager
data source
classes to be managed in the context
W11 : JPA Entity Life Cycle
New
persist
Managed
flush
1 more item...
clear
1 more item...
remove
1 more item...
Transaction Control
EntityManager
PersistenceContext
Extend-scoped
Transaction-Scoped
W13:Query Language
Query Object
javax.persistence.Query
QL query string
native (SQL) query string
Creating:createQuery(String qlString) or createNamedQuery(String name)
:custName
setParameter
setParameter(String name, Object value)
setParameter(String name, Calendar value, TemporalType temporalType)
setParameter(String name, Date value, TemporalType temporalType)
getParameter(String name)
getParameter(String name, Class<T> type)
getParameters()
getFirstResult:int
getMaxResults:int
Named Query
setFirstResult(int startPosition)
setMaxResults(int maxResult)
getResultList:list
getSingleResult:object
executeUpdate:int
Querying Over Entities
Query Object
update
delete
QL query string
native (SQL) query string
Creat
Dynamic Query-createQuery(String qlString)
Named Query-createNamedQuery(String name)
Java Persistence Query Language (JPQL)
W14:Use Cases for the Converters and Validators
required inputs
data length
value range
regular expression
custom validation rules
user input
conversion process
1 more item...
phases
Apply Request Phase
Process Validation
Rendering Response phase
w12:Modeling Association Releations for Entity Classes
relationships in the data model
Primary key
Foreign key
Parent and Child tables
child table
parent table
Relationship properties
Cardinality
one-to-one
one-to-many
many-to-one
many-to-many
Direction
Uni-directional
Bi-directional
Ownership
Owning Side
Inverse Side
Cascade type
Persist
Merge
Remove
Detach
Refresh
None
W15:Create user database
Create a database
Database Name: app_users
User Name: app
Password: app
Admin Console page
1Resources > JDBC > JDBC Connection Pools
SecurityMechanism = 3
User = app
Password = app
DatabaseName = APP_USERS
2Resource > JDBC > JDBC Resources.
Create a new JNDI name jdbc/app_users
Pool Name: app_users
Create a JDBC Realm
Configurations > server-config > Security > Realms > (B)New
Name = app_user_realm
Class Name = com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm
JAAS Context: jdbcRealm
JNDI: jdbc/app_users