2 Replies Latest reply: Oct 21, 2008 12:46 PM by 843810 RSS

    Serverhelp and localhost URLs


      anybody using the JSP-based JavaHelp, which comes from the demos/serverhelp subdirectory? I have a strange problem here.

      Registering the HelpSet in the JSP with
      <jh:validate helpBroker="<%=helpBroker%>" helpSetName="app/helpsets/MyHelpset.hs"/>
      everything works fine on most machines. However, the identical setup at another site shows the following strange behaviour:

      The URL of the frame which should show the help pages is created with the following command:
      <jsp:getProperty name="helpBroker" property="currentURL" />"
      which normally resolves to the correct machine name but on that particular machine it resolves to "http://localhost:80/..." which is obviously wrong, since localhost is the machine where the users browser is running.

      The TOC is created using the following commands:
      <jh:tocItem helpBroker="<%= helpBroker %>" tocView="<%= curNav %>" >
      tocTree.addTreeNode("<%= parentID %>","<%= nodeID %>","<%= iconURL!=""?iconURL:"null" %>","<%= name %>","<%= helpID %>","<%= contentURL!=""?contentURL:"null" %>","<%= expansionType%>" );
      Here the same problem appears. I searched the JavaHelp-Sources, but all I could found is that the URL
      is created correctly: ValidateTag#createHelpSet creates ths URL as follows:
      url = new URL(request.getScheme(), request.getServerName(), request.getServerPort(), hsName);
      which should NOT return localhost!

      Any ideas?
        • 1. Re: Serverhelp and localhost URLs
          Did you solve this problem by any chance?
          • 2. Re: Serverhelp and localhost URLs
            This might help others looking for answer to similar question.

            Actually, I figured out the problem. It is when you ran the jhindexer for JavaHelp or maybe somewhere else along the way the localhost name gets in the url. So what I did, I created a config file for jhindexer as such:

            IndexPrepend path* (refer to javaHelp doc for detail info.)

            path* being the url you want your result pages to have then re-run the jhindexer with -c option that should take care of things for you.