Velocity 的应用示例
//no right to access.//Utilities.debugPrintln("isAdministratorLogined : false");
page = null;
}
//Utilities.debugPrintln("page : " page.getClass().getName());
if(page != null)
{
context.put("function_page",page.getHtml(this, request, response, context));
}
else
{
String msg = "Sorry, this module is for administrator only.
You are not administrator.
context.put("function_page",msg);
}
context.put("page_header",getPageHeaderHTML());
context.put("page_footer",getPageFooterHTML());
Template template = null;
try
{
template = getTemplate("/templates/Modules.htm");
//good
}
catch (ResourceNotFoundException rnfe)
{
Utilities.debugPrintln("ResourceNotFoundException 2");
rnfe.printStackTrace();
}
catch (ParseErrorException pee)
{
Utilities.debugPrintln("ParseErrorException2 " pee.getMessage());
}
catch (Exception e)
{
Utilities.debugPrintln("Exception2 " e.getMessage());
}
return template;
}
文章评论
共有位Admini5网友发表了评论 查看完整内容