Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(50 Marks) Structured Question Answer ALL TWO (2) questions. Write all your answers in the answer booklet. Question 3 (25 marks) a) JavaBean is an

image text in transcribedimage text in transcribedimage text in transcribed

(50 Marks) Structured Question Answer ALL TWO (2) questions. Write all your answers in the answer booklet. Question 3 (25 marks) a) JavaBean is an ordinary Java class that conforms to several rules. Describe THREE (3) of the rules. (3 marks) b) Program 3.1 shows an incomplete code for JavaBean class (Employee.java). Complete the code for JavaBean Employee which conforms with all the JavaBean rules. (6 marks) 7/Program 3.1: JavaBean Employee.java (answer for 03.b. i) package Model (answer for Q3.b.ii) public class private String employeeName; private int salary: (answer for Q3.b.iii) //constructor //getters & setters public void set EmployeeName (String employeeName) { this.employeeName = employeeName; public void setSalary(int salary) ( this.salary - salary: } (answer for 03.b. iv) }//end of JavaBean Employee c) Complete the code in pageSet.jsp, by using a JSP action elements syntax to create a bean object from class Employee in (b) with the following specifications and then forward the request to pageDisplay.jsp: bean name : employee employeeName: John Doe salary: 3500 bean scope: request (6 marks) //---complete your code for 3(c) here--- d) Complete the code in page Display.jsp, by using a JSP action elements syntax, to display the bean values that you have created in (c) above. (4 marks) //---complete your code for 3 (d) here--- e) Given the Program 3.2 (Appliance.java) and Program 3.3 (session.jsp). Change Program 3.3 which is using JSP scripting elements into JSP action clements. Complete the code in Program 3.4. (6 marks) // Program 3.2: Appliance.java package Model; public class Appliance implements Serializable private String name; private String brand; //the detail Javabean implementation is omitted for brevity 2 1 2 3 4 5 // Program 3.3 - session.jsp (Scripting elements) 7 8 Appliance app = new Appliance(); 9 app.setName ("Fridge"); 10 app.setBrand ("Samsung"); 11 12 session.setAttribute("appliances", app); 13 14 15 16 17 1 18 JSP Page 19 20 21 22 |

Appliance Name:

23

Brand :

24 25 26 27 1 // Program 3.4 - session.jsp 2 (Action elements) 3 4 5 6 7 JSP Page 8 9 10 11 12 // ---complete your code for 0.3(e) here--- 13 14 15 16 17 18 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

Express empathy in a businesslike way.

Answered: 1 week ago

Question

5. Tell how job experiences can be used for skill development.

Answered: 1 week ago

Question

4. Explain the characteristics of successful mentoring programs.

Answered: 1 week ago