@SlingServlet(
resourceTypes = "geometrixx/components/homepage",
selectors = "data",
extensions = "html",
methods = {"GET", "POST"},
metatype =true)
public class SimpleServlet extends SlingSafeMethodsServlet {
...
}
要注意的是, 提交POST 请求的时候, 一定要在URL里面添加_jcr_content, 比如:
http://localhost:4502/content/geometrixx/en/_jcr_content.data.html ,否则servlet不会捕获POST请求
详细参考 http://www.aemcq5tutorials.com/tutorials/sling-servlet-in-aem/#sling_servlet_using_selector