tomato启动代码如下:

  1. package tomcat;
  2.  
  3. import org.apache.catalina.connector.Connector;
  4. import org.apache.catalina.startup.Tomcat;
  5.  
  6. /**
  7. * The Class StartMainTomcat.
  8. *
  9. * @author nibili
  10. */
  11. public class StartTomcat {
  12.  
  13. /** The Constant PORT. */
  14. public static final int PORT = 80;
  15.  
  16. /** The Constant CONTEXT. */
  17. public static final String CONTEXT = "";
  18.  
  19. /**
  20. * The main method.
  21. *
  22. * @param args
  23. * the arguments
  24. * @throws Exception
  25. * the exception
  26. */
  27. public static void main(String[] args) throws Exception {
  28. System.setProperty("catalina.base", System.getProperty("user.dir") + "/target");
  29. System.setProperty("log.sql.port", "80");
  30. Tomcat server = new Tomcat();
  31. server.setBaseDir(System.getProperty("catalina.base"));
  32. server.setPort(PORT);
  33. server.addWebapp(CONTEXT, System.getProperty("user.dir") + "/src/main/webapp");
  34. Connector connector = server.getConnector();
  35. connector.setURIEncoding("UTF-8");
  36. server.start();
  37. System.out.println("Hit Enter in console to stop server");
  38. if (System.in.read() != 0) {
  39. server.stop();
  40. System.out.println("Server stopped");
  41. }
  42. }
  43. }

  

