How to pass resorceType/Path in form in AEM

Avatar

Avatar

manikanthar1295

Avatar

manikanthar1295

manikanthar1295

27-02-2019

Hi Team,

I have two fields  like AWB number and Reference number as input text  now

how i need to pass the entered value in text  to sling servlet.

I know if i use ajax i can give the path defined in  slingServlet as URL

$.ajax({

         type: 'POST',   

         url:'/bin/htlSearchServlet',

         data:'id='+ claimId+'&firstName='+ myFirst+'&lastName='+ myLast+'&address='+ address+'&cat='+ cat+'&state='+ state+'&details='+ details+'&date='+ date+'&city='+ city,

         success: function(msg){

           var json = jQuery.parseJSON(msg);

            var msgId=   json.id;

            var lastName = json.lastname;

            var firstName = json.firstname;

             

            $('#ClaimNum').val(msgId);

            $('#json').val("Filed by " + firstName + " " + lastName);  

         }

     });

  });

If i'm not using ajax call

Where i need to specify the resourceType or Path in form.

Please let me know how we can do this.

Regards

Manikantha R

View Entire Topic

Avatar

Avatar

vaibhavs7024655

Avatar

vaibhavs7024655

vaibhavs7024655

28-02-2019

manikanthar12951933 You can set those values to the request parameters and then fetch them in servlet using SlingHttpServletRequest's getRequestParameters(String name) method[1].

Regards,

Vaibhav

[1]

SlingHttpServletRequest (Apache Sling 7 API)