Using JSP to integrate Amazon Web Service

Source: Internet
Author: User
Tags tomcat

In part 1th of this series, we described how to use Notes/domino 6 Laiji to become an Amazon Web Service. We are sure that many readers would like to know how to use Java EE to create similar applications because IBM has made a lot of technical effort. So in this article, we'll explain how to use Java EE to recreate the Notes application that was built in the first article, as well as the difference between this technique and Domino. The purpose of this article is to give Domino developers an overview of how to use Java EE to develop a similar Amazon Web Service application in a different way. This article assumes that you are a very experienced Java developer.

First, let's take a look at how to create an application using Dreamweaver and JSP (JavaServer Page), which is used for the simplest Web applications, and we'll introduce them to the reasons. Then we'll explain how to use EJBs (Entity JavaBeans), JavaBeans, and Struts to create applications that are typically used in more robust, more complex Web applications.

Java Technology and framework

There are a number of different technologies and frameworks in the Java EE world, such as Cocoon (XML/XSLT), Structs, ColdFusion MX, Java Server Faces, and so on, which are all running on Java EE platforms. Of course, the Java EE platform allows you to use any of the frameworks on the platform running Java EE, which gives you a commitment to use a variety of platform environments.

Domino servers can also use a mixed-J2ee/domino design, using Domino forms to display the user interface, and use the Java servlet to implement the processing of the form. This provides more flexibility for form processing and better performance than pure Domino applications, but many pure Java EE developers may find this approach very strange.

Another alternative DOMINO/J2EE hybrid architecture will use a Java-EE server (usually JSP, such as Tomcat) to display the user interface, but use the Domino database to store the data. This can be done using the Domino JSP custom tag, as discussed in the LDD today overview, "Jeff calow on new WEB Technologies in Domino 6." In addition, this architecture provides better performance than pure Domino applications, but most developers use it to improve the ability to control the graphical hierarchy of Web sites, because Domino does not provide the location of each element in its own web view.

The performance improvements are not obvious compared to the sites created using Domino, but they all offer a substitute that takes less effort than pure Java-EE applications, and for Domino developers, this optional technology to experience Java EE Technology is also very helpful. In the third article in this series, we will introduce a method for combining the DOMINO/J2EE technology using Lotus Domino Toolkit for WebSphere Studio, and how to use this tool to open the Amazon book data stored in the Notes database Send a Web UI.

What is Java EE?

Java EE is a set of standard technologies and APIs, which Sun Microsystems defines as some of the requirements that a Java-EE server must have before it becomes a compatible server. Some of the technologies associated with WEB development prospects are servlet, JSP, JavaBeans, and EJB.

For simple WEB applications, you can use Servlet and JSP. Both the servlet and JSP are supported by the Tomcat engine for the Apache Jakarta project. Servlet and JSP are more efficient than notes/domino agents because they need to be loaded only when they are first used; in comparison, the Java proxy is reloaded every time it is invoked, so they consume more CPU processing time. Starting with JSP version 1.1, the JSP customization tag is added, and you don't need to write code logic in the JSP, so you can simply use the JSP as a presentation layer.

EJBs are usually associated with the Java EE application. They provide a way to encapsulate database access and business logic so that distribution can be implemented on multiple servers. After the process is properly completed, database access is hidden behind the business logic object, so developers of Web sites that use JSP do not know how to organize the database.

One of the sources of the powerful feature of Java EE is that it can divide a hierarchy into separate servers. Although Domino can run all the representations/ui layers on the database, business, and WEB servers, Java EE can divide the three parts onto different servers. In addition, clusters can be used in each section, which can have some redundancy at the hierarchy level. Although you can cluster on Domino servers, you cannot do this aggregation very precisely or in depth, so a well-defined Java EE application is inherently more extensive than a similar Domino application because you can extend it to multiple machines. The disadvantage is that the development costs of this technology are higher and more complex.

Using RDBMS databases

As most Domino developers know, putting many fields into a single form can define a domino database. This design is very simple (that is, the design of the form and view does not require a formal design process), or it can be designed using a formal process; You can add any field, especially if you change some fields from single values to multiple values. The size of the field does not need to be specified in advance, but you must know the qualified value of the field size. After creating the form, you can use the view to simply display these fields, including those multivalued fields.

In an RDBMS (relational database management system), you need more effort in the initial database design, because modifying the structure of a table is a very painful thing, mainly because all foreign key links and field sizes must be declared in advance. In some cases, you will also need to delete the table and all the data in the table, modify the database design, and then reload the data.

A more in-depth discussion of multivalued fields is required. You typically map a Domino document to a row of data in an RDBMS table. Each field in the Domino document can be mapped to a column in the table. However, each column in a table (that is, each field) can store only one value. In an RDBMS, you need to create a separate table with two columns. A column is linked to the form using a foreign key (one row in the table). The other column links to another table that lists all possible values for this multivalued field.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.