Thanks @darius, although it makes perfect sense, it hasn’t worked.
I just prefixed my former URL with /ws as you suggested and I’m still getting an error 404 on it (with or without the .form suffix this time.)
Is there anything else to configure anywhere?
I actually think it’s a bad idea to have your URLS have /ws because by convention that is reserved for webservices calls, why can’t you just append .form or .htm to your URL and not have to break conventions or go through hacks?
@maurya I remember there is something that needs to be done to make this work and we had to do it at some point. If you do remember that “something” please assist us here otherwise I will have to dig somewhere
There is nothing special that needs to be done, I think you’re using an incorrect URL when making the http request, if your controller is mapped to /my/custom/url then in your browser the URL you need to enter should be /openmrs/ws/my/custom/url
So when the page loads, this unique URL is provided to and known by the client side as per the unique configuration through the constants class.
It is finally stored in a config objet that is used all over my Angular controllers:
All this to say that when I want to change the whole thing to using the /ws prefix, it happens in one, and only one, place.
Then I can play around in JS and add/remove the + '.form' to see whether things keep working or not. I left above the comments at the two places where I switch back & forth from a config to the other.
That’s exactly what I was saying, /ws/** is already mapped to the OpenMRS SpringDispatcherServlet, so spring based controllers under the the /ws prefix don’t have to include it again in the request mapping value since that gets stripped off by spring just like you don’t include .form in your request mapping value because spring strips it off but you need to include it in the URL you enter in the browser.