在Lotus Notes Xpages按钮中调用Java MVC View方法时出错 [英] Error while calling Java MVC View method in Lotus Notes Xpages button Click
问题描述
我有在Lotus Notes中用Java构建的MVC代码模式. 想要在Lotus Notes Xpages中调用Java视图以使用Lotus Notes Xpages中的oauth2.0对应用程序进行身份验证.
I have MVC code pattern written in java build in Lotus Notes. Wanted to call the java view in Lotus Notes Xpages to authenticate the app using oauth2.0 in lotus notes xpages.
为.net提供的同一SDK我可以在Java xpages中执行需要的帮助.
The same SDK provided for .net i am able to execute need help in java xpages.
JavaMVC中的方法
Method in JavaMVC
@RequestMapping("/connectToABC") 公共视图connectToABC(会话会话)抛出NotesException { 返回新的RedirectView(oauth2Config.prepareUrl(scopes,redirectUri,csrf),true,true,false); }
@RequestMapping("/connectToABC") public View connectToABC(Session session) throws NotesException { return new RedirectView(oauth2Config.prepareUrl(scopes, redirectUri, csrf), true, true, false); }
XPAGES
importPackage(com.abc.developer.sampleapp.oauth2.controller);
importPackage(com.abc.developer.sampleapp.oauth2.controller);
var obj = new OAuth2Controller(); obj.connectToABC(session);
var obj = new OAuth2Controller(); obj.connectToABC(session);
请帮助使用oauth2.0客户端API在xpages中进行身份验证
Please help in authenticating in xpages with oauth2.0 client API
推荐答案
如果它是标准Java API,则该API的有效示例无关紧要.寻找任何标准Java API的有效范例,例如Apache POI.您对集成的疑问将得到回答. Intuit API文档应解决有关使用API的问题.
If it's a standard Java API, working examples of that API are irrelevant. Look for working examples of any standard Java API, e.g. Apache POI. The questions you have on integration will be answered by that. Questions on using the API should be addressed by the Intuit API documentation.
要记住的一个方面是Domino中的标准Java策略有很多限制,特别是Java反射.如果Intuit Java API使用Java反射将JSON转换为Java对象,反之亦然,则您将需要修改Java策略,使用AccessController.doPrivileged
提升权限,或者可能将此类调用和API包装在OSGi插件中.但是您需要尝试,并在必要时进行进一步调查,以验证是否需要这样做.
One aspect to bear in mind is that the standard Java policy in Domino restricts quite a bit, particularly Java reflection. If the Intuit Java API uses Java reflection to convert JSON to Java objects and vice versa, you will need to amend the Java policy, use AccessController.doPrivileged
to elevate permissions or possibly wrap such calls and the API in an OSGi plugin. But you'll need to try and, if necessary, investigate further to verify if you need to do that.
这篇关于在Lotus Notes Xpages按钮中调用Java MVC View方法时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!