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

Redirect from a Apache Sling Servlet

Avatar

Level 2

Hi All,

I have a servlet with URL /bin/redirectServlet. In this servlet I just want to redirect from to some other page using RequestDispatcher.

 

RequestDispatcher rd = request.getRequestDispatcher("/content/<app_name>/<page>/<sub_page>.html"); //here request is SlingHttpServletRequest since it is a sling servlet. try { rd.forward(request, response);

But it is not doing anything for me. Please help me out.

This is a simple page redirect.

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10
2 Replies

Avatar

Correct answer by
Level 10

Avatar

Level 1
RequestDispatcher rd = request.getRequestDispatcher("/content/<app_name>/<page>/<sub_page>.html"); //here request is SlingHttpServletRequest since it is a sling servlet. try {