1. The document provides instructions for creating a Spring program that accepts a number from the user and checks if it is excellent, very good, good, or average based on ranges.
2. It describes adding Spring dependencies, creating a POJO class to hold the number, defining the beans in an XML configuration file, and writing a main class that gets the bean from the XML file and calls methods to get input, set the number, and check the number range.
3. The program returns a string indicating if the input number is excellent, very good, good, or average.
1. The document provides instructions for creating a Spring program that accepts a number from the user and checks if it is excellent, very good, good, or average based on ranges.
2. It describes adding Spring dependencies, creating a POJO class to hold the number, defining the beans in an XML configuration file, and writing a main class that gets the bean from the XML file and calls methods to get input, set the number, and check the number range.
3. The program returns a string indicating if the input number is excellent, very good, good, or average.
1. The document provides instructions for creating a Spring program that accepts a number from the user and checks if it is excellent, very good, good, or average based on ranges.
2. It describes adding Spring dependencies, creating a POJO class to hold the number, defining the beans in an XML configuration file, and writing a main class that gets the bean from the XML file and calls methods to get input, set the number, and check the number range.
3. The program returns a string indicating if the input number is excellent, very good, good, or average.
1. The document provides instructions for creating a Spring program that accepts a number from the user and checks if it is excellent, very good, good, or average based on ranges.
2. It describes adding Spring dependencies, creating a POJO class to hold the number, defining the beans in an XML configuration file, and writing a main class that gets the bean from the XML file and calls methods to get input, set the number, and check the number range.
3. The program returns a string indicating if the input number is excellent, very good, good, or average.
NUMBER AND CHECK IF NUMBER IS GREATER THAN 80 --- “EXCELLENT” 60-80 ---”Very Good” 40-60 ---- ”Good” Below 40 --- “Average” PROJECT CREATION 1. Create a new java application 2. Right –click on the ‘libraries’ folder and select ‘Add JAR/Folder’ option and add the necessary spring dependencies . POJO CLASS XML FILE 1. Right click on Source Packages and go to New -> Other 2. Search xml document and click next 3. Specify the name of the document 4. Choose ‘Well Formed Document’ and click finish. 5. Paste the schemas given in notes 6. Create a bean inside the <beans></beans> 7. Specify the id and class of bean. MAIN CLASS(SPRINGTASK) 1. Inside main() method , create a reference of ApplicationContext and instantiate it with the object of ClassPathXmlApplicationContext class and pass the name of the xml in the constructor like “example.xml”. 2. Create a reference of the POJO class and instantiate it with getBean() method of ClassPathXmlApplicationContext and pass the id of the bean inside getBean() in “” and typecast it with the POJO class. 3. Create an object of Scanner class to take input from command line and store it in an int variable and pass the variable inside the setter method of the POJO class i.e. GreaterValue 4. Now create a static method checkNumber(GreaterValue num) and pass the object created in step 3 to the method while calling it . View the notes… OUTPUT