Step 1 Follow the instructions from Digital Ocean and install tomcat.
Step 2 After installing in netbeans, Go to Run->Clean and build.
Step 3 Goto Project folder and find the projectname.war file in dist folder.
Step 4 Rename the war to ROOT.war.
Step 5 Assuming you have followed all the procedure as mentioned in digital
ocean from step 1, goto http://localhost:8080/
Step 6. Click Manage App .
Step 7 At the bottom there will be a browse button under upload war. Click it
Step 8 After selecting ROOT.war . Click deploy.
There you go. Now enter http://ip_of_pi:8080 from any browser in local network to view your site.
Port forward it to access it globally. (optional).
P.S :- if you find error in the line curl -O in step 1 guide , replace the step by manually downloading tomcat.tar from Tomcat Official Site.Tomcat's Official Site to tmp folder.
Hope it helps someone