Hi Team,
I have changed the method from GET to POST in HTML form ...I am getting the following error
“javax.jcr.nodetype.ConstraintViolationException: no matching property definition found
When i hit the submit button.
Any pointer here??
Regards,
Sathya
Views
Replies
Total Likes
Hi Sathya,
Are you using sling servlet using ajax?
did you checked Adobe Experience Manager Help | Submitting Adobe Experience Manager form data to Java Sling Servlets for reference?
Regards,
Prince
Views
Replies
Total Likes
Yes Prince.. you are ryt..I am using ajax
Views
Replies
Total Likes
Can you share POST body of AJAX?
This is the exact problem you are facing:- AJAX POST Method Call error : javax.jcr.nodetype.ConstraintViolationException
//If the property name contains a namespace, and the namespace isn't there, JCR tries to create the namespace for you. But if you don't have enough permissions to do so, it will throw this kind of exception. Don't post JSON string, but rather simple form-like data. This will work fine then.
Also, When posting data from an HTML form to AEM - post the data to a Sling Servlet using AJAX. See this community article:
https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html
~kautuk
Views
Replies
Total Likes
dataVal = {"fname": fname, "phoneno": phoneno, "email": email, "state": state, "city": city, "alterphoneno": alterphoneno, "coatchingfor": coatchingfor, "pagetitle": hdenbpgtitle, "bpgtitle": bpgtitle, "utm_param": fullpageurl};
$.ajax({
async: false,
type: "POST",
url: urls,
data: dataVal,
success: function (msg) {
if (JSON.stringify(msg.success)) {
var leadid = msg.LeadID;
$('form').attr('action', '/content/pagepath?id=" + leadid);
} else {
alert('Sorry, Try again');
return false;
}
}
Views
Replies
Total Likes
See the article that Prince pointed you to. You will learn how to post values to an Experience Manager Sling Servlet.
Views
Replies
Total Likes
Hi ,
I am trying post the values to third party web services API and will get success message with unique id...
able to success message as well as id but when i try to pass the same with URL ..its throwing a above message ...
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies