• 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

jsp:param has higher preceedence ! :)

 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the outcome of making the HTTP GET request shown to params.jsp (source follows)? (Choose one.)

The HTTP request is in this form:
http://localhost:8080/examp0702/params.jsp?X=1&Y=2&Z=3

Source of params.jsp:


Source of included.jsp:



now my concern is - that the answer is 4 6 451 1 2
i was puzzled by the order 451, and i thought that the parameters passed to the included.jsp using jsp aram enjoy preceedence over the request parameters. so inside included.jsp, the areay will hold 4,5,1 in that order.

i cross checked this with jsp spec, and felt nice that it too conformed the same !
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a bit puzzled. You're saying answer is 451, and you were expecting 451. Where is the problem ?
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i was expecting 1,5,4
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry i was expecting 5,4,1 !
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understand what you mean
--> 1
--> 4, 1
--> 5, 4, 1

It is also written to refer to "SRV.8.1.1".
There, it is written that Parameters specified in the query string used to create the RequestDispatcher take precedence over other parameters of the same name passed to the included servlet..
So now we are left wondering what's the actual order for request parameters. Looking at "SRV.4.1 HTTP Protocol Parameters", it says :
if a request is made with a query string of a=hello and a post body of
a=goodbye&a=world, the resulting parameter set would be ordered a=(hello,
goodbye, world).


So we may deduce that the result of the question is 4,5,1.

Anyway, that's unclear And I don't think you'll get such tricky question at the exam.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic