如果看过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的形成。
