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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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
Community Advisor
2 Replies

Avatar

Correct answer by
Community Advisor

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 {