需要的maven的jar包如下:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <groupId>cn.com.easy</groupId>
  6. <artifactId>company-yyg-web-front</artifactId>
  7. <packaging>war</packaging>
  8. <version>0.1.0</version>
  9. <name>yyg-web-front</name>
  10. <repositories>
  11. <repository>
  12. <id>public</id>
  13. <url>http://120.76.29.54:8080/nexus/content/groups/public/</url>
  14. <releases>
  15. <enabled>true</enabled>
  16. <updatePolicy>always</updatePolicy>
  17. </releases>
  18. <snapshots>
  19. <enabled>true</enabled>
  20. <updatePolicy>always</updatePolicy>
  21. </snapshots>
  22. </repository>
  23. <repository>
  24. <id>central</id>
  25. <name>Maven Central Repository</name>
  26. <url>https://repo1.maven.org/maven2/</url>
  27. </repository>
  28. <repository>
  29. <id>file-repo</id>
  30. <name>Local file Repository</name>
  31. <url>file://${project.basedir}/lib</url>
  32. <releases>
  33. <enabled>true</enabled>
  34. <checksumPolicy>ignore</checksumPolicy>
  35. </releases>
  36. <snapshots>
  37. <enabled>true</enabled>
  38. <checksumPolicy>ignore</checksumPolicy>
  39. </snapshots>
  40. </repository>
  41. </repositories>
  42.  
  43. <properties>
  44. <!-- 主要依赖库的版本定义 -->
  45. <spring.version>4.0.9.RELEASE</spring.version>
  46. <tomcat.version>7.0.55</tomcat.version>
  47. <slf4j.version>1.7.7</slf4j.version>
  48. <log4j.version>1.2.17</log4j.version>
  49. <hibernate.version>4.3.6.Final</hibernate.version>
  50. <httpclient.version>4.3.5</httpclient.version>
  51. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  52. </properties>
  53.  
  54. <dependencies>
  55. <!-- 微信开发包 -->
  56. <dependency>
  57. <groupId>com.github.sd4324530</groupId>
  58. <artifactId>fastweixin</artifactId>
  59. <version>1.3.10</version>
  60. </dependency>
  61. <!-- 开源工具包 -->
  62. <dependency>
  63. <groupId>cn.com.easy</groupId>
  64. <artifactId>easy-commons</artifactId>
  65. <version>0.1.0-SNAPSHOT</version>
  66. </dependency>
  67. <!-- 验证码 -->
  68. <dependency>
  69. <groupId>com.github.cage</groupId>
  70. <artifactId>cage</artifactId>
  71. <version>1.0</version>
  72. </dependency>
  73. <!-- mysql 驱动 -->
  74. <dependency>
  75. <groupId>mysql</groupId>
  76. <artifactId>mysql-connector-java</artifactId>
  77. <version>5.1.31</version>
  78. </dependency>
  79. <!-- 连接池 -->
  80. <dependency>
  81. <groupId>com.alibaba</groupId>
  82. <artifactId>druid</artifactId>
  83. <version>1.0.9</version>
  84. </dependency>
  85. <!-- 阿里短信接口 -->
  86. <dependency>
  87. <groupId>ali</groupId>
  88. <artifactId>sdk</artifactId>
  89. <version>0.1.0</version>
  90. </dependency>
  91. <!-- assembly -->
  92. <dependency>
  93. <groupId>tanukisoft</groupId>
  94. <artifactId>jsw</artifactId>
  95. <version>3.5.4</version>
  96. <scope>provided</scope>
  97. <type>zip</type>
  98. </dependency>
  99. <!-- qq接口 -->
  100. <dependency>
  101. <groupId>qq</groupId>
  102. <artifactId>Sdk4j</artifactId>
  103. <version>0.1.0</version>
  104. </dependency>
  105. <!-- spring start -->
  106. <dependency>
  107. <groupId>org.springframework</groupId>
  108. <artifactId>spring-core</artifactId>
  109. <version>${spring.version}</version>
  110. <exclusions>
  111. <exclusion>
  112. <artifactId>commons-logging</artifactId>
  113. <groupId>commons-logging</groupId>
  114. </exclusion>
  115. </exclusions>
  116. </dependency>
  117. <dependency>
  118. <groupId>org.springframework</groupId>
  119. <artifactId>spring-beans</artifactId>
  120. <version>${spring.version}</version>
  121. </dependency>
  122. <dependency>
  123. <groupId>org.springframework</groupId>
  124. <artifactId>spring-context</artifactId>
  125. <version>${spring.version}</version>
  126. </dependency>
  127. <dependency>
  128. <groupId>org.springframework</groupId>
  129. <artifactId>spring-context-support</artifactId>
  130. <version>${spring.version}</version>
  131. </dependency>
  132. <dependency>
  133. <groupId>org.springframework</groupId>
  134. <artifactId>spring-web</artifactId>
  135. <version>${spring.version}</version>
  136. </dependency>
  137. <dependency>
  138. <groupId>org.springframework</groupId>
  139. <artifactId>spring-webmvc</artifactId>
  140. <version>${spring.version}</version>
  141. </dependency>
  142. <dependency>
  143. <groupId>org.springframework</groupId>
  144. <artifactId>spring-jdbc</artifactId>
  145. <version>${spring.version}</version>
  146. </dependency>
  147. <dependency>
  148. <groupId>org.springframework</groupId>
  149. <artifactId>spring-orm</artifactId>
  150. <version>${spring.version}</version>
  151. </dependency>
  152. <dependency>
  153. <groupId>org.springframework.data</groupId>
  154. <artifactId>spring-data-jpa</artifactId>
  155. <version>1.6.2.RELEASE</version>
  156. </dependency>
  157. <dependency>
  158. <groupId>org.hibernate</groupId>
  159. <artifactId>hibernate-entitymanager</artifactId>
  160. <version>${hibernate.version}</version>
  161. </dependency>
  162. <!-- spring end -->
  163. <dependency>
  164. <groupId>org.aspectj</groupId>
  165. <artifactId>aspectjweaver</artifactId>
  166. <version>1.6.12</version>
  167. </dependency>
  168. <!-- mybatis -->
  169. <dependency>
  170. <groupId>org.mybatis</groupId>
  171. <artifactId>mybatis</artifactId>
  172. <version>3.2.8</version>
  173. </dependency>
  174. <dependency>
  175. <groupId>org.mybatis</groupId>
  176. <artifactId>mybatis-spring</artifactId>
  177. <version>1.2.2</version>
  178. </dependency>
  179. <dependency>
  180. <groupId>com.github.miemiedev</groupId>
  181. <artifactId>mybatis-paginator</artifactId>
  182. <version>1.2.17</version>
  183. </dependency>
  184. <!-- mybatis end -->
  185. <!-- utils -->
  186. <dependency>
  187. <groupId>org.apache.commons</groupId>
  188. <artifactId>commons-lang3</artifactId>
  189. <version>3.3.2</version>
  190. </dependency>
  191. <dependency>
  192. <groupId>commons-fileupload</groupId>
  193. <artifactId>commons-fileupload</artifactId>
  194. <version>1.3.1</version>
  195. </dependency>
  196. <dependency>
  197. <groupId>com.google.guava</groupId>
  198. <artifactId>guava</artifactId>
  199. <version>18.0</version>
  200. </dependency>
  201. <dependency>
  202. <groupId>com.fasterxml.jackson.core</groupId>
  203. <artifactId>jackson-databind</artifactId>
  204. <version>2.4.2</version>
  205. </dependency>
  206. <dependency>
  207. <groupId>com.fasterxml.jackson.module</groupId>
  208. <artifactId>jackson-module-jaxb-annotations</artifactId>
  209. <version>2.4.2</version>
  210. </dependency>
  211. <dependency>
  212. <groupId>joda-time</groupId>
  213. <artifactId>joda-time</artifactId>
  214. <version>2.4</version>
  215. </dependency>
  216. <dependency>
  217. <groupId>com.alibaba</groupId>
  218. <artifactId>fastjson</artifactId>
  219. <version>1.2.2</version>
  220. </dependency>
  221. <!-- logging -->
  222. <dependency>
  223. <groupId>org.slf4j</groupId>
  224. <artifactId>slf4j-api</artifactId>
  225. <version>${slf4j.version}</version>
  226. </dependency>
  227. <dependency>
  228. <groupId>org.slf4j</groupId>
  229. <artifactId>slf4j-log4j12</artifactId>
  230. <version>${slf4j.version}</version>
  231. </dependency>
  232. <dependency>
  233. <groupId>org.slf4j</groupId>
  234. <artifactId>jcl-over-slf4j</artifactId>
  235. <version>${slf4j.version}</version>
  236. </dependency>
  237. <dependency>
  238. <groupId>org.slf4j</groupId>
  239. <artifactId>jul-to-slf4j</artifactId>
  240. <version>${slf4j.version}</version>
  241. </dependency>
  242. <dependency>
  243. <groupId>log4j</groupId>
  244. <artifactId>log4j</artifactId>
  245. <version>${log4j.version}</version>
  246. </dependency>
  247.  
  248. <dependency>
  249. <groupId>javax.servlet.jsp.jstl</groupId>
  250. <artifactId>javax.servlet.jsp.jstl-api</artifactId>
  251. <version>1.2.1</version>
  252. </dependency>
  253. <dependency>
  254. <groupId>org.apache.taglibs</groupId>
  255. <artifactId>taglibs-standard-impl</artifactId>
  256. <version>1.2.1</version>
  257. </dependency>
  258.  
  259. <dependency>
  260. <groupId>org.apache.velocity</groupId>
  261. <artifactId>velocity</artifactId>
  262. <version>1.7</version>
  263. </dependency>
  264. <dependency>
  265. <groupId>org.bouncycastle</groupId>
  266. <artifactId>bcprov-jdk16</artifactId>
  267. <version>1.46</version>
  268. </dependency>
  269. <dependency>
  270. <groupId>org.jdom</groupId>
  271. <artifactId>jdom</artifactId>
  272. <version>2.0.2</version>
  273. </dependency>
  274. <!-- google 生成 二维码 -->
  275. <dependency>
  276. <groupId>com.google.zxing</groupId>
  277. <artifactId>javase</artifactId>
  278. <version>3.1.0</version>
  279. </dependency>
  280. <!-- Tomcat 7 -->
  281. <dependency>
  282. <!-- Eclipse JDT Java compiler -->
  283. <groupId>org.eclipse.jdt.core.compiler</groupId>
  284. <artifactId>ecj</artifactId>
  285. <version>4.4</version>
  286. <scope>provided</scope>
  287. </dependency>
  288. <dependency>
  289. <groupId>org.apache.tomcat.embed</groupId>
  290. <artifactId>tomcat-embed-core</artifactId>
  291. <version>${tomcat.version}</version>
  292. <scope>provided</scope>
  293. </dependency>
  294. <dependency>
  295. <groupId>org.apache.tomcat</groupId>
  296. <artifactId>tomcat-util</artifactId>
  297. <version>${tomcat.version}</version>
  298. <scope>provided</scope>
  299. </dependency>
  300. <dependency>
  301. <groupId>org.apache.tomcat</groupId>
  302. <artifactId>tomcat-annotations-api</artifactId>
  303. <version>${tomcat.version}</version>
  304. <scope>provided</scope>
  305. </dependency>
  306. <dependency>
  307. <!-- Interfaces shared by Catalina and Jasper -->
  308. <groupId>org.apache.tomcat</groupId>
  309. <artifactId>tomcat-api</artifactId>
  310. <version>${tomcat.version}</version>
  311. <scope>provided</scope>
  312. </dependency>
  313. <dependency>
  314. <!-- Tomcat Catalina implementation -->
  315. <groupId>org.apache.tomcat</groupId>
  316. <artifactId>tomcat-catalina</artifactId>
  317. <version>${tomcat.version}</version>
  318. <scope>provided</scope>
  319. </dependency>
  320. <dependency>
  321. <!-- Tomcat connectors and utility -->
  322. <groupId>org.apache.tomcat</groupId>
  323. <artifactId>tomcat-coyote</artifactId>
  324. <version>${tomcat.version}</version>
  325. <scope>provided</scope>
  326. </dependency>
  327. <dependency>
  328. <!-- Servlet 3.0 API -->
  329. <groupId>org.apache.tomcat</groupId>
  330. <artifactId>tomcat-servlet-api</artifactId>
  331. <version>${tomcat.version}</version>
  332. <scope>provided</scope>
  333. </dependency>
  334. <dependency>
  335. <!-- JSP 2.2 API -->
  336. <groupId>org.apache.tomcat</groupId>
  337. <artifactId>tomcat-jsp-api</artifactId>
  338. <version>${tomcat.version}</version>
  339. <scope>provided</scope>
  340. </dependency>
  341. <dependency>
  342. <!-- EL 2.2 API -->
  343. <groupId>org.apache.tomcat</groupId>
  344. <artifactId>tomcat-el-api</artifactId>
  345. <version>${tomcat.version}</version>
  346. <scope>provided</scope>
  347. </dependency>
  348. <dependency>
  349. <!-- Jasper 2 Compiler and Runtime -->
  350. <groupId>org.apache.tomcat</groupId>
  351. <artifactId>tomcat-jasper</artifactId>
  352. <version>${tomcat.version}</version>
  353. <scope>provided</scope>
  354. </dependency>
  355. <dependency>
  356. <!-- Jasper 2 EL implementation -->
  357. <groupId>org.apache.tomcat</groupId>
  358. <artifactId>tomcat-jasper-el</artifactId>
  359. <version>${tomcat.version}</version>
  360. <scope>provided</scope>
  361. </dependency>
  362.  
  363. <!-- test -->
  364. <dependency>
  365. <groupId>junit</groupId>
  366. <artifactId>junit</artifactId>
  367. <version>4.11</version>
  368. <scope>test</scope>
  369. </dependency>
  370. <dependency>
  371. <groupId>org.springframework</groupId>
  372. <artifactId>spring-test</artifactId>
  373. <version>${spring.version}</version>
  374. <scope>test</scope>
  375. </dependency>
  376. <dependency>
  377. <groupId>org.apache.poi</groupId>
  378. <artifactId>poi</artifactId>
  379. <version>3.10.1</version>
  380. <scope>test</scope>
  381. </dependency>
  382. <dependency>
  383. <groupId>org.apache.poi</groupId>
  384. <artifactId>poi-ooxml-schemas</artifactId>
  385. <version>3.10.1</version>
  386. <scope>test</scope>
  387. </dependency>
  388. <dependency>
  389. <groupId>org.apache.poi</groupId>
  390. <artifactId>poi-ooxml</artifactId>
  391. <version>3.10.1</version>
  392. <scope>test</scope>
  393. </dependency>
  394.  
  395. </dependencies>
  396.  
  397. <profiles>
  398. <profile>
  399. <id>package-bin</id>
  400. <activation>
  401. <property>
  402. <name>package.bin</name>
  403. <value>true</value>
  404. </property>
  405. </activation>
  406. <build>
  407. <plugins>
  408. <plugin>
  409. <groupId>org.apache.maven.plugins</groupId>
  410. <artifactId>maven-assembly-plugin</artifactId>
  411. <executions>
  412. <execution>
  413. <phase>package</phase>
  414. <goals>
  415. <goal>single</goal>
  416. </goals>
  417. <configuration>
  418. <descriptors>
  419. <descriptor>assembly/assembly-production.xml</descriptor>
  420. </descriptors>
  421. </configuration>
  422. </execution>
  423. </executions>
  424. </plugin>
  425. </plugins>
  426. </build>
  427. </profile>
  428. </profiles>
  429.  
  430. <build>
  431. <plugins>
  432. <plugin>
  433. <groupId>org.mortbay.jetty</groupId>
  434. <artifactId>jetty-maven-plugin</artifactId>
  435. <version>7.6.11.v20130520</version>
  436. <configuration>
  437. <scanIntervalSeconds>
  438. 2
  439. </scanIntervalSeconds>
  440. <useFileMappedBuffer>false</useFileMappedBuffer>
  441. <systemProperties>
  442. <systemProperty>
  443. <name>spring.profiles.active</name>
  444. <value>development</value>
  445. </systemProperty>
  446. </systemProperties>
  447. <useTestClasspath>true</useTestClasspath>
  448. </configuration>
  449. </plugin>
  450. <plugin>
  451. <groupId>org.apache.maven.plugins</groupId>
  452. <artifactId>maven-surefire-plugin</artifactId>
  453. <version>2.17</version>
  454. <configuration>
  455. <argLine>-Xmx256M</argLine>
  456. <includes>
  457. <include>**/*Test.java</include>
  458. </includes>
  459. <useSystemClassLoader>false</useSystemClassLoader>
  460. </configuration>
  461. </plugin>
  462. <!-- cobertura插件 -->
  463. <plugin>
  464. <groupId>org.codehaus.mojo</groupId>
  465. <artifactId>cobertura-maven-plugin</artifactId>
  466. <version>2.6</version>
  467. <configuration>
  468. <instrumentation>
  469. <excludes>
  470. <exclude>**/entity/**/*.class</exclude>
  471. </excludes>
  472. </instrumentation>
  473. </configuration>
  474. </plugin>
  475.  
  476. <!-- eclipse插件,设定下载Source并屏幕svn文件 -->
  477. <plugin>
  478. <groupId>org.apache.maven.plugins</groupId>
  479. <artifactId>maven-eclipse-plugin</artifactId>
  480. <version>2.9</version>
  481. <configuration>
  482. <sourceExcludes>
  483. <sourceExclude>**/.svn/</sourceExclude>
  484. </sourceExcludes>
  485. <downloadSources>false</downloadSources>
  486. <downloadJavadocs>false</downloadJavadocs>
  487. <wtpversion>2.0</wtpversion>
  488. <additionalProjectnatures>
  489. <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
  490. </additionalProjectnatures>
  491. </configuration>
  492. </plugin>
  493.  
  494. <plugin>
  495. <groupId>org.apache.maven.plugins</groupId>
  496. <artifactId>maven-compiler-plugin</artifactId>
  497. <version>3.1</version>
  498. <configuration>
  499. <source>1.7</source>
  500. <target>1.7</target>
  501. </configuration>
  502. </plugin>
  503. <!-- <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId>
  504. <version>2.2</version> <configuration> <url>http://112.74.105.129/manager/text</url>
  505. <username>yishangjia</username> <password>esga1234</password> <path>/ROOT</path>
  506. </configuration> </plugin> -->
  507. <plugin>
  508. <groupId>org.apache.tomcat.maven</groupId>
  509. <artifactId>tomcat7-maven-plugin</artifactId>
  510. <version>2.2</version>
  511. <configuration>
  512. <uriEncoding>UTF-8</uriEncoding>
  513. <path>/</path>
  514. </configuration>
  515. </plugin>
  516. <!--将class文件打成jar -->
  517. <plugin>
  518. <groupId>org.apache.maven.plugins</groupId>
  519. <artifactId>maven-war-plugin</artifactId>
  520. <configuration>
  521. <!-- 释放将项目的类文件打成jar放到lib目录中。 打成jar的好处是:只修改class时,可以只更新jar。 -->
  522. <archiveClasses>true</archiveClasses>
  523. </configuration>
  524. </plugin>
  525. <plugin>
  526. <groupId>com.samaxes.maven</groupId>
  527. <artifactId>minify-maven-plugin</artifactId>
  528. <version>1.7.5</version>
  529. <executions>
  530. <execution>
  531. <id>assets-minify</id>
  532. <phase>process-resources</phase>
  533. <configuration>
  534. <!-- css -->
  535. <cssEngine>YUI</cssEngine>
  536. <cssSourceDir>assets</cssSourceDir>
  537. <cssSourceIncludes>
  538. <cssSourceInclude>styles/**/**.css</cssSourceInclude>
  539. </cssSourceIncludes>
  540. <!-- <cssSourceExcludes> <cssSourceExclude>vendors/**.css</cssSourceExclude>
  541. </cssSourceExcludes> -->
  542. <!-- js -->
  543. <jsEngine>CLOSURE</jsEngine>
  544. <jsSourceDir>assets</jsSourceDir>
  545. <jsSourceIncludes>
  546. <jsSourceInclude>scripts/**/**.js</jsSourceInclude>
  547. </jsSourceIncludes>
  548. <!-- <jsSourceExcludes> <jsSourceExclude>vendors/**/*.min.js</jsSourceExclude>
  549. </jsSourceExcludes> -->
  550. <!-- others -->
  551. <skipMerge>true</skipMerge>
  552. <nosuffix>true</nosuffix>
  553. <verbose>false</verbose>
  554. </configuration>
  555. <goals>
  556. <goal>minify</goal>
  557. </goals>
  558. </execution>
  559. </executions>
  560. </plugin>
  561. <plugin>
  562. <groupId>org.apache.maven.plugins</groupId>
  563. <artifactId>maven-war-plugin</artifactId>
  564. <version>2.6</version>
  565. <configuration>
  566. <warSourceExcludes>assets/styles/**/**.css,assets/scripts/**/**.js</warSourceExcludes>
  567. <warName>${project.artifactId}</warName>
  568. </configuration>
  569. </plugin>
  570.  
  571. </plugins>
  572. <testResources>
  573. <testResource>
  574. <directory>src/test/resources</directory>
  575. <filtering>true</filtering>
  576. </testResource>
  577. <testResource>
  578. <directory>src/main/webapp</directory>
  579. <filtering>true</filtering>
  580. <includes>
  581. <include>**/*.xml</include>
  582. </includes>
  583. </testResource>
  584. </testResources>
  585. </build>
  586.  
  587. </project>

classpath文件是:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <classpath>
  3. <classpathentry kind="src" output="target/classes" path="src/main/java"/>
  4. <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
  5. <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
  6. <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
  7. <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/main/webapp"/>
  8. <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
  9. <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
  10. <classpathentry kind="output" path="target/classes"/>
  11. </classpath>

普通项目需要导入对应的jar包,

然后右击,run as java application 即可启动项目;

项目抛弃Tomcat容器,用代码启动Tomcat插件的更多相关文章

  1. 如何使用java代码启动tomcat和打开浏览器

    1.用于代码启动tomcat,也可以用代码运行电脑应用程序 public static void main(String[] args) { /* new MyThread().start(); ne ...

  2. Servlet容器的启动(Tomcat为例)

    一.容器简介 在tomcat容器等级中,context容器直接管理servlet在容器中的包装类Wrapper,所以Context容器如何运行将直接影响servlet的工作方式. tomcat容器模型 ...

  3. 脱离开发软件启动Tomcat访问项目

    作为开发人员平时用的最多的就是通过开发软件启动Tomcat服务,从而访问项目.这样便于开发的bug调试 此处讲的是脱离开发软件启动Tomcat访问项目 链接参考: http://jingyan.bai ...

  4. 给tomcat容器配置SSL的记录,包含项目完整部署过程

    给tomcat容器配置SSL(https) 昨天公司有一个旧的项目要部署, 服务器(OS是windows 10) 数据库都是新买的, 写个博客记录一下 1, 下载证书(以阿里云为例子) 参考链接: h ...

  5. 深入浅出Tomcat/4 - Tomcat容器

    Container是一个Tomcat容器的接口,Tomcat有四种容器 ·     Engine ·     Host ·     Context ·     Wrapper Engine代表整个Ca ...

  6. Spring Boot2.0之 原理—创建内置Tomcat容器

    前面所述的https://www.cnblogs.com/toov5/p/9823728.html 中的第一条先不赘述了,就是玩了maven 重点介绍后两条 首先内置Tomcat: SpringBoo ...

  7. IDEA启动tomcat报错:java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext、ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component

    先看错误日志: -May- ::.M26 -May- :: :: UTC -May- ::29.845 信息 [main] org.apache.catalina.startup.VersionLog ...

  8. Tomcat剖析(五):Tomcat 容器

    Tomcat剖析(五):Tomcat 容器 1. Tomcat剖析(一):一个简单的Web服务器 2. Tomcat剖析(二):一个简单的Servlet服务器 3. Tomcat剖析(三):连接器(1 ...

  9. SpringBoot 源码解析 (七)----- Spring Boot的核心能力 - 自定义Servlet、Filter、Listener是如何注册到Tomcat容器中的?(SpringBoot实现SpringMvc的原理)

    上一篇我们讲了SpringBoot中Tomcat的启动过程,本篇我们接着讲在SpringBoot中如何向Tomcat中添加Servlet.Filter.Listener 自定义Servlet.Filt ...

随机推荐

  1. 环信EaseUI集成错误 Unknown type name 'NSString' NSLocalizedString

    环信集成本来认为很简单的,有现成的UI,照着文档直接傻瓜操作就行,没曾想聊天记录不能长时间保存,于是乎就有了这篇记录环信坑的笔记 在下载的环信的SDK时候里面会有两个包,一个完整版的,一个简洁版的,导 ...

  2. Inondb中的checkpoint

    checkpoint主要是为了解决一下问题: 1.缩短数据库的恢复时间 2.缓冲池不够用时,将脏页刷新到磁盘 3.重做日志不可用时,刷新脏页 Innodb引擎使用LSN(log sequence nu ...

  3. 15. 使用Apache Curator装饰ZooKeeper

    Apache ZooKeeper是为了帮助解决复杂问题的软件工具,它可以帮助用户从复杂的实现中解救出来. 然而,ZooKeeper只暴露了原语,这取决于用户如何使用这些原语来解决应用程序中的协调问题. ...

  4. InlineModelAdmin对象的学习

    一.InlineModelAdmin的介绍 管理界面可以在与父模型相同的页面上编辑模型.这些被称为内联. Django提供了两个子类,InlineModelAdmin它们是: TabularInlin ...

  5. 电子证据 利用Kali进行wifi钓鱼实战详细教程

    电子证据 利用Kali进行wifi钓鱼实战详细教程 一. Kali系统安装和必要软件安装: 1.Kali最新版可以来我这儿拿外置驱动和光盘装,目测用U盘装最新版有些问题,比较麻烦. 2.Kali更新源 ...

  6. MySql(十六):MySql架构设计——MySQL Cluster

    前言: MySQL Cluster 是一个基于 NDB Cluster 存储引擎的完整的分布式数据库系统.不仅仅具有高可用性,而且可以自动切分数据,冗余数据等高级功能.和 Oracle Real Cl ...

  7. 负载均衡层次结构:LVS Nginx DNS CDN

    文章地址:http://blog.csdn.net/mindfloating/article/details/51020767 作为后端应用的开发者,我们经常开发.调试.测试完我们的应用并发布到生产环 ...

  8. scala中json与对象的转换

    遇到的问题 因为要把spark从es读出来的json数据转换为对象,开始想用case class定义类型,通过fastjson做转换.如下 case class Book (author: Strin ...

  9. Android:percent 布局

    Android 新引入的布局,百分比布局,Percent 布局 主要分为两种:PercentFrameLayout he PercentRelativeLayout 布局 通过 support 库引入 ...

  10. ConEmu配置task的脚本

    1.Bash::Msys2-64 set CHERE_INVOKING= & set .exe -new_console:p %ConEmuDrive%\msys64\usr\bin\bash ...