Anyone have any ideas for this? I really dont want to have to hard code this path and dont think I should have to
What you can do is create a component that is initialized at startup where the values you required are initialized at startup and then added to the application or session scope, wherever you seem fit according to your needs.
I hope this helps.
Thanks for your reply. After thinking about your reply I might be better able to clarify my request. The problem is that on startup there is no FacesContext present as that is per request. The question is probably more a general jsf/web application question than as seam one. I need a way to work out where I am (server url and context path) without sending a request. Either the Factories listed in my first post or a component that is initialized at startup suffer from the same problem.
If seam mail happens to be the first thing that calls the factory method a FacesContext is created with a MockHttpServletRequest which is where the contextPath
So is there a way to get the full url (for example: http://mydomain.com/pathToApp) from within the application without needing an active request at the time or hard coding the url and path as a property?
This data is available from the ServletContext which is available whenever the application is deployed. I'll run a few tests and get back to you with the results.
Thanks. I new I must be missing something simple :)