Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Access HttpServletRequest from within SimpleTagSupport  RSS feed

 
pete johnson
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing a tag that extends SimpleTagSupport. The task of this
tag is to construct the entire request URL. Servlets API has a few related methods
available from a HttpServletRequest object.

How can I can get access to this object from within a SimpleTagSupport object?
from getJspContext()?

Regards,
Pete
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Enough parens for you?

The trick is knowing that the JspContext passed to the tag is an instance of PageContext. Casting from ServletRequest to HttpServletRequest is also necessary.
 
pete johnson
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

Thanks so much for your tip. It works!

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