intra-martのServiceクラスとservice-config.xmlについてです。
Serviceクラスはサービスコントローラを設定するservice-config.xmlに指定する必要があります。
また、ServiceクラスはServiceControllerAdapterクラスをimplementsする必要があります。
また、コンストラクタでsuper();を指定します。
また、serviceメソッドをオーバーライドする必要があります。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
public AAAService implements ServiceControllerAdapter { // コンストラクタ public AAAService() { super(); } public ServiceResult service() throws SystemException, ApplicationException { HttpServiceRequest req = getRequest(); HttpSession sess = req.getSession(false); if (sess == null) { return null; } // 処理 } } |
SystemExceptionはシステム例外、ApplicationExceptionはアプリケーション例外です。
このサービスクラスをservice-config.xmlに登録します。
intra-mart5.xから、コンテキストパス(Application Runtime)/WEB-INF/classes配下に任意のxmlファイルが配置できるようになったようです。
また、service-config-キーワード.xmlというように複数ファイル配置することが可能です。
以下、service-config.xmlの中身です。
1 2 3 4 5 6 7 8 9 10 11 |
<?xml version="1.0" encoding="UTF-8" ?> <service-config> <service> <service-id>AAA001</service-id> <controller-class>jp.co.xxx.AAAService</controller-class> <next-page> <page-path> </next-page> </service> </service-config> |
KHI入社して退社。今はCONFRAGEで正社員です。関西で140-170/80~120万から受け付けております^^
得意技はJS(ES6),Java,AWSの大体のリソースです
コメントはやさしくお願いいたします^^
座右の銘は、「狭き門より入れ」「願わくは、我に七難八苦を与えたまえ」です^^