* @param res servlet response to any needed error messages.
*/
private Page getSubPage(HttpServletRequest req, HttpServletResponse res)
throws Exception
{
CauchoRequest cauchoRequest = null;
initGetPage();
/*
if (! _webApp.isActive())
throw new UnavailableException("JSP compilation unavailable during restart", 10);
*/
if (req instanceof CauchoRequest)
cauchoRequest = (CauchoRequest) req;
String servletPath;
if (cauchoRequest != null)
servletPath = cauchoRequest.getPageServletPath();
else
servletPath = RequestAdapter.getPageServletPath(req);
if (servletPath == null)
servletPath = "/";
String uri;
String pageURI;
if (cauchoRequest != null)
uri = cauchoRequest.getPageURI();
else
uri = RequestAdapter.getPageURI(req);
Path appDir = _webApp.getAppDir();
String realPath;
Path subcontext;
Page page;
ServletConfig config = null;
String jspPath = (String) req.getAttribute("caucho.jsp.jsp-file");
if (jspPath != null) {
req.removeAttribute("caucho.jsp.jsp-file");
subcontext = getPagePath(jspPath);
return _manager.getPage(uri, jspPath, subcontext, config);
}
String pathInfo;
if (cauchoRequest != null)
pathInfo = cauchoRequest.getPagePathInfo();
else
pathInfo = RequestAdapter.getPagePathInfo(req);
subcontext = getPagePath(servletPath);
if (subcontext != null)