我在 CQ5 的 CRXDE 中创建了一个示例包。按照教程中给出的过程进行操作。
但是当我运行页面时,它只是抛出一个异常
An error occurred at line: 6 in the generated java file
Only a type can be imported. com.mycompany.test.HelloWorld resolves to a package
jsp如下:
<%@ page import="com.mycompany.test.HelloWorld"%><%
%><%@ include file="/libs/foundation/global.jsp"%><%
%><% HelloWorld hello = new HelloWorld();%><%
%>
<html>
<body>
<b><%= hello.getString() %></b><br>
</body>
</html>
HelloWorld.java 如下:
包 com.mycompany.test;
public class HelloWorld {
public String getString(){
return "Say Hello to my little friend !!";
}
}
无法弄清楚这里可能有什么问题