I am new when it comes to web development using Java and Tomcat. So I've created a simple website using Spark framework and ORMLite/MySQL. I have only one controller class that serves all requests for urls.
When testing my website in IntelliJ, I put all the get() and post() inside of main(){}, but from my reading of some scattered help on the internet, I put all my get() and post() methods inside of public void init() { }. In addition, I created a web.xml in the resources directory, and the following is the content of my web.xml:
<filter>
<filter-name>SparkFilter</filter-name>
<filter-class>spark.servlet.SparkFilter</filter-class>
<init-param>
<param-name>applicationClass</param-name>
<param-value>controller.AdminInitController</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>SparkFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
I am not sure how to create a war or jar file out of my source code and how to deploy it on a server (either Tomcat or anything else that works for Spark). I will appreciate your help. Thanks
Tony