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

    Application URL

    mki_ffm

      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
          damianharvey

           

          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
            mki_ffm

            Thanks Damien,

            injection is also possible:

             @In
             private FacesContext facesContext;
            


            Best regards

            mki