After doing lot trial and error I got to know that I have to override processForwardConfig
method of TilesRequestProcessor
. And there I have to override the value of path
value of ForwardConfig
object to my new layout i.e. login_chrome
.
Please see below code :
public class CustomizedTileProcessor extends TilesRequestProcessor
{
@Override
protected void processForwardConfig(HttpServletRequest pRequest,
HttpServletResponse pResponse, ForwardConfig pForward)
throws IOException, ServletException
{
if(isChromeBrowser(pRequest))
{
ForwardConfig newForward = new ForwardConfig(pForward.getName(),
pForward.getPath()+"_chrome", pForward.getRedirect(),
pForward.getContextRelative());
super.processForwardConfig(pRequest, pResponse, newForward);
}
else
{
super.processForwardConfig(pRequest, pResponse, pForward);
}
}
}