Java and the World Wide Web
Download
Report
Transcript Java and the World Wide Web
Java and the
World Wide Web
A Workshop for the ACM/JETT Conference
May 16th, 2003
Led by Morgan C. Benton ([email protected])
Agenda
Brief Java Overview
Java on the Web
Examples
An Applet
A JavaServer Page (JSP)
Java, the Web, and the Classroom
Q&A
2
©2003 Morgan C. Benton
What is Java?
Interpreted not Compiled
Platform Independent
“Write once. Run anywhere.”
Object Oriented
“Easy” to learn
3
©2003 Morgan C. Benton
Java on the Web
4
Primarily two ways it’s used:
Applets
JavaServer Pages (JSP)
Other uses/terms:
JavaServlets
JavaBeans
Stand alone applications
©2003 Morgan C. Benton
HTML: The Static,
Non-Interactive Web
HTML:
Basic skill for web developers
Designed for presenting information
Doesn’t support dynamic pages
5
(Recommendation: Encourage students to learn the
HTML 4.01 standard, or even better XHTML 1.0.
See http://www.w3.org for details.)
©2003 Morgan C. Benton
!JavaScript.equals(Java)
(or in C++, JavaScript != Java)
Almost no connection
Some shared syntax
Name remnant of business alliance
between Netscape and Sun
Also a basic skill for web developers
Complementary to JSP, and to a
lesser extent Applets
6
©2003 Morgan C. Benton
Server-side vs. Client-side
Servers
Clients
JSP
Database
+
DBMS
Security
Mechanism
7
Applets
Data
Storage
©2003 Morgan C. Benton
Applets
Basically a Java application that runs
within a browser
Code is interpreted on the client-side
by JVM within the browser
Limitations (by design):
Limited file system access
Limited network access
8
©2003 Morgan C. Benton
JSP
For building Web Applications
Code is compiled and run on the
server HTML is sent to browser
Major player in server-side scripting
market
Widely used and supported
9
©2003 Morgan C. Benton
JSP Pros and Cons
Pros
10
Runs on variety of
(sometimes free)
web servers
Large developer
community
At least as
powerful as
competitors
Multi-threading
©2003 Morgan C. Benton
Cons
Configuration of
web server can be
tricky
Steep learning
curve for nonprogrammers, but
not any more than
any other serverside technology
JSP vs. ASP vs. PHP vs. CF
ASP.NET (Active Server Pages)
PHP (PHP Hypertext Preprocessor)
Open source, free, huge community
ColdFusion (from Macromedia)
11
Microsoft technology with wide use and
support, code in VBscript (or JavaScript)
Runs only in Windows
Easiest to learn, but definitely NOT free
Strongest integration of Flash
©2003 Morgan C. Benton
Development Needs
Minimum requirements:
J2SE v 1.4.x SDK (Software Developers’ Kit)
• Current latest version 1.4.2 beta (4/16/03)
• JRE comes bundled with the SDK
Any text editor, e.g. WordPad, Emacs, etc.
In addition:
You may want a better editor/IDE, e.g.
•
•
•
•
12
Sun ONE Studio 4 CE (125 MB!)
JCreator: $35, in C++ (http://www.jcreator.com/)
jEdit: free, open source (http://www.jedit.org/)
BlueJ: free, designed for teaching! (http://www.bluej.org)
©2003 Morgan C. Benton
Hosting Needs (for JSP)
Web Server:
Application Server:
13
IIS: comes with Win2k/XP Pro
Apache
Sun ONE Application Server (PE)
Tomcat (http://jakarta.apache.org/tomcat/)
Resin (http://www.caucho.com/)
JRun
Sun ONE Application Server (PE)
©2003 Morgan C. Benton
Let’s build some apps!
Here’s an example:
Applet
JSP Page
14
©2003 Morgan C. Benton
Java, the Web, and the
Classroom
Web Development requires some
understanding of all of the following:
15
Programming Concepts: control and data
structures, algorithms
Networking and protocols
Client-server architecture
HTML, CSS, and JavaScript
Interface Design/Usability Design
Databases
Teamwork/Team management
©2003 Morgan C. Benton
How do I teach this?
Recommendations:
Don’t be afraid to say “I don’t know,
but let’s find out.”
Encourage/Support/Reward
resourcefulness and self-teaching
Competitive Project Teams
Consultant-Client approach
Solicit colleagues or clubs for real
systems to build
16
©2003 Morgan C. Benton
Resources
This list has zero pretensions to
exhaustiveness
Sun’s Java Site
http://java.sun.com
Developer.com’s Gamelan Site
http://www.developer.com/java/
BlueJ
http://www.bluej.org/
17
©2003 Morgan C. Benton
Q&A
18
Comments, questions, suggestions,
experiences, reactions, feedback or
anything you’d like to say.
©2003 Morgan C. Benton
Thank You!
Morgan Benton
[email protected]
Office: (973)596-5291