在我的应用程序中,我使用 java Live connect api 在浏览器中加载 javafx 应用程序,并使用http://docs.oracle.com/javafx/2/deployment/deployment_toolkit.htm中提到的 dtjava.js 通过 jsp 访问 fx 应用程序。参考 fx application(Id="app") 我正在使用 html/javascript 按钮访问 fx 主类方法
function javafxEmbed() {
dtjava.embed(
{
url : 'abc.jnlp',
placeholder : 'javafx-app-placeholder',
id:'app',
width : 550,
height : 344,
jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxqbmxwIHNwZWM9IjEuMCIgeG1sbnM6amZ4PSJodHRwOi8vamF2YWZ4LmNvbSIgaHJlZj0iRWNhcHR1cmVfVGhpY2tDbGllbnRfV2ViLmpubHAiPg0KICA8aW5mb3JtYXRpb24+DQogICAgPHRpdGxlPkVjYXB0dXJlX1RoaWNrQ2xpZW50X1dlYjwvdGl0bGU+DQogICAgPHZlbmRvcj5yYWp1LnQ8L3ZlbmRvcj4NCiAgICA8ZGVzY3JpcHRpb24+U2FtcGxlIEphdmFGWCAyLjAgYXBwbGljYXRpb24uPC9kZXNjcmlwdGlvbj4NCiAgICA8b2ZmbGluZS1hbGxvd2VkLz4NCiAgPC9pbmZvcm1hdGlvbj4NCiAgPHJlc291cmNlcz4NCiAgICA8amZ4OmphdmFmeC1ydW50aW1lIHZlcnNpb249IjIuMisiIGhyZWY9Imh0dHA6Ly9qYXZhZGwuc3VuLmNvbS93ZWJhcHBzL2Rvd25sb2FkL0dldEZpbGUvamF2YWZ4LWxhdGVzdC93aW5kb3dzLWk1ODYvamF2YWZ4Mi5qbmxwIi8+DQogIDwvcmVzb3VyY2VzPg0KICA8cmVzb3VyY2VzPg0KICAgIDxqMnNlIHZlcnNpb249IjEuNisiIGhyZWY9Imh0dHA6Ly9qYXZhLnN1bi5jb20vcHJvZHVjdHMvYXV0b2RsL2oyc2UiLz4NCiAgICA8amFyIGhyZWY9IkVjYXB0dXJlX1RoaWNrQ2xpZW50X1dlYi5qYXIiIHNpemU9IjcxMDM5IiBkb3dubG9hZD0iZWFnZXIiIC8+DQogICAgPGphciBocmVmPSJsaWIvamFpLWNvcmUtMS4xLjMtYWxwaGEuamFyIiBzaXplPSIxMzcwODIyIiBkb3dubG9hZD0iZWFnZXIiIC8+DQogICAgPGphciBocmVmPSJsaWIvamFpX2NvZGVjLTEuMS4zLWFscGhhLmphciIgc2l6ZT0iMTg5MDExIiBkb3dubG9hZD0iZWFnZXIiIC8+DQogICAgPGphciBocmVmPSJsaWIvamFpX2ltYWdlaW8tMS4xLWFscGhhLmphciIgc2l6ZT0iODAzMzQ1IiBkb3dubG9hZD0iZWFnZXIiIC8+DQogIDwvcmVzb3VyY2VzPg0KPHNlY3VyaXR5Pg0KICA8YWxsLXBlcm1pc3Npb25zLz4NCjwvc2VjdXJpdHk+DQogIDxhcHBsZXQtZGVzYyAgd2lkdGg9IjgwMCIgaGVpZ2h0PSI2MDAiIG1haW4tY2xhc3M9ImNvbS5qYXZhZngubWFpbi5Ob0phdmFGWEZhbGxiYWNrIiAgbmFtZT0iRWNhcHR1cmVfVGhpY2tDbGllbnRfV2ViIiA+DQogICAgPHBhcmFtIG5hbWU9InJlcXVpcmVkRlhWZXJzaW9uIiB2YWx1ZT0iMi4yKyIvPg0KICA8L2FwcGxldC1kZXNjPg0KICA8amZ4OmphdmFmeC1kZXNjICB3aWR0aD0iODAwIiBoZWlnaHQ9IjYwMCIgbWFpbi1jbGFzcz0iZWNhcHR1cmVfdGhpY2tjbGllbnRfd2ViLkVjYXB0dXJlX1RoaWNrQ2xpZW50X1dlYiIgIG5hbWU9IkVjYXB0dXJlX1RoaWNrQ2xpZW50X1dlYiIgLz4NCiAgPHVwZGF0ZSBjaGVjaz0iYWx3YXlzIi8+DQo8L2pubHA+DQo='
},
{
javafx : '2.2+'
}
);
app.methodname() 直到没问题。
但是如果这些方法正在访问,我将无法访问这些方法
JSONArray 数组 = 新 JSONArray();
(所有 jar 都已登录)我在从 broser html 按钮访问 json jar(json-lib-2.3-jdk15.jar)或 org.apache.commons.httpclient.jar 时遇到问题)。
在 java 调试控制台中获得响应,如
有什么建议吗?