URL mapping techniques:
Request mapping or the URL mapping is the most important part of any web application development.
Following are the types of techniques used in projects that I am aware of.
Finnacle:
All sorts of URL mapping is done at the Filter level. Filters are normally pre-processing constructs stand before Dispatcher Servlets in the request path.
But, Finnacle(a financial product) provided filters with an additional capability of url mapping to servlets.
Emerging Health System(EHS):
A completely different implementation that I came across. The system uses various front controllers(Dispatcher servlets) such as
Ajax Servlet
Upload Servlet
Image Servlet
Web Servlet: Main servlet for dispatching requests to other EJB objects.
All other servlets except WebServlet have the similar and self-explanatory task of dispatching requests.
Web Servlet(DADA Servlet): This instead of mapping requests through a config file(eg: xml), approach uses a combination of Java's Reflections and Database Table to dynamically execute methods on classes based on request parameters.
The solution is designed in such a way that the requests from front-end contain a static path eg: http://Host:port/ehs/ehsdadaservlet along with parameters.
The URL: /ehs/ehsdadaservlet is mapped to Web Servlet(Dispatcher).
WebServlet then invokes a ProcessHandler by passing it the HttpRequest for further processing.
The request-parameters contain information of which EJB and its method need to be invoked.
The ProcessHandler takes in the request, extracts the parameters, validates the values against database table to fetch appropriate class and its method. And then it invokes the classes and method dynamically with the help of Reflections.
Here the process handlers cannot be called as Controllers as in MVC pattern, since they don't process response and pick view to dispatch back the response.
SpringMVC:
Any springMVC web-application takes advantage of spring-container's @RequestMapping annotations or XML config files to map the request to corresponding controller methods. Dispatcher servlet only dispatches the requests to these controllers.
Request mapping or the URL mapping is the most important part of any web application development.
Following are the types of techniques used in projects that I am aware of.
Finnacle:
All sorts of URL mapping is done at the Filter level. Filters are normally pre-processing constructs stand before Dispatcher Servlets in the request path.
But, Finnacle(a financial product) provided filters with an additional capability of url mapping to servlets.
Emerging Health System(EHS):
A completely different implementation that I came across. The system uses various front controllers(Dispatcher servlets) such as
Ajax Servlet
Upload Servlet
Image Servlet
Web Servlet: Main servlet for dispatching requests to other EJB objects.
All other servlets except WebServlet have the similar and self-explanatory task of dispatching requests.
Web Servlet(DADA Servlet): This instead of mapping requests through a config file(eg: xml), approach uses a combination of Java's Reflections and Database Table to dynamically execute methods on classes based on request parameters.
The solution is designed in such a way that the requests from front-end contain a static path eg: http://Host:port/ehs/ehsdadaservlet along with parameters.
The URL: /ehs/ehsdadaservlet is mapped to Web Servlet(Dispatcher).
WebServlet then invokes a ProcessHandler by passing it the HttpRequest for further processing.
The request-parameters contain information of which EJB and its method need to be invoked.
The ProcessHandler takes in the request, extracts the parameters, validates the values against database table to fetch appropriate class and its method. And then it invokes the classes and method dynamically with the help of Reflections.
Here the process handlers cannot be called as Controllers as in MVC pattern, since they don't process response and pick view to dispatch back the response.
SpringMVC:
Any springMVC web-application takes advantage of spring-container's @RequestMapping annotations or XML config files to map the request to corresponding controller methods. Dispatcher servlet only dispatches the requests to these controllers.
No comments:
Post a Comment