基础设施对象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)

你可能感兴趣的:(jsp)