• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[mock][HF][pageContext]

 
Sam Sun
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I. HF page 800 Q:4
1. <%@ attribute name="data" %>
2. <% pageContext.getOut().print(data+data); %>
3. <% getJspContext().getOut().print(data+data); %>
Sentence 3 is ok but sentence 2 is compile error. My question is why the implicit object "pageContext" isn't available there. I think it should be available at any time in a JSP file, just like "out" implicit object.
 
Radmika Arunachalam
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Above file should be tag file becse attribute directive is used.. In tag files pageContext is not available (it is like extending SimpleTagSupport..)

Hope this helps..
 
Sam Sun
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it. Thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic