Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in 2 questions of Marcus green's exams

 
aman thind
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I might be really dumb but i really couldn't figure out the following 2 questions:-
Ques 1:Given a JSP page called mypage.jsp with the following code

<%
request.setAttribute("greeting","good");
%>
<jsp:include page="menu.jsp" />

morning

And an available file called menu.jsp that contains the following code

<%
String greeting = (String) request.getAttribute("greeting");
out.print(greeting);
%>What will happen when you attempt to compile and run mypage.jsp?

Choose one answer.
A. Compilation error the jsp:include tag takes a paramter of file not page
B. compilation and output of good only
C. compilation and output of good morning
D. compilation and output of greeting
E. compilation and output of greeting morning
F. compilation and output of greeting morning

Given answer is C.I am really lost on this one.

Ques 2:Is the following statement true or false?

A JSP document (i.e. in XML syntax) must start with the root tag

Answer: True

But as far as i know latest spec doesn't need a JSP document to start with root tag(acc. to Whizlabs)
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aman thind wrote:

Given answer is C.I am really lost on this one.



why? i dont think it is difficult to test
 
aman thind
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seetharaman venkatasamy wrote:
aman thind wrote:

Given answer is C.I am really lost on this one.



why? i dont think it is difficult to test


What i meant was,are request attributes availabale to the dynamically included page.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aman thind wrote:
What i meant was,are request attributes availabale to the dynamically included page.


ya, i understand . Do you test yourself ?, if yes,what is the result of your testing ?
 
aman thind
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seetharaman venkatasamy wrote:
ya, i understand . Do you test yourself ?, if yes,what is the result of your testing ?


I would love to test it but i've to write the test in a short time,can you please clarify my doubt
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well.Yes ,request attributes availabale to the dynamically included page.

practise makes debuggability , thats why i force you to test that
 
aman thind
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seetharaman venkatasamy wrote: Well.Yes ,request attributes availabale to the dynamically included page.

practise makes debuggability , thats why i force you to test that


Thanks Venkat
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aman thind wrote:Thanks Venkat


You are Welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic