• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help on SimpleTag  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we access request object in the doTag() of a class extending SimpleTagSupport??
This is in reference of HF final mock test , question no 25,page 811
The ans of which appears to be wrong.
The ans is as below

((PageContext)getJspContext()).getRequest()

If the ans is correst, please explain.
 
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we can access it but no idea how to access is exactly..

kapil
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes the HFS statement is correct.

For your information, PageContext extends JspContext.

So the way given in book is correct to access request object.
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI!

check the API of JSp Context and Page Context
there is getRequest() method.
Answer is correct in HFS Book.


jaya
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!