Java web programming

Post on 26-May-2015

1.095 views 2 download

Tags:

description

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

Transcript of Java web programming

Java Web Programming

Week 1

what is 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?

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

Source:http://onjava.com

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!

Web/Application Servers

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

Tomcat

Apache

IIS

Websphere

weblogic

Jetti! Netti

Model View Controller

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!

Sample Servlet

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

Result in Browser

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

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?

An ultimate web application!

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