Introduction to web
- 1 Description
- 2 Preparing
- 3 Trouble shooting
- 4 Meta infomation
- 5 Potential stuff below
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!
Your environment for the Programming with Java programming book consists of these parts:
- Terminal environment with a Shell (e.g. Cygwin and bash)
- Install bash and
- Install a few additional programs (wget, curl, unzip) so that you can run the script below
- Java Development Kit (JDK) - the Java programming environment
- Editor - e.g. Atom - a text editor for writing programs and text
- Install Atom
- For advanced users with a developing background and experience from using the command line in UNIX-like environments, we recommend emacs or vim (probably not a good idea for beginners).
- Additional software (see below)
Additional software for intro-web
Automatic installation of additional software
You will also need some additional software in this course which you can install in any of the two ways using a terminal:
Download script and execute
- Download our boot strap script for this course jd-intro-web.sh:
curl https://raw.githubusercontent.com/progund/utils/master/bin/jd-intro-web.sh -o jd-intro-web.sh
- make the script executable
chmod a+x jd-intro-web.sh
- and execute it (with verification - recommended)
./jd-intro-web.sh --verifyto skip verification, simply enter
Execute from web
Manual installation of additional software
The script above uses files containing a list of packages to install. Here are links to the packages file for each platform we support. Install the packages in these files:
- HomeBrew (MacOs): MacOS-Homebrew.pkgs and introduction-to-web/MacOS-Homebrew.pkgs. Download and execute the following script (if it exists): introduction-to-web/MacOS-Homebrew.sh
- MacPorts (MacOs): MacOS-MacPorts.pkgs and introduction-to-web/MacOS-MacPorts.pkgs. Download and execute the following script (if it exists): introduction-to-web/MacOS-MacPorts.sh
- Cygwin (Windows): cygwin.pkgs and introduction-to-web/cygwin.pkgs. Download and execute the following script (if it exists): introduction-to-web/cygwin.sh
- Fedora (GNU/Linux): fedora.pkgs and introduction-to-web/fedora.pkgs. Download and execute the following script (if it exists): introduction-to-web/fedora.sh
- Ubuntu (GNU/Linux): ubuntu.pkgs and introduction-to-web/ubuntu.pkgs. Download and execute the following script (if it exists): introduction-to-web/ubuntu.sh
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.