第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

在java類(lèi)中將文檔設(shè)置為全局屬性,不起作用

在java類(lèi)中將文檔設(shè)置為全局屬性,不起作用

慕勒3428872 2021-12-01 15:00:05
在我的 Xpages 應(yīng)用程序中,我有一個(gè) java 類(lèi),我想在其中將 Document 設(shè)置為全局屬性并在我的方法中重用。該文檔代表一個(gè) Notes 配置文檔,我只想執(zhí)行一次查找。不幸的是,它沒(méi)有按預(yù)期工作。也許有人可以指導(dǎo)我正確的過(guò)程?首先,我設(shè)置了一個(gè)托管 bean:<managed-bean>    <managed-bean-name>emplDataMining</managed-bean-name>    <managed-bean-class>se.bank.employeeApp.utils.EmployeeDataMining</managed-bean-class>    <managed-bean-scope>view</managed-bean-scope></managed-bean>我的課程包含幾種將轉(zhuǎn)到不同系統(tǒng)的方法。系統(tǒng)的所有 URL 都存儲(chǔ)在 Notes 配置文檔中,我只想加載一次并在這些方法中重復(fù)使用public class EmployeeDataMining implements Serializable{    private static final long serialVersionUID = 1L;    private Document configuration;    //constructor class. not so very special, so I wont post it    public void getConfiguration(){        //setting up database and view        //only 1 document stored in the view so I can hard-code the reference        configuration = vw.getDocumentByKey("ConfigDocument", true);        //... rest of code e.g. setting up httpclient, JSONobj    }    public void collectDataFromSystemX(CloseableHttpClient httpclient, Employee employee, JSONObject JSONobj){        //I wont post all of my code          HttpPost httpPost = new HttpPost(this.configuration.getItemValueString("urlSystemX"));        //this.configuration is null :-?        //..rest of code    }    public void collectDataFromSystemY(CloseableHttpClient httpclient, Employee employee, JSONObject JSONobj){        //I wont post all of my code          HttpPost httpPost = new HttpPost(this.configuration.getItemValueString("urlSystemY"));        //this.configuration is null :-?        //..rest of code    }}我的代碼是從 SSJS 發(fā)起的:emplDataMining.getConfiguration(); emplDataMining.collectDataFromSystemX(//passing in the variables which are setup in getConfiguration method)所以我主要擔(dān)心的是配置文件 Document 沒(méi)有正確設(shè)置或在方法之間交換。有人能告訴我我忽略了什么嗎?
查看完整描述

1 回答

?
天涯盡頭無(wú)女友

TA貢獻(xiàn)1831條經(jīng)驗(yàn) 獲得超9個(gè)贊

有2個(gè)問(wèn)題:

  • 在視圖范圍內(nèi),您打開(kāi)的每個(gè)文檔都會(huì)重新加載 bean。如果它是一個(gè)配置文件,你想使用會(huì)話(huà)范圍

  • 您不能在托管 bean 中存儲(chǔ) Notes 對(duì)象(請(qǐng)求范圍可能有效)。你做什么:在你的 bean 的構(gòu)造函數(shù)中,加載文檔并將字段值提取到 bean 內(nèi)部變量(字符串、列表等)中。那會(huì)給你你想要的


查看完整回答
反對(duì) 回復(fù) 2021-12-01
  • 1 回答
  • 0 關(guān)注
  • 214 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)