Skip to main content

Find the Context Path with JSF
22 September 2015

Sometimes JSF does not have a component that will produce a particular type of HTML element. That's not a problem but, I always forget the three method deep route to the context path. I always find I have to work through an IDE's code completion tool to find the application's path.

Here it is for next time:


A shorter version:


Just for completeness here is the JSP version:


And finaly, the scriptlet version:

    String root = pageContext.getRequest().getServletContext().getContextPath();

If you know any more please do leave a comment.


Mailing List

Responsive Media

With the ResponsiveMedia plugin for Joomla it is easy to add 3rd party content from YouTube, Vimeo, and Instagram right in to any Joomla! article.