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

AEM 6.4 form submission to Rest endpoint via sling servlet

Avatar

Avatar
Validate 10
Level 2
sankarr26533925
Level 2

Likes

6 likes

Total Posts

46 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 10
Level 2
sankarr26533925
Level 2

Likes

6 likes

Total Posts

46 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile
sankarr26533925
Level 2

03-12-2019

Scenario :

Adaptive Form-1

Dropdown(Year - Example 2018, 2019, 2020)

Dropdown(TYPE - Example AAA, BBB, CCC)

Create button

Adaptive Form-2

Label(Display form# example AAA-2018-10000)

Requirement:

On click of create button in Form-1, we have to call AEM servlet(pass Year and Type values in Query Params) which in turn invokes third party endpoint and return form# based on user dropdown selection(Year and Type) in Form-1.

Once the response code is 200 from third party end point, we have to redirect to form-2 which displays form# as label.

Please note that AEM servlet will send GET/POST request to third party endpoint and get the response. We should not call the third party endpoint directly from form submission.

Analysis

I tried to invoke AEM servlet using Submit To Rest Endpoint by adding servlet URL into URL for Post request field. However in logs, it is showing as Unauthorized 401 while calling AEM servlet. Please let me know how to implement this requirement.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Ignite 5
Employee
workflowuser
Employee

Likes

135 likes

Total Posts

444 posts

Correct Reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 5
Employee
workflowuser
Employee

Likes

135 likes

Total Posts

444 posts

Correct Reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile
workflowuser
Employee

03-12-2019

when you are calling the servlet in AEM from your form submission, you can add the servlet as shown here from the localhost:4502/system/console/configMgr. Search for Adobe Granite CSRF Filter and add your servlet path in the excluded Paths

1860597_pastedImage_0.png

1860598_pastedImage_1.png

Answers (2)

Answers (2)

Avatar

Avatar
Boost 1
Level 1
guyh59060666
Level 1

Like

1 like

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
guyh59060666
Level 1

Like

1 like

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
guyh59060666
Level 1

16-12-2019

Hi Sankar,

Did you find a solution to the problem?

Avatar

Avatar
Ignite 5
Employee
workflowuser
Employee

Likes

135 likes

Total Posts

444 posts

Correct Reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 5
Employee
workflowuser
Employee

Likes

135 likes

Total Posts

444 posts

Correct Reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile
workflowuser
Employee

03-12-2019

make sure you are able to call the aem servlet from postman