aspose file tools
The moose likes JSP and the fly likes SimpleTagSupport Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "SimpleTagSupport" Watch "SimpleTagSupport" New topic
Author

SimpleTagSupport

David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
How can I access the request object in class which extends SimpleTagSupport class?


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Steve McCann
Ranch Hand

Joined: Oct 20, 2004
Posts: 81
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

Joined: Aug 04, 2004
Posts: 724
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

Joined: Jan 10, 2002
Posts: 56229
    
  13

The JspContext is the page context. You need to cast it.


[ October 27, 2005: Message edited by: Bear Bibeault ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56229
    
  13

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

Joined: Oct 20, 2004
Posts: 81
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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: SimpleTagSupport
 
Similar Threads
Custom Tags_ SimpleTagSupport
doubt in a mock exam question
Latest version of servlet.jar
Help needed for creating new Tag files
SimpleTagSupport compile error