[Logo]
Forums Register Login
Accessing webapp context parameters from a custom tag handler
I'm writing a custom tag handler (extending SimpleTagSupport) and need access to the webapp's context-params. In a servlet, I would simply use:



And in a JSP, I would use:



But I can't figure out how to access it directly from my custom tag handler. I could just have my JSP pass it as an attribute via the custom tag, but I'd rather have the custom tag handler access it directly.

Thanks in advance!
The pageContext gives you access to the request, which gives you the session, which gives you the servlet context.
[ October 07, 2005: Message edited by: Bear Bibeault ]
 
Originally posted by Bear Bibeault:
The pageContext gives you access to the request, which gives you the session, which gives you the servlet context.


Could you be more specific (i.e. show me the code)? My signature says "Java Novice" for a reason!

Thanks!
The tricky part is knowing when to cast.

Wonderful! That's exactly what I needed!

For those of you playing along at home, here's my final code:


Thanks!
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 18, 2017 01:50:00.