I am currently building a Budget Estimator web application using JSP, Servlets and Apache POI.
I have a servlet file which accepts form inputs from a user and writes budget estimate values into an Excel File based on these inputs after performing some computations. There are 4 different budget categories. I'll be referring to them as A,B,C,D for convenience. The application generates an Excel File which comprises of: 1) Budget summary sheet 2) Separate sheet for each of the 4 categories
Currently, the budget computation code for all these categories is in a single servlet file. I want to split the computation part for these 4 categories into separate servlet files. I want to allow the user to track how much budget is allocated for each category. I am planning to implement this as follows: A button will be placed at the end of each category. When the user clicks that button, a servlet should be called which will perform the budget computations and return the budget estimate for that category which should be displayed on the same webpage (maybe within a text field). Same for categories B,C and D. Eventually, if the user is satisfied with the allocations, he can generate an excel report by clicking on a "Generate report" button. Clicking this button will call the main servlet file will in turn will call 5 different servlets that generate the 5 sheets of the Excel file. The final excel would be generated by binding these 5 sheets together and returned to the user through the main servlet file.
I need advice on how to go about this and efficient ways to accomplish this. Any help is appreciated! Thanks in advance!