Cannot get FORM Data
I have created a form in aem using core form container and have defined two fields username and password.I want to get this data inside a servlet.
@Override
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException{
String groupName="Janhavi";
String userName = request.getRequestParameter("userName").getString();
String password= request.getRequestParameter("password").getString();
this is my function to get username and password. When I am creating static user and password the code works fine but when I use the above mentioned function I am not able to get data from the Form.
is there any issue in request.getRequestParameter or is there any other method to retrive Form Data?
Thank you in advance