-
1. Re: resolving server contextPath
cbensemann Mar 7, 2010 6:16 AM (in response to cbensemann)Anyone have any ideas for this? I really dont want to have to hard code this path and dont think I should have to
-
2. Re: resolving server contextPath
elfuhrer Mar 7, 2010 1:37 PM (in response to cbensemann)Hi Craig,
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.
Cheers,
Fady -
3. Re: resolving server contextPath
cbensemann Mar 8, 2010 1:12 AM (in response to cbensemann)Hi Fady,
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
/project
comes from.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?
Thanks, Craig
-
4. Re: resolving server contextPath
elfuhrer Mar 8, 2010 10:58 AM (in response to cbensemann)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.
Cheers,
Fady
-
5. Re: resolving server contextPath
cbensemann Mar 8, 2010 7:21 PM (in response to cbensemann)Thanks. I new I must be missing something simple :)