How to include self created Java files in Java agent

只愿长相守 提交于 2020-08-08 07:29:36

问题


In IBM Notes if I create a Java Agent, how do I then include my own created java files:

So I created a cxmlCustom package and this I want to include in to the profileResponse. Note that import cxmCustom in the Java agent does not work..

Next to this I use the java class: Statuscode so that I can create an object which has for example these values:

Statuscode = 406
Text = Not Acceptable
Meaning = more text

In the class StatusCodesList in which I create a bunch of statuscode objects and save these created statuscode objects in a array.

In my profileResponse I want to retrieve this objects. Later on in other Agents I reuse this statuscodelist class.. I want to know if this is a good way to do this?


回答1:


You can't use Java classes or Jars definied in Designer's Code section in Java Agents. They are only usable for XPages.

You have to copy your Java classes into your Java agent.
Or, you can create a Script library of type Java and add your Java classes there and add this Script library to your Java agent.
Or, you create a jar file from your Java classes and use it like described here: https://stackoverflow.com/a/27335314/2065611




回答2:


Here's what I did...I put the general use code in a script library (rather than the java folder as you have.) Then when I need it in an agent, I can import the script librar(y/ies) as I need it/them.



来源:https://stackoverflow.com/questions/43371591/how-to-include-self-created-java-files-in-java-agent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!