Good practices for deploying the development project to production with a different operating system?


I'm finishing one project in JSF, but now I have to recreate all links (like localhost:8080/project/recoverpassword to the for instance and many others. So I wonder if there's any other way to do that in a easier way ?

Other thing is that I'm using Windows 7 to development plataform and this project is gonna be deployed in Linux (probably CentOS 6) and the paths are totally different, for links, for image, for video, etc, referring to the local content of course (I think would be expensive host these files outside where the application is running), 'cause the file system is different, this 'cause problems even with database in names of tables that are referred in entities in JPA. So the lesson here is that I HAVE to develop my project where it's gonna be deployed ? Or am I wrong ? There's another way to work around this issue ?


I gather that /project is the context path. The context path is indeed a dynamic value, completely beyond the control of your web application project.

You should not have the need to recreate all links if you have from the beginning on properly used:

The mentioned tags automatically prepend the current context path when necessary. In other words, you should never have had the need to hardcode the string /project representing the context path anywhere in the code.

Pick together yourself, bite the bullet, take a full day to fix them all in the current project and profit of the lesson learnt for future projects.

See also:

  • Is there something like <c:url> for JSF?