Read POST data from Oracle Forms App

本小妞迷上赌 提交于 2020-01-17 04:26:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!