#Purpose Find out how to deploy Struts2 to tomcat without eclipse. Assumption: Class files are compiled
If you have a project called Struts2Calc The top page is index.jsp CalcAction.class in controller package CalcFormBean.class in bean package
If there is, it will be as shown in the above figure.
If the class file is in bin or something, create a classes folder like this and move it. struts.xml etc. are also directly under the classes folder.
terminal
cd ~/JavaProjects/Struts2Calc
jar cvf Struts2Calc.war -C WebContent .
So, a war file is created This is tomcat / webapps / Can be deployed by placing it in.
I wrote to make a war and put it in the webapps folder to deploy to tomcat no matter where I look. It worked even if I took it to webapps as it is without making it a war with the above folder structure as a trial. The identity of the war file is a zip file, and tomcat seems to just unzip it normally. However, it is common sense to use war, so it is usually better to do so.
Recommended Posts