• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Runtime Expression Value in jsp:forward

 
Kamal Tripathi
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Source: Javabeat Mock Exam

Which of the following statements are true about Dynamic Inclusion?
a. In Dynamic Inclusion, when a request is made to the Source, the control is
transferred to the Target resource and the output from the target is included in the
source JSP.
b. The value for the attribute 'page' can be a request-time expression value.
c. In the case of Dynamic inclusion, the target resource can be a Servlet.
d. All the above.


Answer: D. I think answer should have been AC. Since by dynamic inclusion it mean <jsp:include> standard action. And in this case expression is resolved during translation so runtime expression values can't be resolved here. Am I correct in this assessment ??
 
Abdul Rahman
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Kamal,

the answer to your qustion is D. All of the above.
a-In Dynamic Inclusion, when a request is made to the Source, the control is transferred to the Target resource and the output from the target is included in the
source JSP.
In Dynamic Forward, the control is transferred to the Target resource and the output from the source is included in the target JSP.
b - The value for the attribute 'page' can be a request-time expression value.
This is because the inclusion happens during runtime when the resource is being requested. so the rtexpr value is evaluated.
c- In the case of Dynamic inclusion, the target resource can be a Servlet.
In static inclusion the target can only be a mere static resource, without any runtime or request parameter, because in static inclusion, the file is included during translation time much before the resource is actually requested.

Hence all the three statements about the dynamic inclusion is true.

Hope that answers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic