万网公司注册网站,合肥建站网站,深圳东门解封了吗,网站建设栏目规划adf4351使用方法众所周知#xff0c;可以通过某些URL直接从浏览器或某些外部应用程序调用有限任务流。 如果任务流的属性“ URL invoke”设置为“ URL-invoke-allowed”#xff0c;则启用此功能#xff0c;该功能通常在集成项目中使用。 通常#xff0c;客户端#xff08;… adf4351使用方法 众所周知可以通过某些URL直接从浏览器或某些外部应用程序调用有限任务流。 如果任务流的属性“ URL invoke”设置为“ URL-invoke-allowed”则启用此功能该功能通常在集成项目中使用。 通常客户端或调用者使用HTTP GET方法并在URL中传递其参数。 让我们考虑一个带有一个必需输入参数的简单任务流 task-flow-definition idtask-flow-definition input-parameter-definition id__23name id__24userName/namevalue id__67#{requestScope.userName}/valueclass id__63java.lang.String/classrequired//input-parameter-definition ... 可以通过这样的URL调用任务流 http://127.0.0.1:7101/TestApp/faces/adf.task-flow?adf.tfIdtask-flow-definitionadf.tfDoc/WEB-INF/task-flow-definition.xmluserNamexammer 客户端使用简单的html表单构造此GET请求 htmlhead meta http-equivContent-Type contenttext/html; charsetUTF-8//headbodyform actionhttp://127.0.0.1:7101/TestApp/faces/adf.task-flowinput typehidden nameadf.tfId valuetask-flow-definition/ input typehidden nameadf.tfDoc value/WEB-INF/task-flow-definition.xml/ label User Name input typetext nameuserName valuexammer/ /labelinput typesubmit valueSubmit//form/body
/html 它看起来像这样 一些客户端更喜欢使用HTTP POST方法这是他们的要求 htmlhead meta http-equivContent-Type contenttext/html; charsetUTF-8//headbodyform actionhttp://127.0.0.1:7101/TestApp/faces/adf.task-flow methodPOSTinput typehidden nameadf.tfId valuetask-flow-definition/ input typehidden nameadf.tfDoc value/WEB-INF/task-flow-definition.xml/ label User Name input typetext nameuserName valuexammer/ /labelinput typesubmit valueSubmit//form/body
/html 而且效果很好。 在这种情况下URL将如下所示 http://127.0.0.1:7101/TestApp/faces/adf.task-flow 所有其他必要的信息例如任务流ID和参数值都在POST请求中。 但是问题在于它仅对R1有效。 如果我们在R2上进行尝试将会得到以下结果 ADF_FACES-30179有关更多信息请参见服务器的错误日志中以下列开头的条目UIViewRoot为空。 PhaseId期间的致命异常RESTORE_VIEW 1。 为什么 因此 oracle.adfinternal.controller.application.InvokeTaskFlowException: ADFC-02006: A task flow ID is not found in the URL.at oracle.adfinternal.controller.util.UrlParams.getTaskFlowInfo(UrlParams.java:144)at oracle.adfinternal.controller.application.RemoteTaskFlowCallRequestHandler.
invokeTaskFlowByUrl(RemoteTaskFlowCallRequestHandler.java:84)at oracle.adfinternal.controller.application.RemoteTaskFlowCallRequestHandler.
doCreateView(RemoteTaskFlowCallRequestHandler.java:63) 本应在POST请求中传递的所有必需数据包括任务流ID都将丢失。 为什么 因为“回送”。 如果在单击“提交”按钮后发现从浏览器发送到服务器的请求我们将看到以下内容 因此服务器不发送“诚实”响应而是发送一些“回送”脚本该脚本生成“窗口ID”并发送以下具有生成的窗口ID的GET请求。 凉 但是所有发布数据都消失了。 GET请求绝对为空。 幸运的是如果初始POST请求已经具有一些“窗口ID”则该框架不会生成任何“环回”。 因此本例的解决方法是开发一个servlet过滤器为我们的请求设置“ window id”属性 public void doFilter(ServletRequest servletRequest,ServletResponse servletResponse,FilterChain filterChain)throws IOException, ServletException
{HttpServletRequest r (HttpServletRequest) servletRequest;HttpSession s r.getSession();//May be this is not an initial request and window id has been generated earlier//We want all the following requests to work with the same window id //For our use-case this is ok String windowID (String) s.getAttribute(_WINDOW_ID_KEY);if (windowID null){String pathInfo r.getPathInfo();//This is an initial POST request to get access to the task flowif ((/adf.task-flow).equals(pathInfo) POST.equals(r.getMethod())){windowID WINDOW_ID;//Save window id in the session s.setAttribute(_WINDOW_ID_KEY, windowID);}}//Setup attribute for the request//This will prevent generating of the loopbackif (windowID ! null)r.setAttribute(_WINDOW_ID_KEY, windowID);filterChain.doFilter(servletRequest, servletResponse);
}private static final String __WINDOW_MANAGER_KEY RichWindowManager.class.getName();
private static final String _WINDOW_ID_KEY __WINDOW_MANAGER_KEY #WINDOW_ID;
private static final String WINDOW_ID wextflow; 请注意此过滤器应位于过滤器链中的“特立尼达”过滤器之前 filterfilter-nameExtPostFilter/filter-namefilter-classcom.cs.fusion.core.view.filter.ExtPostFilter/filter-class/filter filterfilter-nametrinidad/filter-namefilter-classorg.apache.myfaces.trinidad.webapp.TrinidadFilter/filter-class/filterfilterfilter-nameServletADFFilter/filter-namefilter-classoracle.adf.share.http.ServletADFFilter/filter-class/filter 而已 参考来自ADF实践博客的JCG合作伙伴 Eugene Fedorenko 使用HTTP POST方法进行URL任务流调用 。 翻译自: https://www.javacodegeeks.com/2013/08/adf-url-task-flow-call-with-http-post-method.htmladf4351使用方法