- Implement a
BMIController
in a Spring MVC project to process POST requests at/user/bmi
. - The controller will accept height in inches and weight in pounds from the request.
- It will calculate BMI using the formula:
BMI = (weight in pounds / (height in inches)^2) * 703
. - The input JSP page will provide a form for users to enter their height and weight.
- Upon form submission, data is sent to
/user/bmi
via POST. - The controller processes this data, calculates BMI, and prepares the result.
- Using
HttpSession
for maintaining the session for a user.
- For creating a RESTful service to calculate BMI, we'll develop a Spring Boot application that includes a BMIRestController.
- This controller will handle POST requests to the
/bmirest
endpoint. - Users will send their height and weight as parameters in the request body.