Web application development is primarily a feature of JBuilder Enterprise. Some Web development features are also available in JBuilder Professional.
This section discusses several technologies for developing Web-based multi-tier applications. A Web application is a collection of HTML/XML documents, Web components (servlets and JSPs), and other resources in either a directory structure or archived format known as a Web ARchive (WAR) file. A Web application is located on a central server and provides service to a variety of clients.
Sun Microsystems has delivered the latest versions of JavaServer PagesTM (JSP) and Servlets source code to the Apache Software Foundation http://www.apache.org to be developed and released under the Apache development process as the official JSP 1.1/Servlets 2.2 reference implementation. Apache, Sun, and a variety of other companies and individuals are openly developing a robust Reference Implementation that is freely available to any company or individual. This reference implementation, developed under the project name Jakarta and code-named Tomcat, will be the only reference implementation available. This implementation is available to any company or developer to be used in Web servers, development tools, and to create dynamic, interactive Web sites. JBuilder delivers Tomcat "in the box" to use as your Web server so that you can successfully develop and test your JSPs and Servlets within the JBuilder development environment.
The following technologies are discussed in this section:
In this section, HTML client applications are HTML forms connected to CORBA objects. The mechanism that is used to link the controls to CORBA objects is the <SERVLET> tag, which is placed at the end of each form. The object invoked by this SERVLET tag is the gateway object
. Servlets are modules that run inside of servlet-enabled Web servers, extending their functionality. When you request client-side navigation buttons as part of the client layout, the SERVLET tag generates JavaScript that appears on the client HTML page.
For a tutorial on creating an HTML client using JBuilder, see Creating an HTML CORBA client application.
A JavaTM Servlet is a program written in the Java programming language that runs on the server, as opposed to applets which run on the browser. JavaTM Servlets provide web developers with a simple, consistent mechanism for extending the functionality of a web server and for accessing existing business systems. A Servlet can almost be thought of as an applet that runs on the server side -- without a face. Java Servlets have made many web applications possible.
Servlets are the Java platform technology of choice for extending and enhancing Web servers. Servlets provide a component-based, platform-independent method for building web-based applications, without the performance limitations of CGI programs. And unlike proprietary server extension mechanisms (such as the Netscape Server API or Apache modules), Servlets are server- and platform-independent. This leaves you free to select a "best of breed" strategy for your servers, platforms, and tools.
Written in Java, Servlets have access to the entire family of Java APIs, including the JDBC API to access enterprise databases. JBuilder's InternetBeans Express provides a simple way to create data-aware servlets and JSPs. InternetBeans Express is discussed in "Using InternetBeans Express with Servlets." Servlets also access the library of HTTP-specific calls, and all the benefits of the mature Java language, including portability, performance, reusability, and crash protection.
You might want to check out the latest information on JavaServer PagesTM (JSP). JSP technology is an extension of the Servlet technology created to support authoring of HTML and XML pages. It makes it easier to combine fixed or static template data with dynamic content. Even if you're comfortable writing Servlets, there are several compelling reasons to investigate JSP technology as a complement to your existing work.
For links to all things Servlet, visit http://java.sun.com/products/servlet/index.html.
JavaServer Pages (JSP)TM technology provides a simplified, fast way to create web pages that display dynamically-generated content. JSP pages use XML tags and scriptlets written in the JavaTM programming language to encapsulate the logic that generates the content for the page. It passes any formatting (HTML or XML) tags directly back to the response page. In this way, JSP pages separate the page logic from its design and display. JBuilder's InternetBeans Express provides a simple way to create data-aware servlets and JSPs. InternetBeans Express is discussed in "Using InternetBeans Express."
JSP technology is part of the Java technology family; it uses a Java programming language-based scripting language, and JSP pages are compiled into Servlets. JSP pages may call JavaBeansTM components (beans) or Enterprise JavaBeansTM components (enterprise beans) to perform processing on the server. Using JSP and Enterprise JavaBeans technologies together is a great way to implement distributed enterprise applications with web-based front ends. As such, JSP technology is a key component in a highly scalable architecture for web-based applications.
The JSP specification (http://www.java.sun.com/products/jsp) defines the interaction between the server and the JSP page, and describes the format and syntax of the page.
Both JSPs and Servlets technology have merits. How do you decide which to use in a given situation?
JSP pages are compiled into Servlets, so theoretically you could write Servlets to support your web-based applications. However, JSP technology was designed to simplify the process of creating pages by separating web presentation from web content. In many applications, the response sent to the client is a combination of template data and dynamically-generated data. In this situation, it is much easier to work with JSP pages than to do everything with Servlets.