Introduction to web

From Juneday education
Jump to: navigation, search


Description

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).

Since a web page (even with some CSS styles) is a rather static construct, we often need some dynamic means to create a richer user experience in the front-end (the user's communicating via or interacting with a web page in a browser), and for this we'll introduce JavaScript on a very basic level. A JavaScript can be added to the web page, for instance for validating a form before the data is sent to a web server.

Finally, we'll introduce AJAX (which is a subset of JavaScript) to show you that communication between a user using a web page in a browser doesn't have to be accomplished with HTML forms transmitting data to a server and then waiting for the response as a new web page. Using AJAX, we can actually update the very web page in the user's browser, asynchronously - e.g. without the user being stopped from using other parts of the web page currently being viewed. This final step (we might add more stuff later on), will show you that a web page doesn't have to be a static experience. AJAX is one way of making a web page more dynamic (in the sense that the user interface, what is seen in the browser, can be changed without having to wait for a completely new web page to be loaded from the server). Dynamic web pages are pages which can be updated using JavaScript (or similar means) while the user is interacting with them. This allows for web pages to serve as richer user experiences than just clicking links or posting form data and waiting for a response before anything else on the page can be used.

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.

Even if clients of the web (browsers using HTML, JavaScript, AJAX, forms etc) keep getting richer and richer, it is common to have more demanding processing and calculations on the server-side. For this, we need some kind of extension to the web server's typical responsibilities and tasks (serving HTML files and other files to web clients on demand).

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.

Knowing about AJAX or AJAJ, also lets you write a Servlet which will provide the data consumed by the AJAX/AJAJ JavaScript in the client.

Here's a selection of chapters from the Java_Web_programming book used in this trail:

Assignments related to Java web programming:

Head right on to the Java_Web_programming book if you want to take this trail!

Preparing

Your environment

Your environment for the Introduction to web book consists of the following parts:

  • Terminal environment with a Shell (e.g. Cygwin and bash)
  • 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

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
  1. 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
  2. make the script executable
    chmod a+x jd-intro-web.sh
  3. and execute it (with verification - recommended)
    ./jd-intro-web.sh --verify to skip verification, simply enter ./jd-intro-web.sh
Execute from web

curl https://raw.githubusercontent.com/progund/utils/master/bin/jd-intro-web.sh | bash

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:

Trouble shooting

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.

Meta infomation

repos:

Potential stuff below