JSP ページを実行しようとすると、「タイプのみをインポートできます」というエラー メッセージが表示されます。
次のエラーが表示されます。
1 つのバンドルを作成し、felix コンソールにインストールしました。バンドルのステータスもアクティブです。また、サービス コンソールとコンポーネント コンソールの両方で利用できます。
com.adobe.cq バンドルの TestServiceImpl クラスは次のとおりです。
package com.adobe.cq;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
import javax.jcr.RepositoryException;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Properties;
//src.component
//declares the class component. This will provide a wrapped ManagedService component in the OSGI container.
//src.service interface="SampleService"
//declares the service we are offering. Actually, the interface attribute is superflous, as by default, all implemented Interfaces are used.
/**
@scr.component
@scr.service interface="testService"
*/
@Component(immediate = true, metatype = true)
@Service
@Properties( {
@Property(name = "service.description", value = "abcd"),
@Property(name = "label", value = "myLabel") })
public class TestServiceImpl implements TestService {
public String sayHello() {
return "Hello World!";
}
}
これが私のjspコードです。
<%@include file="/libs/foundation/global.jsp"%><%
%><%@include file="/apps/mine/includes/functions.jsp"%><%
%><%@ page import="com.adobe.cq.TestServiceImpl,
org.apache.sling.api.SlingHttpServletRequest,
java.util.List"%><%
%><%
SlingHttpServletRequest r = (SlingHttpServletRequest)request;
TestServiceImpl testService = sling.getService(TestServiceImpl.class);
out.println("testService:::"+testService);
%>
<div id="te-nav" style="display:block !important;">
</div>
TestServiceImpl クラスでアノテーションを使用しているからでしょうか。
修正方法を教えてください。
よろしく、アンダーソン