• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question from Jweb +

 
Rekha Polisetty
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
 
Vedhas Pitkar
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.
 
Adrian Muscalu
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
 
trupti nigam
Ranch Hand
Posts: 627
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic