Hi,
Ultimately I'm creating my navigation menu on facelet template and I need to populate the context root dynamically.
With jsp I can do something along the lines of <% context.getcontextpath %>, but facelet can't do this (I think).
I have a application scope bean that contains most system property, using Optimus @Controller(name = "DefaultStartUpBean", scope = Scope.APPLICATION, startup = true). Problem is, because this class is initialised at deployment, there is no FacesContext so I can't access the ServletContext to get the context path.
Any thoughts on how I should approach this?
StartupBeans
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
With facelets this should work;
Code: Select all
#{request.contextPath}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 33 guests