Java web programming

18
Java Web Programmin Week 1

description

Week1 Session1 of first Yarl IT Hub Crash Course on Java Web Programming!

Transcript of Java web programming

Page 1: Java web programming

Java Web Programming

Week 1

Page 2: Java web programming
Page 3: Java web programming
Page 4: Java web programming
Page 5: Java web programming
Page 6: Java web programming
Page 7: Java web programming

what is web programming?

Page 8: Java web programming

Why Can’t We Have a Simple Java Main Class?

How do I talk to a class?

How do you talk to a class?

How do the world talk to a class?

Page 9: Java web programming

YEAH I KNOW THAT! THAT’S HTTP, XML, (X)HTML(5), WS .. ALL THOSE RUBBISH! BUT..

Source:http://onjava.com

Page 10: Java web programming

Some Movie Stars’ Names For Rest Of Your Life To Dream On!

Web Server/Servlet Container/Application Server

HTTP/HTTPS : All of em’ understand these guys!

GET/POST .. again?

Browser : a genius!

Page 11: Java web programming

Web/Application Servers

http://www.yarlithub.org:8080/yschool/crash/oops.html

Tomcat

Apache

IIS

Websphere

weblogic

Jetti! Netti

Page 12: Java web programming

Model View Controller

Page 13: Java web programming

Bite on JSP/Servlet

+ Servlet is your controller!+ Container understand which request is for which

servlet!+ Servlet can read the request, “call the friend” if

doesn’t know the answer! Then write the response.+ That friend can be a “Model” Or a “Service”!

+ What is written in the response is the “VIEW” .. HTML

Servlet is the controller, response is the view & person who knows the answer is the model!

Page 14: Java web programming

Sample Servlet

Source : http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-First-Servlets.html

Page 15: Java web programming

Result in Browser

http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-First-Servlets.html

Page 16: Java web programming

Wait A Sec .. Where is this damn JSP?

– THINKWe should have written the html

content into a file!

If files vary then its fine! … But if the content vary?

Page 17: Java web programming

An ultimate web application!

Page 18: Java web programming

பௌ��தீகம்ஒருகடல்!-- குமரன்ம�ஸ்டர்