private boolean adjustRequestPath(BundledHttpServletRequestWrapper request,
HttpServletResponseWrapper response) throws IOException {
IPath path = new Path(request.getServletPath());
String welcomePagePath = null;
IWABServletContext hostServletCtx = getFwkContainer()
.findHostServletContext();
// Try to process under host bundle servlet context at first.
if (hostServletCtx != null) {
// Adjust a resource directory path suffixed with "/" if need.
if (!request.getServletPath().endsWith("/")
&& getFwkContainerHelper().checkIsResourceDir(
hostServletCtx, path)) {
response.sendRedirect(request.getRequestURI() + "/");
return false;
}
welcomePagePath = getFwkContainerHelper().tryRedirectToWelcomPage(
hostServletCtx, path);
if (welcomePagePath != null)
request.setServletPath(path.append(welcomePagePath)
.toPortableString());
}
// Then find a target bundle context.
if (welcomePagePath == null && path.segmentCount() > 0) {
IWABServletContext tarBundleServletCtx = getFwkContainer()
.getBundledServletContext(path.segment(0));
if (tarBundleServletCtx != null) {
// Adjust a resource directory path suffixed with "/" if need.
if (!request.getServletPath().endsWith("/")
&& getFwkContainerHelper().checkIsResourceDir(