3 Replies Latest reply on Feb 25, 2003 9:40 AM by prpatel

    context path resolution

    muralikri_bng

      Hi,

      We have an application where coding was done with "/" i.e root as the context path. Now the client has requested that we change the context path to /something
      we changed the context path in application.xml. But we are having problems with images and file paths. Is it possible to configure the context path so that we dont have to change the code.

      Thanks

        • 1. Re: context path resolution
          rndgatewaynet

          You could use relative URLs from the start.
          (e.g ../images/foo.png).
          You can always write a script to identify these strings and convert them
          accordingly.

          • 2. Re: context path resolution
            muralikri_bng

            Hi Everybody,
            can't we do anything without tapering with the code.
            Thanks
            Murali

            • 3. Re: context path resolution
              prpatel

              Murali,

              a best practice when developing websites or webapps is you *never* hard code any absolute references/paths in your HTML, JSP, etc. Always use relative paths!

              However, you could deploy the necessary hard-coded dirs/resources in separate locations (wars). For example, if you have /images/* as the location of your images, put your images into the root of a new webapp and deploy it as /images.

              BUT, you should just take the time now and refactor all of your code and do it properly, using relative paths.

              cheers
              Pratik