06 Dec

Web Application Development with Java based Technologies

Web Application Development with JAVA

JAVA, Enterprise Development for Web based applications is all time favorite technology, which is being used by several companies and developers all around the globe. Demand in industry for Java based developers is gaining regularly, and android application development which is based on Java language has given this demand a strong push forward.

Java for web applications is overkill for small applications. A simple blog with one database table hold blog entries, for example, could be done in something much simpler.

I have usually seen Java do much better in much larger web applications (think banks and insurance companies) that communicate with a number of other systems (such as mainframe back-ends and databases and peer web-services background batch-processing systems… all in the same application).

From what I’ve seen, the architecture of a JavaEE web application is just usually more than is needed for small/simple web applications.

 

 

 

 

 

 

 

 

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.

Java Web Standards

Standard Java technologies are defined via a standard process called the Java Community Process (JSP). The following technologies are defined via the JCP.

Servlet

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 Page

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.

JavaServer Pages Standard Tag Library

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.

Modern Approach (Rich Internet Applications)

What is RIA Development?

Applications that combine the benefits of Web and Desktop applications with low cost of Deployment and Reach of Web Applications. RIA has user experience of Desktop Applications that are:

  • Responsive
  • Data Driven
  • Rich Media
  • Online and Offline
Web based chess game Application

Web based chess game Application

Rich Internet Applications are getting more popularity compare to traditional HTML based internet applications due to enhanced user experience. Although they run in any browser, on any platform and they have features and functionalities of a desktop application.

Benefits of RIA:

  • It allows the user to access a Web Site or application without a separate installation process
  • It offers a rich user interface that matches the look and feel of a native graphical user interface(GUI) over a browser
  • The application themselves are small, providing reasonable performance for slower dial-up users as well as broadband connectivity

How can we develop RIA Applications?

Better user experience, increased productivity, rich and engaging viewing experience are some advantages of RIA. Keeping these points under consideration many companies and open source community have provided many solutions for developing RIA applications. The famous technologies are –

  1. GWT (converts Java based UI into Javascript, HTML, CSS – No plugin required)
  2. Apache Flex(formerly Adobe Flex – Requires Flash plugin  to run application)
  3. JavaFX from Oracle (Requires JRE plugin to run application)
  4. Microsoft Silverlight (Requires plugin to run application)

Introduction to Google Web Toolkit(GWT)

GWT is an open-source, Java-based framework for creating Ajax based web applications, created and used by Google, which makes writing web applications similar to Swing applications.

You might be a Java developer who would like to be able to apply the software engineering principles of object-oriented programming and leverage the tools in your Java IDE when writing applications for the web. Or you might be a JavaScript guru curious about GWT’s ability to generate highly optimized JavaScript with permutations for multiple browsers.

GWT provides a Java API that lets you build component based GUIs while avoiding JavaScript, and abstracting the HTTP protocol and underlying browser DOM model.

All of this achieved using the GWT compiler, which does not generate Java bytecode, rather it generates JavaScript! The GWT compiler takes your client side Java code and generates JavaScript. A compiled GWT application consists of fragments of HTML, XML and JavaScript

If you want to have your web application communicate with a web server, GWT has you covered as well. GWT has a Remote Procedure Call (RPC) mechanism that makes it easy for the client and server to pass Java objects back and forth.

 

 

 

 

 

 

 

Enterprise Usage

GWT is widely used in the Enterprise space due to its leveraging of common enterprise technologies including Java, Apache Tomcat (or similar web container), Eclipse IDE,  and Internationalization and Localization. Java-based GWT RIA’s are easier to test using the existing JUnit testing framework and code coverage tools, compared to large applications written in Javascript. Because GWT allows compile time verification of images, CSS, and business logic, many common development defects are automatically discovered without need of the manual testing commonly required by RIA’s.

Like any other Web Application GWT based Application can be understood a combination of Client Side & Server Side Code.

Client-side code

  • Compiled to HTML and JavaScript
  • Uses CSS for formatting
  • Restricted to a subset of Java 1.4 for now
  • Server-side code can be implemented in any language including Java 5 and 6
  • Commonly Java-based GWT RPC servlets are used (more on this later)

Server-Side code

Everything that happens within your web server is referred to as server-side processing. When your application running in the user’s browser needs to interact with your server (for example, to load or save data), it makes an HTTP request across the network using a remote procedure call (RPC). While processing an RPC, your server is executing server-side code.

GWT provides an RPC mechanism based on Java Servlets to provide access to server side resources. This mechanism includes generation of efficent client and server side code to serialize objects across the network using deferred binding.

Tip: Although GWT translates Java into JavaScript for client-side code, GWT does not meddle with your ability to run Java bytecode on your server whatsoever. Server-side code doesn’t need to be translatable, so you’re free to use any Java library you find useful.

Why Use GWT?

  • Creates browser-based GUIs using Swing-like components
  • No need to write HTML which means no scriptlets
  • Uses CSS for formatting and some layout
  • No need to write JavaScript, but can if desired
  • No messy navigation control with redirects and forwards
  • Makes asynchronous server calls which results in a better user experience
  • Ajax features can be implemented without thinking about DOM manipulation
  • Direct DOM manipulation, if needed, is easy to do
  • Can easily pass Java objects between client and server
  • No need to populate Java objects from HTTP data
  • No need to populate HTML forms from Java objects
  • Can throw Java exceptions from the server back to the client
  • Can use Java IDEs like Eclipse, IDEA and NetBeans
  • Created, maintained, enhanced and used by Google
  • recognized for their software expertise
  • One of the few serious Microsoft competitors

For any query related to JAVA based Web Application Development, you can send email to  my email-id ashish@waayoo.com

Fastest Way to Learn With Waayoo

With Waayoo you can learn all these Java based Development Techniques with one of our special package, which combines all things viz Java Software Development + Java Enterprise Development + Rich Internet Applications along with GWT,Spring & Hibernate. For any query you can have a discussion with us at +91 9616420235 or 9807507429, also you can send email to contact@waayoo.com.

Waayoo is offering this Package in Winter, Summer, Regular Trainings at Waayoo Centers.