try
{
// No path info means that we need to parse request params
// First, look for user in the request params
UserManager userMgr = RollerFactory.getRoller().getUserManager();
String userName = mRequest.getParameter(RequestConstants.USERNAME);
if ( userName == null )
{
// then try remote user
userName = mRequest.getRemoteUser();
}
String handle = mRequest.getParameter(RequestConstants.WEBLOG);
String websiteid = mRequest.getParameter(RequestConstants.WEBLOG_ID);
FolderData folder = getFolder();
if (handle != null && mWebsite == null)
{
mWebsite = userMgr.getWebsiteByHandle(handle);
}
else if (websiteid != null && mWebsite == null )
{
mWebsite = userMgr.getWebsite(websiteid);
}
else if (folder != null && mWebsite == null )
{
mWebsite = folder.getWebsite();
}
// Look for page ID in request params
String pageId = mRequest.getParameter(RequestConstants.PAGE_ID);
if ( pageId != null )
{
mPage = userMgr.getPage(pageId);
}
else if (mWebsite != null)
{
mPage = mWebsite.getDefaultPage();
}