亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將值從 serviceBean(由 extlib REST 服務調用)傳遞回 Notes 文檔

如何將值從 serviceBean(由 extlib REST 服務調用)傳遞回 Notes 文檔

臨摹微笑 2023-06-21 15:11:11
在 Xpages (9.0.1FP9) 中。我正在使用 extlib 從支付網關 (Braintree) 接收 webhook。REST 服務/serviceBean。我從 webhook 獲取包并且可以解析信息。但我無法獲取 JAVA 內部 Domino 會話的句柄,因此我無法創建或更新 Notes 文檔。我的 JAVA 技能有限,所以我被困住了。任何幫助,將不勝感激。Xpage{    <xe:restService id="JSONSearch" pathInfo="test1" state="false">        <xe:this.service>            <xe:customRestService contentType="application/json"                serviceBean="com.mydomain.bt_Webhook1">            </xe:customRestService>        </xe:this.service>    </xe:restService>}package com.mydomain;import java.io.IOException;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import com.ibm.domino.services.ServiceException;import com.ibm.domino.services.rest.RestServiceEngine;import com.ibm.xsp.extlib.component.rest.CustomService;import com.ibm.xsp.extlib.component.rest.CustomServiceBean;import com.braintreegateway.*;import lotus.domino.*;public class bt_Webhook1 extends CustomServiceBean{//=====================================================================    String btMerchantID = "abcdefgh1i2jk3lm";    String btPrivateKey = "abcdefghijkl2mnopq3rstuv4wxyz";    String btPublicKey = "zyxwvutsr1qpo2nm";        BraintreeGateway gateway = new BraintreeGateway(        Environment.SANDBOX,            //Environment.SANDBOX or Environment.PRODUCTION         btMerchantID,                   //Merchant ID        btPublicKey,                    //Public Key        btPrivateKey                    //Private Key    );    //=====================================================================             );
查看完整描述

1 回答

?
www說

TA貢獻1775條經驗 獲得超8個贊

您可以通過session從 XPage 運行時解析對象來獲取它,例如Session s = (Session) ExtLibUtil.resolveVariable("session");

ExtLibUtil給出了他使用FacesContext.


查看完整回答
反對 回復 2023-06-21
  • 1 回答
  • 0 關注
  • 171 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號