Review the Video walkthrough here: Office Mix
Go to http://c9.io and logon with GitHub or whatever credentials you choose
Call it whatever you like, but choose "Custom".
git clone https://github.com/cs612-f15/tomcat-mysql-c9.git
cd tomcat-mysql-c9
MySQL is already installed.
Run the following from your ~/workspace/tomcat-mysql-c9
directory.
./setupMySql.sh
The following will download V8 of Tomcat and unpack it to ./tomcat
Run the following from your ~/workspace/tomcat-mysql-c9
directory.
./setupTomcat.sh
Once the Tomcat script is run, the survey.war
file is deployed to ./tomcat/webapps
and as the Survey site is
requested, Tomcat extracts the WAR file.
- Choose "preview" from C9.io interface
- Preview Running application
- Popout in New window
- Change the URL - appending
/survey
to the Server Name
This WAR file contains all the content, JSP, Class - and the Java source files.
A helper script allows you build *.java
source files, then build, then restart tomcat.
./buildJava.sh
./tomcat/bin/catalina.sh stop
./tomcat/bin/cataling.sh start
Go into the ./tomcat/webapps/survey/WEB-INF/classes/survey/DatabaseAccess.java
file
Edit the lines to change the user from root
to cs612
Should look like this:
String jdbcDriver = "com.mysql.jdbc.Driver";
String dbURL = "jdbc:mysql://localhost/test";
String user = "cs612";
String password = "123456";
Recompile, then restart Tomcat...
./buildJava.sh
./tomcat/bin/catalina.sh stop
./tomcat/bin/cataling.sh start
Note: JSP files if changes are immediately reprocessed and reflected within Tomcat.
Class files, sourced from Java files, requires a "restart" of Tomcat - that is what the ./tomcat/bin/cataling stop/start
provides.