30
Fall 2008 http://www.cis.ksu.edu 1 CIS 764 Database Systems Design L8. Web ….

Fall 2008 1 CIS 764 Database Systems Design L8. Web …

Embed Size (px)

Citation preview

Page 1: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 1

CIS 764 Database Systems Design

L8. Web ….

Page 2: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 2

CIS 764 Database Systems Design

class status:

19 persons ( 7 off campus, 12 in class )

… not checked all home pages yet … homework index … done

off campus may run 3-7 days behind the in-class (part delay in posting)

next week … review of reverse engineering, (then forward engineering exercise)

Page 3: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 3

CIS 764 Database Systems Design

ejb tutorial …

is that an effective way give programming assignment?

Page 4: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 4

CIS 764 Database Systems Design

ejb tutorial …

is that an effective way give programming assignment? SE answer: No … missing design documents (diagrams)

(later)

Page 5: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 5

CIS 764 Database Systems Design

next logical topic: Object-Relational Mapping

but … skip that for now

used implicitly in tables classes

Page 6: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 6

CIS 764 Database Systems Design

CIS 726 WWW Technologies

Spring 2009

Page 7: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 7

CIS 764 Database Systems Design

web issues / topics:

dynamic pages …. user interaction, generated data page control / design

db aware components

usability

testing

Page 8: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 8

CIS 764 Database Systems Design

web issues / topics:

dynamic pages …. user interaction, generated data JavaScript … JSP …

page control / design Struts .. Page flow model

db aware components JSF, ADF components

usability … later

testing … later (performance vs functional )

Page 9: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 9

CIS 764 Database Systems Design

dynamic web pages: http://en.wikipedia.org/wiki/Dynamic_web_page

* client side scripting: e.g. JavaScript (not really Java), VBScript, PHP, …

* server side: e.g. ASP, JSP, PHP,….

** AJAX … a bit of both

Page 10: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 10

CIS 764 Database Systems Design

http://en.wikipedia.org/wiki/JavaServer_Pages

scriptlets (old, embedded code)

<% int localStackBasedVariable = 1; out.println(localStackBasedVariable); %>

vs

tags

<jsp:forward page="subpage.jsp" > <jsp:param name="forwardedFrom" value="this.jsp" /> </jsp:forward>

Page 11: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 11

CIS 764 Database Systems Design

http://en.wikipedia.org/wiki/JavaServer_Pages

tag libraries :

components, logic, sql, actions, custom tags

Standard Tag Library (JSTL)

primer http://www.ibm.com/developerworks/java/library/j-jstl0211.html

Quick reference sheet http://bellsouthpwp.net/b/i/billsigg/jstl-quick-reference.pdf

Page 12: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 12

CIS 764 Database Systems Design

JSP … several tutorials: http://www.jsptut.com/ (or http://www.visualbuilder.com/jsp/tutorial/ )

Getting familiar with your JSP server Your first JSP Adding dynamic content via expressions

Scriptlets Mixing Scriptlets and HTML Directives Declarations Tags Sessions Beans and Forms Processing Tag Libraries Form Editing Log-in pages Further learning

Page 13: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 13

CIS 764 Database Systems Design

Page 14: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 14

CIS 764 Database Systems Design

Struts: a (well structured) framework for JSP development, with tag libraries

“Model-View-Control” framework

JSP is the view, Struts is the view-controller ejb-beans are the model

but …. Separate controllers in the model , JSP page attributes defined in “beans” (not ejbs)

Page 15: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 15

CIS 764 Database Systems Design

Struts: a (well structured) framework for JSP development, with tag libraries

Ref: Struts Survival Guide: Basics to Best Practices, S. Shenoy, N. Mallya Object Source, Austin, TX 2004

also: Apache , Jakarta project http://www.visualbuilder.com/jsp/struts/tutorial/

Page 16: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 16

CIS 764 Database Systems Design

Page 17: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 17

CIS 764 Database Systems Design

Page 18: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 18

CIS 764 Database Systems Design

Page 19: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 19

Page 20: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 20

Page 21: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 21

CIS 764 Database Systems Design

Page 22: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 22

CIS 764 Database Systems Design

struts-config.xml

web.xml

servlets

mapping

session parms

listeners

tag libs

defaults

MIME

filters

Page 23: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 23

CIS 764 Database Systems Design

Page 24: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 24

CIS 764 Database Systems Design

Attribute description . Path URL (either full or suffix) which triggers this mapping

Type the full class name of the Action

Name name of the form bean

Scope session or request

Validate boolean: true => call validate method on the input data

Input actually, the page (or other Action) for error response

Forward page (or other Action) when ActionForward in exected

Page 25: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 25

CIS 764 Database Systems Design

Page 26: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 26

CIS 764 Database Systems Design

Oracle tutorials: “Creating an Input Form JSP Page Using the Struts Validator to Validate Data…”

http://www.oracle.com/technology/obe/obe_as_1012/j2ee/develop/client/strutsvalidator/validator.htm

Assignment (not homework to be collected): View the validator tutorial … preparation for next ADF assignment. http://people.cis.ksu.edu/~hankley/d764/JDev/struts/Validator_Tut/validator.htm

Page 27: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 27

CIS 764 Database Systems Design

JSF “JavaServer Faces (JSF) is a Java-based Web application framework intended to simplify development of user interfaces for Java EE applications. Unlike other traditional request-driven MVC web frameworks, JSF uses a component-based approach. The state of UI components is saved when the client requests a new page and then is restored when the request is returned. “

http://en.wikipedia.org/wiki/JavaServer_Faces#JSF_versions

Page 28: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 28

CIS 764 Database Systems Design

ADF Faces “Oracle ADF Faces is a rich set of user interface components based on the JavaServer Faces JSR (JSR-127). The Oracle ADF Faces Components provide various user-interface components with built-in functionality - such as data tables, hierarchical tables, and color and date pickers - that can be customized and re-used in your application. “

http://www.oracle.com/technology/products/adf/adffaces/index.html

Page 29: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 29

CIS 764 Database Systems Design

ADF Faces components

http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/imageIndex.html

Page 30: Fall 2008  1 CIS 764 Database Systems Design L8. Web …

Fall 2008 http://www.cis.ksu.edu 30

CIS 764 Database Systems Design

end