• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between @include and RequestDispatcher.include()

 
Fintan Conway
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Simple question (hopefully). Is there a difference between using the include directive and RequestDispatcher.include().

E.g.

vs


Thanks
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>Simple question (hopefully)
Simple answer.

>Is there a difference between using the include directive and RequestDispatcher.include().
Yes.

>Thanks
You're welcome.




.......

What?
You're still here?
Why are you looking at me like that?

Ok... fine...: go look at include directive vs include tag
 
Fintan Conway
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stefan Evans wrote:
Ok... fine...: go look at include directive vs include tag

Thanks for this.

Where does the RequestDispatcher fit into this scenario?

Can it be replaced by <@ include "header.jsp">? or by <jsp:include "header.jsp" />?

Or is it a different beast altogether?

Thanks again,

Fintan
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The <jsp:include> tag is synonymous with the RequestDispatcher include method.

On a JSP page, the <jsp:include> tag is preferred to using the request dispatcher manually.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!