zhangwenjun8045 发表于 2013-2-6 08:43:05

基础设施对象Infrastructure

1.获取应用程序的虚拟目录名称
String contextPath=this.getRequestCycle().getInfrastructure().getContextPath()
返回的字符串为“/app”

2.获取和jsp中对应的request和response对象
WebRequest request=this.getRequestCycle().getInfrastructure().getRequest();
WebResponse response=this.getRequestCycle.getInfrastructure().getResponse();

3.获取和jsp中对应的session对象
WebSession session=this.getRequestCycle().getInfrastructure().getRequest().getSession(false)
页: [1]
查看完整版本: 基础设施对象Infrastructure