# tomcat-plugin **Repository Path**: tb12315/tomcat-plugin ## Basic Information - **Project Name**: tomcat-plugin - **Description**: 社区版支持tomcat调试 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-04-05 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SmartTomcat The Tomcat plugin for Intellij IDEA [![Actions Status](https://github.com/zengkid/SmartTomcat/workflows/Java%20CI/badge.svg)](https://github.com/zengkid/SmartTomcat/actions) ### User Guide * Tomcat Server Setting Navigate File -> Setting or Ctrl + Alt + S Open System Settings. In the Setting UI, go to Tomcat Server, and then add your tomcat servers, e.g. tomcat6, tomcat8, tomcat9 ![Smart Tomcat Setting1](https://raw.githubusercontent.com/zengkid/SmartTomcat/master/doc/setting1.png "Smart Tomcat") ![Smart Tomcat Setting2](https://raw.githubusercontent.com/zengkid/SmartTomcat/master/doc/setting2.png "Smart Tomcat") ![Smart Tomcat Setting2](https://raw.githubusercontent.com/zengkid/SmartTomcat/master/doc/setting3.png "Smart Tomcat") * Run/Debug setup Navigat Run -> Edit Configrations to Open Run/Debug Configrations. In the Run/Debug Configrations, add new configration, choose Smart Tomcat, for detail config as below ![Smart Tomcat run1](https://raw.githubusercontent.com/zengkid/SmartTomcat/master/doc/run1.png "Smart Tomcat") ![Smart Tomcat run2](https://raw.githubusercontent.com/zengkid/SmartTomcat/master/doc/run2.png "Smart Tomcat") ![Smart Tomcat run3](https://raw.githubusercontent.com/zengkid/SmartTomcat/master/doc/run3.png "Smart Tomcat") * Run/Debug config detail * Tomcat Server choose the tomcat server. * Deployment Directory the directory must be in project or module webapp. maven or gradle project, the default folder is /src/main/webapp **DON'T add output webapp to deployment directory.** * Custom Context opional, if webapp/META-INF/context.xml, if will auto add it. sample context.xml: ```xml ``` In Java Servlet, we can call it as below ```java Context ctx = new InitialContext(); ctx = (Context) ctx.lookup("java:comp/env"); String value1 = (String) ctx.lookup("varName1"); String value2 = (String) ctx.lookup("varName2"); DataSource datasource = (DataSource) ctx.lookup("jdbc/ds"); ``` * Context Path default value is '/' * Server Port default value is 8080 * AJP Port default value is 8009 * Admin Port default value is 8005 * VM Options extract tomcat VM options e.g. -Duser.language=en * Env Options extract tomcat env parmaters e.g. param1=value1