I'm having some issues upgrading 6.2 Servlets to 6.4. So I tried uploading the WKND packages to see if the SimpleServlet is working:
WKND Packages location = Getting Started with AEM Sites - WKND Tutorial
Looking at the class annotations from the github repo : https://github.com/Adobe-Marketing-Cloud/aem-guides-wknd/blob/39e1309542b2086ac5fc031c4f8ec337f7d0a5...
/**
* Servlet that writes some sample content into the response. It is mounted for
* all resources of a specific Sling resource type. The
* {@link SlingSafeMethodsServlet} shall be used for HTTP methods that are
* idempotent. For write operations use the {@link SlingAllMethodsServlet}.
*/
@Component(service=Servlet.class,
property={
Constants.SERVICE_DESCRIPTION + "=Simple Demo Servlet",
"sling.servlet.methods=" + HttpConstants.METHOD_GET,
"sling.servlet.resourceTypes="+ "wknd/components/structure/page",
"sling.servlet.extensions=" + "txt"
})
public class SimpleServlet extends SlingSafeMethodsServlet {
it seems like the url http://localhost:4502/content/wknd/en.txt
should return just the page title as text.
However, I'm getting a 404 - the servlet does not seem to be registered with Sling.
Any help is greatly appreciated!
Views
Replies
Total Likes
your servlet will be invoked only if node contains sling:resourceType= wknd/components/structure/page
you need to invoke servlet like below
url http://localhost:4502/content/wknd/en/jcr:content.txt
Thanks
Arun
Views
Replies
Total Likes