我刚开始使用AEM,需要以编程方式创建用户。网上有许多利用User Manager类的资源,但似乎我无法将jackrabbit libs导入到我的JSP文件中:
<%@ page session="false" %>
<%@ include file="/libs/foundation/global.jsp"%>
<%@ page import="org.apache.sling.jcr.api.SlingRepository" %>
<%@ page import="com.day.cq.security.UserManager" %>
<%@ page import="com.day.cq.security.UserManagerFactory" %>
<%@ page import="com.day.cq.security.User" %>
<%@ page import="com.day.cq.security.Authorizable" %>
<%@ page import="com.day.cq.security.profile.Profile" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="org.apache.sling.commons.json.io.*" %>
<%@ page import="com.day.cq.commons.TidyJSONWriter" %>
<%@ page import="org.apache.jackrabbit.api.security.user.Authorizable"%>
<%@ page import="org.apache.jackrabbit.api.security.user.Group"%>
<%@ page contentType="application/json" %>
<%
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
String email = request.getParameter("email");
JSONWriter writer = new JSONWriter(response.getWriter());
writer.object();
writer.key("Email");
writer.value(email);
writer.key("Code");
writer.value("fred");
writer.endObject();
%>
当我添加jackrabbit libs时,jsp失败了。我检查了系统/控制台/捆绑包,它们似乎就在那里。