• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Include param  RSS feed

 
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the contents of two JSP files:
File 1: this.jsp
<html><body><pre>
<jsp:include page="that.jsp" >
<jsp aram name="color" value="red" />
<jsp aram name="color" value="green" />
</jsp:include>
</pre></body></html>
File 2: that.jsp
<%
String colors[] = request.getParameterValues("color");
for (int i=0; i<colors.length; i++)
{
out.print(colors[i] + " ");
}
%>
What will be the output of accessing the this.jsp file via the following URL?
(Select one)
http://localhost:8080/chapter13/this.jsp?color=blue
a blue
b red green
c red green blue
d blue red green
e blue green red
Answer: c
Explanation
The parameters passed via the <jsp aram> tag to an included component tag
take precedence over the parameters already present in the request object of the
including component. Also, the order of values passed via the <jsp aram> tag
is the same as the order in which the tags appear. Thus, the correct answer is c.
The output will be red green blue.


HFSJ Doesn't Talk about this ???
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(you can turn of smilies by checking the "Disable smilies in this post." at the bottom left of the screen when you post)
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nope...
order of request parameters is not mentioned in first edition....
 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this info is missing from HFSJ. Can we safely say that this won't be in the exam ?

Once again i am trying to figure out do i need to study something extra (other than HFSJ)...
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!