Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

On form submission getting the following error: javax.jcr.nodetype.ConstraintViolationException: No matching property definition: txn_type = PP

Avatar

Avatar
Validate 1
Level 2
supersoftr30476
Level 2

Likes

3 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
supersoftr30476
Level 2

Likes

3 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
supersoftr30476
Level 2

15-10-2015

Hi,

I've my form as something like this:

t1.jsp:

<%@include file="/libs/foundation/global.jsp"%>
<%@page session="false" %>
<%@ page language="java" %>

<form name="frm" method="POST" id="frm" action="<%=resource.getPath()%>.html">
    <div>Enter your name<input type="text" name="nameX"/></div>
<input type="submit" name="submit" value="test"/>
</form>

 

POST.jsp:

<%@include file="/libs/foundation/global.jsp"%>
<%@ page session="false"%>
<%
String transaction_type = request.getParameter("namex");
log.info("teststttttt"+transaction_type);
%>

 

 

 

I'm getting error:

*ERROR* [127.0.0.1 [1437981615101] POST /content/abc/en/t1.html HTTP/1.1] org.apache.sling.servlets.post.impl.operations.ModifyOperation Exception during response processing.
javax.jcr.nodetype.ConstraintViolationException: No matching property definition: nameX = kjkjkjkj

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

15-10-2015

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

You have much better control over how to process data by writing app logic in the Slign Servlet. IN this example - the posted data is encoded to JSON using the Simple JSON API. 

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 2
supersoftr30476
Level 2

Likes

3 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
supersoftr30476
Level 2

Likes

3 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
supersoftr30476
Level 2

15-10-2015

Thanks Scott,

I have already did that and it worked very smoothly that way, but don't we have any simpler way to submit forms to a jsp file in CQ?

E.g. Suppose if my form is like <form action="submit_form.jsp" method="post">

then this won't work in case of adobe CQ, I just want to post all data of my form to second page and if I use servlets, then it would be bit lengthier to get the data first and then arrange it in proper format and send back to second page.