I have one Servlet name EditEvent and one JSP which contains two forms.
One for adding new event, The other one is for removing an event.
Is it considered as good practice to be using two separate servlets to handle one JSP?
If not, how would you handle two post requests from one servlet? i.e The Add event and remove event request.
cheers
For handling multiple requests by same servlet you have to make a contract to have a request parameter like ‘ACTION’. Then in your forms add this as hidden field with values like ‘ADD’ and ‘REMOVE’. So, in doPost() you can check this parameter value and can invoke respective handling methods in same servlet.