TAILIEUCHUNG - Writing Enterprise Applications with Java™ 2 SDK, Enterprise Edition phần 8

• Click Next. Hãy chắc chắn rằng tên gốc bối cảnh cho thấy BonusRoot. Nếu không, gõ vào chính mình và nhấn phím Return. • Click Next. • Nhấn Finish để bắt đầu triển khai. Một hộp thoại sẽ xuất hiện hiển thị trạng thái Ứng dụng viết bằng ngôn ngữ lập trình Java chạy trên Unix. XML DOM HTTP SAX Ứng dụng được viết bằng C + + chạy trên Windows. | 83 SEPTEMBER 27 2000 Getter methods follow the same naming conventions as setter methods so the JSP page can retrieve data from the methods always have a return value and no arguments. You might notice that although the getBonusAmt method sets property values and does not really need to return a value in this example it returns to avoid a runtime J2EE server error. The getBonusAmt method uses an if-eise statement to handle the case where no strMult value is supplied. When the JSP page is first loaded the end user has not supplied any data but all tags and scriptlets on the page are executed anyway. In this event the data value for the strMult property passed to JBonusBean is null which results in a null multiplier and a null bonusAmt value. A runtime server error occurs when the JSP page gets and tries to display the null bonusAmt value. To prevent this runtime error bonusAmt is set to 0 in the event a null strMult value is received from the JSP page. public double getBonusAmt if strMult null Integer integerMult new Integer strMult int multiplier try double bonus Calc theCalculation Bonus theBonus multiplier bonus socsec Bonus record socsec bonusAmt socsec catch e message catch e catch e return else 0 None. return public String getMessage LESSON 5 ADDING JAVABEANS TECHNOLOGY TO THE MIX 84 SEPTEMBER 27 2000 return public String getSocsec return public String getStrMult return public void setSocsec String socsec socsec public void setStrMult String strMult strMult Start the Platform and Tools To run this example you need to start the J2EE server the Deploy tool and

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.