Deploy Java Web Project on Tomcat without WAR or EAR

江枫思渺然 提交于 2019-12-11 03:38:50

问题


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.



来源:https://stackoverflow.com/questions/19097115/deploy-java-web-project-on-tomcat-without-war-or-ear

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!