• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Question from Jweb +

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question ID :997967667647
For the JSP scopes of request and page, what type of object is used to store the attributes?
1.HttpServletRequest and ServletContext
2.ServletRequest and ServletConfig
3.ServletRequest and PageContext
4.HttpServletRequest and PageContext
5.ServletConfig for both.
Select only one.
Which one you will select 3 or 4 , i think both are valid
Answer is 3
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi it should be 4 & not 3 as the request variable in JSP refers to HttpServletRequest & not ServletRequest.
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My explanation for choosing (4) is the signature of _jspService method:

If we think more, number (3) is also valid since HttpServletRequest extends ServletRequest. But I'd go for #4.
Adrian
 
Ranch Hand
Posts: 644
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think ans 3 is correct.
As per specification:
for variable request the type given is:
protocol dependent subtype of javax.servlet.ServletRequest
e.g. javax.servlet.http.HttpServletRequest
so as per specification ans 3 should be correct.
thanks,
Trupti
 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic