Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SimpleTagSupport  RSS feed

 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I access the request object in class which extends SimpleTagSupport class?
 
Steve McCann
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a reference to the pageContext in the SimpleTagSupport class. You can use this to get to the Request by using the pageContext.getRequest() method.

Hope that helps
Steve
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see it. I'm only able to get reference to jspContext through getJspContext but there are only methods for getting attributes.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66143
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JspContext is the page context. You need to cast it.


[ October 27, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66143
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Steve McCann:
There is a reference to the pageContext in the SimpleTagSupport class.


That reference is only available in the "classic" tag handlers. It is no longer defined for SimpleTagSupport and its ilk.
 
Steve McCann
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear

Oops - you're right. Must have an out of date copy of the API docs. :roll:
Looking at the (up-to-date) docs I see you can get the page context by calling the getJspContext() method in SimpleTagSupport.

Cheers
Steve
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!