I am writing a reporting application in JSP, HTML, and JS. The top part has several buttons user can click including Retrieve, Save, Add, Delete, and Close. More than one button share some common parts of the program code such as retrieving data from database has to be in Retrieve as well as Delete (delete data and then retrieve). I don't have any model jsp scripts which I should look at so I am now confused if I should write one jsp file for everything or write one jsp for each button. In the first case the program becomes a little bit complicated but no duplicate code. The second choice allows each module having its own but some code such as data retrieval have to be duplicated. What is the best solution?
Thanks,
Shine
Thanks,
Shine