Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

jsp:include  RSS feed

 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, again..

Please take a look at the following question:

The <jsp:include> element allows you to include either a static or dynamic file in a JSP file. The results of including static and dynamic files are quite different.

<jsp:include page="brew.jsp" flush="true">
<jsp aram name="favbeer" value="sprecher" />
</jsp:include>

Question:

From the scenario above, which one of the following sets of statements differentiates between static and dynamic inclusion of a file in a JSP page?

Choice 1 -
If the file is static, the file is included a compile time.
If the file is dynamic, the file recompiled for each request.

Choice 2 -
If the file is static, the file name cannot be changed.
If the file is dynamic, the file name can be changed. In both cases the included file acts on a request and sends back a result.

Choice 3 -
If the file is static, its content is included in the calling JSP file.
If the file is dynamic, it acts on a request and sends back a result that is included in the JSP page.

Choice 4-
If the file is static or dynamic, the file name can be changed.
If the file is dynamic, the included file acts on a request and sends back a result.

Choice 5 -
If the file is static or dynamic, the file name cannot be changed.
If the file is dynamic, the included file acts on a request and sends back a result

I marked the option "4". is that correct?

Tks.
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

whant is the answer given. I will go for 5.

Thanks
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
i would for 4th options .
Plese let us know the answer.

Regards
-santosh

SCJP1.4(96%)
SCWCD -in progress
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please guys .. we are waiting for Mr KnowAll to answer this.
 
singh santosh
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi shewta,
can u explain this "Please Guys.. ".Cum up with a answer and not such comments
.Let him Mr KnowAll reply but others can also reply .Right Miss..

-santosh
 
Steven Colley
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please, anyone for ensure this?

tks.
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Felipe, Narendra & Santosh can u all please explain the options which u think are right. Because i am unable to understand the options itself.

Thanks in anticipation.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bhavana,

Choice 5 -
If the file is static or dynamic, the file name cannot be changed.
If the file is dynamic, the included file acts on a request and sends back a result



The first line , I assumed the file name passed to the jsp:include action. Once it is passed you can not change it.

The second line, If the resource is static the content of the file copied as it at the run-time.If you give .txt file , the contains of the .txt file is included in the response at run-time. But if the file is dynamic ( servlet or JSP), it process the resource and include the output of the JSP or servlet.

This is my understanding, so I give option 5 is correct.

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!