0

I am trying to modify Openmrs rest call given at this link: https://github.com/openmrs/openmrs-module-webservices.rest/blob/master/omod-common/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/controller/SessionController.java

It imports a spring framework org.springframework.web.context.request.WebRequest in the code. I am not able to track where in the openmrs repo is the class implementing this interface WebRequest.

The openmrs repo is given on this link -https://github.com/openmrs/openmrs-module-webservices.rest

Till now I have come across this small line on Openmrs wiki that says- All of our services are interfaces. The default implementation of these services are named *ServiceImpl.java. The implementations can be found in the impl directory of the api package.

Can anyone help me in figuring out how to find the implementation class ?

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
Kartik Jain
  • 109
  • 2
  • 9
  • 1
    And why should there be an implementation of that interface? Spring provides an implementation of that class and when using the library you should, ideally, be programming against interfaces. – M. Deinum Oct 09 '14 at 09:27

1 Answers1

0

It is Spring's interface. So Spring create and inject some implementation of it.

import org.springframework.web.context.request.WebRequest;

If you can run and debug the code, put breakpoint into this controller, make request to this endpoint and than you can figure out implementation class.

It will be one of these classes according documentation: DispatcherServletWebRequest, FacesWebRequest, NoSupportAsyncWebRequest, PortletWebRequest, ServletWebRequest, StandardServletAsyncWebRequest

By quick find, I couldn't find servlet configuration in that repo. So really don't know which of this classes it would be. DispatcherServletWebRequest is most common because Spring MVC is mostly used with Spring's DispatcherServlet filter.

luboskrnac
  • 23,973
  • 10
  • 81
  • 92