tailieunhanh - Writing Enterprise Applications with Java™ 2 SDK, Enterprise Edition phần 7
Ví dụ này sử dụng một trang servlet và HTML để cuốn sách này không nên được kiểm tra. Kiểm tra hộp này tạo ra một tập tin JAR triển khai với các thông tin cần thiết cho một ứng dụng độc lập. • Click Next. • Hãy chắc chắn rằng tên JNDI hiển thị cho calcs CalcBean và tiền thưởng cho BonusBean. Nếu họ không, gõ tên JNDI vào chính mình, và nhấn phím Return. | 71 SEPTEMBER 27 2000 Bonus Calculation Social Security number retrieved 777777777 Bonus Amount Retrieved If you supply the same social security number twice you will see something similar to this Bonus Calculation Soc Sec passed in 777777777 Multiplier passed in 2 Error Duplicate primary key More Information Another way to use JavaServer pages technology is in combination with JavaBeans technology where the JSP page presents a form to the user and calls on the JavaBean to process the data entered on the form. You can see an example at the following URL http j2ee j2sdkee techdocs guides ejb html 10649 This next URL takes you to an article with a great explanation of JavaServer pages and JavaBeans technologies Building Your own JSP Components http viewsource fields_jspcomp LESSON4 JAVASERVER PAGES TECHNOLOGY 72 SEPTEMBER 27 2000 LESSON4 JAVASERVER PAGES TECHNOLOGY SEPTEMBER 27 2000 73 Lesson 5 Adding JavaBeans Technology to the Mix You can use JavaBeans technology to put a JavaBean between the JSP page and caicBean session bean to get a better Model View Controller MVC separation. MVC is a design pattern that consists of three kinds of objects. The Model provides the application business logic the View is its screen presentation and the Controller is an object that manages what happens when the user interacts with the View. A design pattern describes a recurring problem and its solution where the solution is never exactly the same for every recurrence. Lesson 4 JavaServer Pages Technology page 61 is set up so the HTML and JSP pages provide the screen presentation View and manage what happens when the user interacts with the data Controller . The entity and session bean BonusBean and caicBean are the application objects or Model. This lesson uses a JSP page for the screen presentation View a JavaBean to manage what happens when the user interacts with the View Controller and the entity and .
đang nạp các trang xem trước