Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt in 2 questions of Marcus green's exams

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

aman thind wrote:Thanks Venkat:)



You are Welcome :)
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic