Velocity 的应用示例
boolean logined = false;
String loginaccount = (String) request.getSession(true).getAttribute("loginaccount");
if (loginaccount != null)
{
logined = true;
}
//default page is mainpagepage = mainPage;
if (requestFunctionName == null||requestFunctionName.equalsIgnoreCase("home"))
{
page = mainPage;
}
//no login , can use these pageelse if (requestFunctionName.equalsIgnoreCase("login"))
{
page = new LoginProcessSubPage();
}
else if (requestFunctionName.equalsIgnoreCase("ChangePassword"))
{
page = new ChangePasswordSubPage();
}
else if (requestFunctionName.equalsIgnoreCase("ForgetPassword"))
{
page = new ForgetPassword();
}
else if (requestFunctionName.equalsIgnoreCase("about"))
{
page = new AboutSubPage();
}
else if (requestFunctionName.equalsIgnoreCase("contact"))
{
page = new ContactSubPage();
}
//for other page, need login firstelse if (logined == false)
{
page = new LoginProcessSubPage();
}
else if (requestFunctionName.equalsIgnoreCase("listProgram"))
文章评论
共有位Admini5网友发表了评论 查看完整内容