问题
I am trying to receive some http POST data in my Oracle Forms app. How can I read this sent POST parameters from my Forms app?
Note: To read http-GET Data I use otherparams like this answer, but is fundamental to send data via POST http method
回答1:
Efectively as @Christian13467 mentioned, for Oracle Forms is very indifferent how HTTP vars were sent, that is using POST or GET Methods.
My solution was to build an string containing all my vars concatenated as in otherparams format, then send it via POST Method. As my first form was contained into another Oracle Forms app, I edited a template file called basejpi.htm, to add a header javascript section with this code:
function sendPostVars(path,params) {
var method = "post";
var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", path);
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", "otherparams");
hiddenField.setAttribute("value", params);
form.appendChild(hiddenField);
document.body.appendChild(form);
form.submit();
}
Then from my first Forms app I called this method via 11g javascript integration function like this:
web.javascript_eval_expr(sendPostVars('http://host2:port/forms/frmservlet','name1=param1+name2=param2'))
Finally I got my parameters read into my second Oracle Forms app.
来源:https://stackoverflow.com/questions/22390278/read-post-data-from-oracle-forms-app