When i make use of MVC pattern for my J2EE application development, then i have to write if-else blocking in Controller Servlet. How we can avoid writting this? Is there any pattern available to avoid this?
Printable View
When i make use of MVC pattern for my J2EE application development, then i have to write if-else blocking in Controller Servlet. How we can avoid writting this? Is there any pattern available to avoid this?
I got the following answer through one of my friend....
You could try Struts-like. Define some action mappings in a file, and register each of them in a Map.
<action path="/Hello" forward="/pages/Hello.jsp"/>
When your controller gets for example "/Hello.do", it strips ".do", and looks for the corresponding action "/Hello" in its action map.
If-else are then history