2 Replies Latest reply on Dec 9, 2007 5:23 AM by m k

    Application URL

    m k Newbie

      Hi,

      how can i determine the actual URL of my SEAM application ? (e.g. http://localhost:8080/....)

      Best regards

      mki


      ---
      http://komponenten.blogspot.com

        • 1. Re: Application URL
          Damian Harvey Master

           

          ServletRequest request = (ServletRequest) FacesContext.getCurrentInstance()
           .getExternalContext().getRequest();
          
          String url = new StringBuffer(request.getScheme())
           .append("://").append(request.getServerName())
           .append(":")
           .append(request.getServerPort())
           .append(FacesContext.getCurrentInstance()
           .getExternalContext().getRequestContextPath())
           .toString();
          


          Cheers,

          Damian.

          • 2. Re: Application URL
            m k Newbie

            Thanks Damien,

            injection is also possible:

             @In
             private FacesContext facesContext;
            


            Best regards

            mki