• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Runtime Expression Value in jsp:forward  RSS feed

 
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 ??
 
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!