Hi All,
We have a simple requirement to slightly manipulate the inbound HTTP POST parameters that come into a ORDS standalone instance. The reason is that we have had to migrate from mod_plsql over to ORDS and found a specific scenario in our ageing application where a form post doesn't match the POST params the same way to the PLSQL function inputs... We are trying to avoid redeveloping the thousands of forms that use this type of post.
We identified that Oracle provide the ability to create and load a plugin in which we have successfully been able to add a java filter to intercept the request.
i.e. https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/21.1/ordjv/doc-files/developer-guide.html
BUT.. (I wouldn't be here if there wasn't a but... )... even though we are modifying the inbound POST variables they do not seem to be being passed through to the PLSQL modified.
I am wondering if anyone has ever done this before?? Oracle support say "the custom plugin and filter related issues are best addressed in community. If it is documented mean it should work".... so here I am.. I have SR 3-29801050661 raised.
=========================
Here are some more details:
In https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/21.1/ordjv/doc-files/developer-guide.html
the guide states under Extension points "Plugins can plug in additional logic at the following extension points: Manipulating HTTP requests and responses by implementing the servlet Filter interface."
I implemented a filter to alter the HttpServletRrequest to resolve the issue using the @Provides(Filter.class) and @Priority(ring = FilterOrder.STREAMING, value = 50) annotations.
The filter jar was built and installed with the "plugin" command and logging confirmed the filter was called and altered the request as expected.
Note: I tried altering the request in 3 different ways (HttpServletRequestWrapper, Proxy and introspection editing of immutable private request data), but none of the variants worked.
Eventually I debugged- to view the request entering ModApex.handleRequest() and despite my filter being executed and the order of calls being as expected the request passed to ModApex was a completely different (and unchanged) instance from that passed to and returned from the filter.
So the question: is there something else I need to configure so the pl/sql gateway gets the filtered request, or is there another supported way of doing this, or can they fix this behaviour.
1. why does the request object instance passed to the filter (and passed along by the filter) get seen by all other filters, but NOT by the ModApex pl/sql gateway which seems to get a completely separate instance without the changes?
2. is there some special config we are missing that would allow it to work?