2

I have a page called story.jsp (this is the parent page) & in story.jsp, based on certain condition I am forwarding (using jsp:forward) the page to some other story page path like ../business/story.jsp.

So in this scenario please let me know, whether the response again comes to the parent page or it will execute the ../business/story.jsp & serve to the browser
or
it will come to the parent story.jsp & execute its contents as well.

I am totally confused please help me.

Please let me know the details.

4

1 回答 1

3

顾名思义,当您执行forward( ) 时,它将转发请求,即终止当前页面的执行并将所有控制权转移到它已转发到的下一个 jsp。所以浏览器只会提供你的内容。jsp:forwardstory.jsp../business/story.jsp

其中,如果您执行include( jsp:include),则顾名思义,在执行包含的页面后,控件将转移回您的父页面,即浏览器将提供两个 JSP 的内容。

于 2012-08-01T10:27:18.240 回答