Introduction into Java Web development
Java Web technologies
1. Web development
               
Java has strong support for web development. The following
                  gives an
                  overview of the available Java technologies starting
                  with an
                  explanation of web applications and then highlighting
                  important
                  standards in Java.
                  After you finished the overview you can create your
                  first Java web
                  application with
                   Servlet and JSP development 
                     
                  with Eclipse WTP.
                  
               
            
               
If you develop a web application (independent of the
                  programming
                  language your are using) your put your web application on
                  a server
                  (and not your local computer). The web application runs on the
                  server
                  and people can access it there. The server is either a real machine
                  (with CPU, memory, harddisk, etc.) or a virtual server which is
                  basically a machine which is separated by software into smaller
                  machines.
               
Instead of running your application directly on a dedicated server you could also run it in a cloud environment. This cloud environment provides the necessary server for your application. An example for this is the Google App Engine .
Of course it is possible to use your local computer as a server but usually you want to have a fixed server which runs 24 hours and 7 days so that web clients can always reach your server under a pre-defined address.
            
Instead of running your application directly on a dedicated server you could also run it in a cloud environment. This cloud environment provides the necessary server for your application. An example for this is the Google App Engine .
Of course it is possible to use your local computer as a server but usually you want to have a fixed server which runs 24 hours and 7 days so that web clients can always reach your server under a pre-defined address.
               
Java web applications are typically not running directly on the
                  server. Java web applications are running inside a container on the
                  server. This container runs on the
                  server.
                  The container provides a
                  runtime environment for Java web
                  applications.
                  The container is for
                  Java web applications what the JVM
                  (Java Virtual
                  Machine) is for local
                  running Java applications. The
                  container itself
                  runs in the JVM.
               
In general Java distinguish two containers: the web container and the Java EE container. Typical web container in the Java world are Tomcat or Jetty. A web container supports the execution of Java servlets and JavaServer Pages. A Java EE container supports additional functionality for example distribution of server load.
Most of the modern Java web frameworks are based on servlets and JavaServer Pages. Popular Java web frameworks are JavaServer Faces, Struts, Spring. These web frameworks usually can run in a web container.
            
In general Java distinguish two containers: the web container and the Java EE container. Typical web container in the Java world are Tomcat or Jetty. A web container supports the execution of Java servlets and JavaServer Pages. A Java EE container supports additional functionality for example distribution of server load.
Most of the modern Java web frameworks are based on servlets and JavaServer Pages. Popular Java web frameworks are JavaServer Faces, Struts, Spring. These web frameworks usually can run in a web container.
               
Traditionally is has been difficult to start Java web development as
                  a server was required for hosting the Java web container. Google
                  offers a free of charge (for starters) solution based on Java.
                  
               
            
            
A Java web application is a collection of dynamic resources
               (such as Servlets, JavaServer Pages, Java classes and jars) and
               static resources (HTML pages and pictures). A Java web application
               can be deployed as a ".war"
               file. The ".war" file is a zip file
               which
               contains the complete
               content of the corresponding web
               application.
               
            
         
         
            
Standard Java technologies are defined via a standard process called
               the
                Java Community Process (JSP). The following technologies are defined via the JCP.
               
            
            
               
A servlet is a Java class which extends "HttpServlet" and
                  answers a
                  HTTP request within a
                  web
                  container.
                  The latest official
                  version
                  is
                  Servlets 3.0 which is also part of Java
                  EE
                  6. For details
                  see the
                   Java Servlets 3.0 Spec.
                  
               
            
               
JavaServer Pages (JSP) are files which contains HTML and Java
                  code.
                  The web cotainer compiles the JSP into a servlet at the first
                  time of
                  accessing this JSP. The current latest version is 2.1.
                  
                  See
                   Specification for JavaServer Pages 2.1
                  
               
            
               
The JavaServer Pages Standard Tag Library (JSTL) encapsulates
                  as simple tags the core functionality common to many Web
                  applications. The current version is 1.2 is part of the JavaServer
                  Pages Specification version 2.1.
               
            
            
For Java you also find lots of non-standard web development. For
               example GWT supports the Java development and is compiled into
               JavaScript.
         
Comments
Post a Comment