 |
建站必读 |
 |
|
|
|
| |
| 当前位置:首页 -> 建站必读 -> JSP技术 |
|
不是一个跳转的概念 |
如果看过jsp生成的servlet的话,forward是这么得来的:
JspFactory factory = JspFactory.getDefaultFactory();
PageContext pageContext = factory.getPageContext(this,request,response,null,false,JspWriter.DEFAULT_BUFFER,true);
pageContext.forward("...");
什么又是PageContext呢?
A PageContext instance provides access to all the namespaces associated with a JSP page, provides access to several page attributes, as well as a layer above the implementation details.
这是api上的解释,我的感觉呢,就是PageContext控制jsp中所有的缺省属性,包括request,response,out,session等等。既然可以把这些属性取出来,也可以把这些属性加进去,如果我加入这些属性再加载一个jsp会怎么样呢?这就是forward的形成。
|
| |
|
| |
本站关键词: |
|
|
|
|
|