6 Replies Latest reply on Oct 27, 2009 4:17 PM by I need a real name

    Hide port number is links

    I need a real name Newbie

      Here is the issue. In our seam application, if you do view page source in browser and see the page's html, the links that are displayed have port number with them. e.g. http://www.myapp.com:80/category/somepage. The app is using s:link for these links. How do we hide the port number(80 in this case) that is being displayed in the links?


        • 1. Re: Hide port number is links
          I need a real name Newbie

          Can somebody help on this issue?

          • 2. Re: Hide port number is links
            Francisco Jose Peredo Noguez Master

            What port number is it? JBoss and Tomcat tipically listen on the 8080 port, since that is not the standard http port, it is displayed by the browser, if you reconfigure JBoss or Tomcat to use the 80 port then you will not need to specify the port.


            • 3. Re: Hide port number is links
              I need a real name Newbie

              We are not specifying port number in the code or while accessing the application.


              The port number is not displayed in the URL in browser, but it is being displayed if you do a view page source to see the generated html of that page. In the generated html the links are displayed with port 80.


              The apache is forwarding requests to jboss.

              • 4. Re: Hide port number is links
                Francisco Jose Peredo Noguez Master

                I need a real name wrote on Oct 26, 2009 17:06:


                The apache is forwarding requests to jboss.


                So, nameless friend, you say apache httpd is forwarding to jboss? well then... maybe it is apache httpd the one that is altering your links and adding the port number to them. Have you tried asking at Apache Httpd forums about this?. One thing that you could do is configure JBoss to listen on the 80 port, access it directy, and see if it appends the port to your links, if it does not, then it means httpd is the one causing you troubles.

                • 5. Re: Hide port number is links
                  Chris Ouellette Newbie

                  I think I know what our nameless friend is referring to. I have a Seam application in which I display URL's to the user which are direct links back into the application (so the user can email links to pages). We created a variable named basePath which is initialized in components.xml as follows:


                  <factory name="basePath" scope="CONVERSATION" auto-create="true"
                            value="#{facesContext.externalContext.request.scheme}://#{facesContext.externalContext.request.serverName}:#{facesContext.externalContext.request.serverPort}#{facesContext.externalContext.request.contextPath}"/>



                  We our building our link in our facelet code as follows:


                  <input type="text" value="#{basePath}/search.seam?id=#{searchId}" />



                  We included the port in our request for development purposes, but it can easily be removed.


                  If you really wanted to get rid of the generated port numbers, you can employ logic similar to this. Also, are you seeing this problem only in development or on your test/production servers as well?

                  • 6. Re: Hide port number is links
                    I need a real name Newbie

                    Also, are you seeing this problem only in development or on your test/production servers as well?


                    It is happening in dev, test and production. Does this anything has to do with s:link? It is happening with the links that are using s:link. The other links in the application that are using h:outputLink are fine.