JeeGurg
JeeGurg

Reputation: 115

Are Tomcat webapps server independent?

I have made an app using Tomcat as my server. It uses JSP pages and java servlets.

If I copy my webapp (the folder) to some other server, will it run? What are the requirements for it to work/not work?

EDIT: Thanks for the answers. One more thing, what if some of my code uses filepath, that originates from the bin folder of Tomcat. For eg: "../webapps/MyApp/WEB-INF/sample.txt" Is the directory structure the same in all servers?

Upvotes: 1

Views: 96

Answers (2)

Mustafa sabir
Mustafa sabir

Reputation: 4360

Ofcourse it will run , there are many servers out there that support jsp/servlet . Most of them are free for development and some are paid for deployment. See this link for more info

For most of the containers (i am not sure for all but most of them) like Tomcat, Jetty, Resin etc, you don't need to modify the project. You can place your project war file in the webapps directory and the project will get deployed on starting the server.

Upvotes: 0

Raedwald
Raedwald

Reputation: 48682

Java servlets and JSP are intended to be portable technologies. There is a servlet standard and a JSP standard. Any servlet container (such as Tomcat) that implements the version of the standard that your code uses should be able to run your code.

You should move your web application around by copying its web application archive (WAR) file, rather thsn the directory (the extracted content of the WAR).

Upvotes: 1

Related Questions