ServletContext in navigator7 add-on

Hello,
How can i get the ServletContext for a vaadin application with navigator7 add-on?

Should i retrieve the ServletContext in MyApplication or in MyWebApplication? (MyApplication extends from NavigableApplication and MyWebApplication extends from WebApplication)
What is the proper way for this?

Thx in advance for your helps.

May be first i should read following forum post.


https://vaadin.com/forum/-/message_boards/view_message/155212

(i found that forum post after i created my this question)

i will update the status after reading that forum post.

i found it.

we can use currentServletContext field of WebApplication class to reach servlet context.

gr,

If you’re looking for the Vaadin 7 implementation for getting the servlet context, it’s:

VaadinServlet.getCurrent().getServletContext();