Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

form submission servlet

Avatar

Level 4

I have my form as below:

<form action="/bin/mySearchServlet" name="form" method="POST">   
   <input type="hidden" value="${resource.path} name="one">
  <input type="submit" />   
  </form> 

and servlet as below:

@SlingServlet(paths="/bin/mySearchServlet", methods = "POST", metatype=true)

 

Even though the path matches it is not hitting the servlet. Anyone know why?

1 Accepted Solution

Avatar

Correct answer by
Level 10
5 Replies

Avatar

Level 4

Can anyone share package which contains form submission to servlet?

Avatar

Level 10

Hi,

There are many ways to submit the form to the servlet. 

Option 1:
-> To know how to do a Path to register a Servlet see this below our community article discuss the use case.
//https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html(Submitting Adobe Experience Manager form data to Java Sling Servlets)

Option 2:

-> To know how to submit the form using Sling Post Servlets, see this below article.
//https://helpx.adobe.com/experience-manager/using/using-sling-post-servlets.html(Using Sling Post Servlets to submit mobile data to Adobe Experience Manager)

Hope this helps!

~ Ratna.

Avatar

Level 9

Make sure you have configured servlet for authentication not required

Avatar

Level 4

Hi RK

The information you provided is not enough to give you right answer. Please describe it more. If possible share logs/screenshots.

Avatar

Correct answer by
Level 10