Generation of nodes based on the values entered in the dialog of a component ??
Hi All,
I have a parent component at /apps/project/component/content/parentComponent . with the help of this component . I am selecting one or more of 3 different components(we can call them children components).
Generally what happens is that when i open and configure the dialog of this parentComponent, a node of name parentComponent gets created in the CRXDE. but since I am specifying all my children components also in this same dialog , I want the nodes of those children components also to be created below the parentComponent after OK button is clicked.
My thought process is to override the default servlet which gets called on click of OK button..
I have tried to create my own custom servlet but somehow it is not getting called.
Below is my custom servlet skeleton:
@Component(metatype = false)
@SlingServlet(resourceTypes = "apps/project/components/content/parentComponent /parentComponent ",extensions = "html", methods = {"POST"}, generateComponent = false)
public class MyServlet extends SlingAllMethodsServlet {
private final static org.slf4j.Logger logger = LoggerFactory.getLogger(MyServlet .class);
@Override
protected void doPost(final SlingHttpServletRequest request, final SlingHttpServletResponse response)
throws ServletException, IOException {
logger.debug("MyServlet ::doPost()");
System.out.println("POST!!");
response.getWriter().write("Hello MyServlet World!");
}
}
Am I missing sth ??
Pls help me with this.
Thanks
~Ashish