Java Web programming
This book contains topics related to web programming in Java, such as:
- Web services
- HTTP related Java stuff
Before you read this book, make sure you have some basic understanding about web and web concepts. We have an introductory book for that: Introduction to web.
If you run into trouble while running the various scripts in this book, you can look at our FAQ for some common problems and their solutions.
- Java-Web:Creating_JSON_from_Java (including a dedicated lecture on doing so with org.json)
- Assignment:Exposing data over http
- Assignment:SubstituteTeacherScheduler (work in progress but works)
- Assignment in Swedish for Klientprogrammering (yrgo) 2017
Some old lectures and guest lectures
- Calling a service from a Java client Slides for a lecture on how to call a Servlet from a command line Java application, get either XML or JSON from the Servlet, and use a factory to get a parser for either XML or JSON, which creates a List<User> from the data. The main method gets the list, loops over it and prints each User to the standard out. 13 pages. (PDF, English)
- Presentation: Front-end - Back-end (PDF, English)
- Video channel: Java-webb-front-end-backend (Swedish)
Server backends in Java
Lecture about Server Back-ends in Java. This lecture addresses: HTML form used to query a servlet, CSV as a data type, Java client code accessing a web server (URLConnection etc), JAX-WS/SOAP. 32 pages. Needs source code and a test-run.
- Lecture presentation: ServerBackends in Java(PDF, English)
- Videos: TODO
- Lecture: Introduction to XML Introduction to XML.pdf (PDF, Eng.)
- Video: XML - introduktion (Swedish)
- Lecture: Introduction to JSON: Introduction_to_JSON (pdf)
- Lecture: Minimal introduction to AJAX (12 pages) MinimalIntroductionToAjax.pdf (PDF, English)
- Lecture: Ajax with XML for dynamically building an HTML table with student data. 10 pages. Ajax and XML (PDF, English)
- Source code for the AJAX-examples can be found here in our github repository java-web.