Introduction to web
We are working on a re-write/re-structuring of this book.
This book has two trails (sub books):
- Web introduction (a general introduction to Web)
- Java Web Programming (Web applied to Java programming with Servlet as the back-end)
You should start with the Web introduction trail, to get the basics of web related topics. After that, you can take the Java web programming trail, which shows you how you can use Java to create web services.
Web basics - basic introductory trail
If you are new to the web and its technology, you should start with this trail. This will introduce you to the HTTP protocol, which is used for communication between a web client (typically a browser but could be any application) and a web server.
After that, we move on to the front-end stuff which makes up the interface the user will see (like a web page presented in a browser) by introducing HTML (the mark-up code of web pages) and we'll also touch upon CSS (style sheets used to put some style to a web page viewed in e.g. a browser).
Here's some sample chapters of the Web basics book used for this trail:
Head straight to the Web basics book, if you want or need to learn the basics of web technology.
Java Web programming trail
If you already know about web technology and want to use Java in order to create web applications, this is the trail for you.
One such extension is to allow the web server to delegate certain requests to a Java program which will be responsible for creating the response data. One common technology for such Java programs called from a web server is the Servlet technology.
Learning about Servlets will give you an understanding of how a back-end can work. Servlets can provide the logics and services which require programming, and they are written in Java. A servlet can generate responses on the fly based on parameters sent along with the request for some data. A Servlet can also be connected to a back-end database where the web application's data is stored.
We're not claiming that Servlets are the only or most common way to program a web back-end, but use them as an example for understanding how a larger web system can be written. Since Servlets are written in Java, this trail also works well as a more advanced book, taking off where our introduction book, Programming with Java, ends. This trail therefore requires not only knowledge about the web on par with the introduction to web trail, but also a good understanding of the Java language.
Here's a selection of chapters from the Java_Web_programming book used in this trail:
- Java-Web:Creating_JSON_from_Java (including a dedicated lecture on doing so with org.json)
- Servlet as back-end - HTML and AJAX as front-end
Assignments related to Java web programming:
- Assignment:Exposing data over http
- Assignment:SubstituteTeacherScheduler (work in progress but works)
- Assignment in Swedish for Klientprogrammering (yrgo) 2017
Head right on to the Java_Web_programming book if you want to take this trail!
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.