Create a Web application that uses JSF.

Create an Animal class that has a field called name. This class needs to use the annotations @Named and @RequestScoped so you will need the following import statements:

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

Make two qualifiers called CatAnimal and DogAnimal. Create an AnimalController class that will inject either a CatAnimal or a DogAnimal, run tests to make sure both work.

Create a Cat and a Dog class that extends the Animal class. Add a field called speak and set it to meow for the cat and woof for the dog. You will need get and set methods for speak.

Create a page to enter the name of the cat and another page to enter the name of a dog.

Then create a page to display the name entered and what the animal says (speak). You will need one for the cat and one for the dog.

Here is how my project looks: see image.

To run this you will need code in the AnimalController class for either the cat or the dog. So if I set mine up for the cat see image.

and run catDataEntry.xhtml, the results look like this: see image.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.