This content has been marked as final.
Show 2 replies
-
1. Re: Domain URL and page parameters
zeeman Feb 5, 2009 6:58 AM (in response to zeeman)Never mind, I found how it's done in wiki example. They just read the url to use from db, it's configurable. I thought I would be able to get it from the container but I guess not.
-
2. Re: Domain URL and page parameters
binnyg Feb 5, 2009 2:24 PM (in response to zeeman)I guess you can. It really depends on what approach you want to take based on your requirement. You can save it in the database or you can make it a configurable parameter and inject it into seam components via seam.components or read it from the container.
There is no single method to give you the URL. You should construct it. You can define the following
components.xml
<factory name="currentRequest" value="#{facesContext.externalContext.request}" />
Your Java class
@In("currentRequest") HttpServletRequest request; public String getDomainNameWithContext() { return request.getScheme() + ":"+ request.getServerPort() +"//" + request.getServerName() + request.getContextPath(); }