Search code examples
javarestasp.net-web-apipostmanwar

Renaming war file after exporting from eclipse to hit web api


I am trying to develop web api by java. I exported the war from eclipse by right click on the module and determine a destination. After that I changed the name of the war to avoid conflicting on the server with a previous war with the same name. Now, I am trying to hit the api using postman with the link ([WARFILENAME]/rest/[ClassPath]/[FunctionName]) but there is no response. My question is: is it correct to rename the war file after creating it? is there any other step to make the api working? Thanks


Solution

  • I thing your question is not having all information! If you are using servlet then the path will be http://{host:port}/warFile/{uri-path-of-servlet}

    You can change the warFile name. The context of that app will be same as warFile in URL.

    If you are new to J2EE then you can try this: https://javatutorial.net/servlet-annotation-example.