Skip to content

Instantly share code, notes, and snippets.

View slevine's full-sized avatar

Steven Levine slevine

View GitHub Profile
# Newbie Programmer
def factorial(x)
if x == 0
return 1
else
return x * factorial(x - 1)
end
end
puts factorial(6)
puts factorial(0)

There are four different ways one can deploy a webapp to Tomcat.
If $TOMCAT_HOME is the Tomcat top-level directory:

  • Copy the war file foo.war or exploded war directory to $TOMCAT_HOME/webapps
  • Create a context file context.xml in the webapp’s META-INF/ directory that contains a fragment that describes the webapp deployment
  • Add a <Context> element to the <Host> element in Tomcat’s server.xml that describes the webapp deployment, including docBase. docBase is a attribute that locates the war file or exploded war directory in the filesystem.
  • Create a context file foo.xml in $TOMCAT_HOME/conf/Catalina/localhost/foo.xml that contains a fragment that describes the webapp deployment, including docBase.

Sample $TOMCAT_HOME/conf/Catalina/localhost/foo.xml

@slevine
slevine / Default (OSX).sublime-keymap
Last active December 31, 2015 02:49 — forked from uberbuilder/Default (OSX).sublime-keymap
Simple Sublime Plugin to Add ### Date to a Markdown document
{ "keys": ["command+alt+1"], "command": "add_date_stamp" }