• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[OCWCD] How can I get pageContext in SimpleTagSupport Object

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,

I tried catch the Session through the SimpleTagSupport, and I could not...

But I read in the Heard First Book that the SimpleTagSupport is used in 99,99999% of the tags, (so... Should there are a method to do this, right!?)

I also beyond the Sessions, want to catch the ServletContext object

So... How can I do it?


Thanks.

Paulo Gervásio.

 
Paulo Gervásio.
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey!

I found the method:



But I cannot understand because getJspContext(); don't returns a PageContext object... Somebody knows?


Thanks.
Paulo Gervásio.
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paulo,

But I cannot understand because getJspContext(); don't returns a PageContext object... Somebody knows?


True, but PageContext extends JspContext

The JspContext is described like this:

JspContext serves as the base class for the PageContext class and abstracts all
information that is not specific to servlets. This allows for Simple Tag Extensions
to be used outside of the context of a request/response Servlet.



As we are using SimpleTags always in an environment that is Servlet-based (in JSPs, those are Servlets) you can safely downcast the JspContext to the PageContext object.

Regards,
Frits
 
Paulo Gervásio.
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good!
Thnks!
 
Lookout! Runaway whale! Hide behind this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic