• 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

jsp:param has higher preceedence ! :)  RSS feed

 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • 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 Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
i was expecting 1,5,4
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i was expecting 5,4,1 !
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!