Forums Register Login

Accessing ServletContext in SimpleTagSupport

+Pie Number of slices to send: Send
Hello:

The only solution I've seen to the problem of how to access ServletContext from a SimpleTagSupport instance is to cast the JspContext to a PageContext.
Now I can't be sure all JSP/Servlet containers will allow this. Is there another way of doing this?

Thanks.
Eric
+Pie Number of slices to send: Send
That is the correct way to do it. If you'd like assurance, you can always check the type with instanceof before casting.
You can't expect to wield supreme executive power just because
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2245 times.
Similar Threads
Class or interface
ServletContext
What is the name of the object that is created/maintained by the Servlet Container and contains all
[OCWCD] How can I get pageContext in SimpleTagSupport Object
findAncestorWithClass
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:07:02.