J2EE vs Python for web development David

Slides:



Advertisements
Similar presentations
Objectives Ch. D - 1 At the end of this chapter students will: Know the general architecture and purpose of servlets Understand how to create a basic servlet.
Advertisements

CSE 190: Internet E-Commerce Lecture 7. HTML Templates Designed to separate server side logic from HTML presentation Key features –Escapes from HTML into.
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
JSP Java Server Pages Reference:
June 1, 2000 Object Oriented Programming in Java (95-707) Advanced Topics 1 Lecture 10 Object Oriented Programming in Java Advanced Topics Servlets.
Introduction to Servlet & JSP
Comp2513 Java Servlet Basics Daniel L. Silver, Ph.D.
Java Server and Servlet CS616 Team 9 Kim Doyle, Susan Kroha, Arunima Palchowdhury, Wei Xu.
Server Side Programming Web Information Systems 2012.
Definition Servlet: Servlet is a java class which extends the functionality of web server by dynamically generating web pages. Web server: It is a server.
INTRO TO MAKING A WEBSITE Mark Zhang.  HTML  CSS  Javascript  PHP  MySQL  …That’s a lot of stuff!
Java Servlets and JSP.
Java Servlets. What Are Servlets? Basically, a java program that runs on the server Basically, a java program that runs on the server Creates dynamic.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Server-side Technologies
Servlets. - Java technology for Common Gateway Interface (CGI) programming. - It is a Java class that dynamically extends the function of a web server.
Chapter 5 Java Servlets. Objectives Explain the nature of a servlet and its operation Use the appropriate servlet methods in a web application Code the.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
Servlet Lifecycle Lec 28. Servlet Life Cycle  Initialize  Service  Destroy Time.
Who uses it? MichaelMoore.com What's it all about? Rapid Development Clean, Pragmatic Design.
Java Servlets & Java Server Pages Lecture July 2013.
Java Servlets Lec 27. Creating a Simple Web Application in Tomcat.
Chapter 2 Web app architecture. High-level web app architecture  When a client request coming in and needs servlet to serve dynamic web content, what.
20-Nov-15introServlets.ppt Intro to servlets. 20-Nov-15introServlets.ppt typical web page – source Hello Hello.
S ERVLETS Hits Counter 21-Nov-15. S ERVLETS - H ITS C OUNTER Many times you would be interested in knowing total number of hits on a particular page of.
Java Servlet API CGI / HTTP Concepts Java Servlet API.
JavaServer Page by Antonio Ko. Overview ► Introduction ► What is a servlet? ► What can servlets do? ► Servlets Vs JSP ► Syntax ► Samples ► JavaBean ►
Java Servlets and Java Server Pages Norman White Stern School of Business.
CSE 403 The Mythical Servlet Goals Introduce basic servlet terminology Formally introduce homework 2 Walkthrough of build & deployment Group discussion.
Middleware 3/29/2001 Kang, Seungwoo Lee, Jinwon. Description of Topics 1. CGI, Servlets, JSPs 2. Sessions/Cookies 3. Database Connection(JDBC, Connection.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
CentralCampus Group: May13-26 – William Van Walbeek & Paul Wilson Client: Google, Muthu Muthusrinivasan Advisor: Manimaran Govindarasu Abstract Introduction.
Java and the Web CSE 3330 Southern Methodist University.
Java Servlets and Java Server Pages
Introduction To HTML Dr. Magdi AMER. HTML elements.
How CGI and Java Servlets are Run By David Stein 14 November 2006.
J2EE/Java EE Apache Tomcat v9 IBM Websphere v8 Redhat JBoss EAP v6 Oracle Weblogic v12 Fusion Web Tier ServletsJSPJSF Business Tier JMXJMSEJB.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
S ERVLETS Form Data 19-Mar-16. F ORM P ROCESSING You must have come across many situations when you need to pass some information from your browser to.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Comparative Display Technologies.
Speaker Name Speaker Title Speaker Title Oracle Corporation Olivier Le Diouris Principal Product Manager Oracle Corporation Building Servlet and JSP Applications.
Distributed Web Systems Java Servlets Lecturer Department University.
Creative Commons Attribution- ShareAlike 2.5 License Sakai Programmer's Café Sakai Oxford Tetra ELF Workshop Comparative Display Technologies in Sakai.
Dive into web development
CS122B: Projects in Databases and Web Applications Spring 2017
Introduction to Servlets
Top 8 Best Programming Languages To Learn
ITM352 PHP and Dynamic Web Pages: Server Side Processing 1.
Building Web Apps with Servlets
5 Tips To Get Started With Full Stack Web Development
Google Web Toolkit Tutorial
Servlet Fudamentals.
Java Servlets By: Tejashri Udavant..
Net-centric Computing
Course Outcomes of Advanced Java Programming AJP (17625, C603)
Google Web Toolkit - Gufran Mohammed
HTTP Servlet Overview Servlets are modules that extend request/response-oriented servers, such as Java-enabled web servers. For example, a servlet might.
PHP / MySQL Introduction
SharePoint-Hosted Apps and JavaScript
Web Browser server client 3-Tier Architecture Apache web server PHP
Java Servlets and JSP.
Servlets Servlets are modules that extend the functionality of a “java-enabled” web-server They normally generate HTML code and web content dynamically.
Java Servlets Servlet Overview Servlets and HTML Forms Servlet Basics
Servlets Servlets are modules that extend the functionality of a “java-enabled” web-server They normally generate HTML code and web content dynamically.
Client-Server Model: Requesting a Web Page
Web Client Side Technologies Raneem Qaddoura
Basic servlet structure
Presentation transcript:

J2EE vs Python for web development David

● Java and Python both reasonably mature object oriented programming languages ● So, suppose we had a web app to write and a choice of either (say because we wanted to host it on Google App Engine...) ● Let's dive in

Java (J2EE) ● Ignoring the silly naming... import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println(" "); out.println(" Hello World "); out.println(" "); out.println(" Hello World "); out.println(" "); }

