Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:include

 
Steven Colley
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.
 
Narendra Dhande
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
 
singh santosh
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
 
shweta bulbule
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.
 
Bhavna Jharbade
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic