Hi,
I would like to get some suggestions on implementing a solution that invokes ejb methods based on the parameters I pass to a servlet.
I have a web project and an ejb 3.0 project. The ejbs are invoked from the servlet in the web project.
The ejbs are invoked based on the parameters I pass to the servlet. For every action I need to perform, I pass a definite parameter say, task to the servlet. For example, if the task equals fetchEmployee, it will invoke a specific method of a bean for eg:- fetchEmployeeDetails().If the task equals deleteEmployee, it should invoke a different bean method.
I have the following options:
if/else or switch case method. This is becoming messy and unmanageable when the number of tasks increased like anything.
mapping the tasks and the bean classes in an xml config file, and then read it using Digester
Using a ServletFilter to perform some action based on the parameters passed.
Can someone kindly suggest a clean/elegant method to implement this?