Hi,
I found a solution for the my problem. Instead of registering a redirect servlet I registered a redirect servlet filter. This is a new feature of the current Equinox release.
public class RedirectServletFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws ServletException, IOException {
try {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
if( "/".equals( request.getPathInfo() ) ) {
response.sendRedirect( response.encodeRedirectURL( "servlet_name" ) );
}
else {
chain.doFilter(request, response);
}
} catch (ClassCastException e) {
throw new ServletException("non-HTTP request or response");
}
}
public void init(FilterConfig filterConfig) {
}
public void destroy() {
}
}
Register the above Filter:
<extension
point="org.eclipse.equinox.http.registry.filters">
<filter
alias="/"
class="org.example.RedirectServletFilter"
load-on-startup="true">
</filter>
</extension>