Deploy Java Web Project on Tomcat without WAR or E

2019-07-16 02:52发布

问题:

I have a Java Web project (Struts + Spring) working perfectly in my localhost. I have to deploy it on my website, but the Tomcat Manager interface given by the webhost says it cannot upload a WAR file due to safety reasons. When contacting the tech support I was told it is not possible to upload a WAR and that I should try deploying my project by uploading the files directly (I have FTP access).

My problem is that no one at the tech support gave specific instructions on where I should put my project files (I don't know if it should be on de same folder the WAR would be sent to) neither how to start/stop it (Will the Tomcat Manager recognize it once I upload the files?).

回答1:

You can always try to upload a war file to webapps folder of tomcat.

if tomcat is running with autoDeploy set to true it will auto deploy your application.

i think that the same will happen if you upload the exploded war to the webapps, the context will be the name of the directory you put your files in.



回答2:

You transfer the files to the same place as the war file would go - but just as an expanded war.

Whether or not tomcat will recognise that the files have changed depends on the configuration of the tomcat server. I'd just give it a go - transfer the files and see what happens. If it doesn't pick up the changes then you'll need to find out from tech support how to restart tomcat.



回答3:

Just place your apllication's root folder to the Tomcat's directory webapps and configure tomcat to auto deploy. Restart the server and your application will be deployed.