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

WKND SimpleServlet returns 404

Avatar

Avatar
Validate 1
Level 2
paulm54716093
Level 2

Likes

5 likes

Total Posts

9 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
paulm54716093
Level 2

Likes

5 likes

Total Posts

9 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
paulm54716093
Level 2

12-05-2018

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!

Replies

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,275 likes

Total Posts

3,151 posts

Correct Reply

887 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,275 likes

Total Posts

3,151 posts

Correct Reply

887 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

12-05-2018

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