Absolute File path Web application

Absolute File path Web application

While working on web based application and you are trying to find absolute path of deployed application using with you could set properties file from class path. I will you how to get it using small project:

  • Maven project structure:

Absolute File path Web application

  • As you see in above project we have file name: Sample.xml and we need to find it path at run time as below:

  • Output:

Absolute File path Web application

  •  For more information find relative and absolute path java please  see this tutorial

download Download Project:  SpringMVCRESTFulService

Leave a Reply

Your email address will not be published. Required fields are marked *