Python - WSGI def simple_app(environ, start_response): status = '200 OK' response_headers = [('Content-type','text/plain')] start_response(status, response_headers) return ['Hello world!\n']

This is all a bit tedious and low-level... ● Let's find ourselves a higher-level framework ● We can use whatever bits our languages have to offer for DB access, image generation, sending e- mail, etc... ● What we need is an abstraction layer for handling HTTP requests ● And some way of generating blingsome javascripty web pages easily

Java web frameworks ● Java: ● Play – their website was crocked last time I checked. Not a good start, but allegedly has some nice features. ● Spring – a lot of tools to make back-end dev more pleasant, plus some integration with... ● Google Web Toolkit – compiles Java -> JS + allows RPC / ajax calls to the server from the resulting rich UI

Python web frameworks ● Python: ● Django – high-level framework, evolving fast, but no help on the client side apart from templating HTML etc. ● Pylons – similar, not much help on the client side ● Turbogears – glues together a bunch of existing technologies all the way from JS lib of your choice on the client to ORM on the server

Gradients and AJAX Web 2.0 ● How to write a blingsome web-based UI? ● Maintaining lots of javascript by hand is tedious... ● GWT is a slightly sick idea, but unlike a few years ago, the browsers can handle that much JS, so... ● There was an attempt to make a Python equivalent of GWT, but it sank without trace ● Maybe the existence of jQuery UI is enough

Pros and cons ● None of the java frameworks I've used, nor basic J2EE, make it easy enough to have a clean, sane URL structure. Django et al do (stole RoR's best ideas on this) ● Nothing I've used in the Python world makes it easy to generate rich web pages / AJAX without hand-crafting lots of javascript or using other libraries, which bring other tools + complexity with them ● The Java tools/IDEs are more helpful, but this is counterbalanced by make an edit, recompile, zzzzz vs python's edit and there you go

Deployment and hosting support ● Java – has a (not entirely undeserved) reputation as a memory hog => pricier hosting ● Python – support for WSGI and stuff built on it still pretty thin on the ground... ● mod_wsgi for apache works really well, but not too many hosts offer it yet ● Costs: app engine – free for low to medium traffic (but no uptime guarantees) ● There are some ~£10/month options out there for hosting both ● And you can always get a virtual server for relatively little

Verdict? ● Depends on individual taste and the project being undertaken ● Neither world offers perfection out of the box ● Both are still evolving ● So take your pick :) ● Or use both! I'm planning a GWT / Django hybrid project. Your sysadmin will hate you, though ● I'd still take either of them over PHP...