Module Servlets
Modules can add any number of http servlets to OpenMRS. Servlets only need to be named unique to the module because all module servlets are accessed via urls like http://.../openmrs/moduleServlet/formEntry/servletName.
Each servlet must be defined in the config.xml file:
<servlet> <servlet-name>forms</servlet-name> <servlet-class>org.openmrs.module.formEntry.web.XsnDownloadServlet</servlet-class> </servlet>
The tag definition is far simpler than the similar definition used in a web.xml file. The servlet-name code> cannot contain a wildcard character. The name can either be the final string in the url, or just the first of many in the url. For example, for the previous definition, the url http://.../openmrs/moduleServlet/formEntry/forms AND http://.../openmrs/moduleServlet/formEntry/forms/15.xsn would be directed to the org.openmrs.module.formEntry.web.XsnDownloadServlet code> class.
The servlet-class is expected to extend the javax.servlet.http.HttpServlet class.
Good Module Design/Layout
In the module structure, Servlets should be placed in the /web/src/... folder.
The Servlet should at least implement both the doGet(HttpServletRequest, HttpServletResponse) code> and doPost(HttpServletRequest, HttpServletResponse) code>
