If you see it

Live for passion

Create a Simple J2EE Web Project With IntelliJ and Tomcat

As it’s surprising hard to start from scratch to create a simple web project using jsp running on tomcat with IntelliJ, this post intends to leave a note for this boiler process.

Install Tomcat 7 on Mac (10.9.2)

Download: http://tomcat.apache.org/download-70.cgi#7.0.53

Unzip

1
2
3
4
$ mv apache-tomcat-7.0.53 /usr/local/Cellar/
$ mv apache-tomcat-7.0.53 tomcat
$ cd tomcat/bin
$ sh startup.sh

Test it in http://localhost:8080/ to see if it works.

$ sh shutdown.sh

Edit $TOMCAT_DIR/conf/tomcat-users.xml to get admin access:

$TOMCAT_DIR/conf/tomcat-users.xml
1
2
3
  <role rolename="manager-gui"/>
  <role rolename="admin"/>
  <user username="admin" password="admin" roles="admin,manager-gui"/>

And restart the tomcat to gain the access with new credential.

Roles: “You can find the role names in the web.xml file of the Manager web application. The available roles are:”

manager-gui — Access to the HTML interface.

manager-status — Access to the “Server Status” page only.

manager-script — Access to the tools-friendly plain text interface that is described in this document, and to the “Server Status” page.

manager-jmx — Access to JMX proxy interface and to the “Server Status” page.

Tomcat 7 manager-howto

Addition:

Add tomcat7 to IntelliJ

Add this as tomcat home directory /usr/local/Cellar/tomcat/ or the your specific link form your settings.

Comments