spring+druid+mybatis samples
This commit is contained in:
64
spring/spring-druid-mybatis/src/main/webapp/WEB-INF/web.xml
Normal file
64
spring/spring-druid-mybatis/src/main/webapp/WEB-INF/web.xml
Normal file
@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
|
||||
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
||||
version="3.1">
|
||||
|
||||
<!--配置spring前端控制器-->
|
||||
<servlet>
|
||||
<servlet-name>springMvc</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>classpath:springApplication.xml</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>springMvc</servlet-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<!-- 配置 Druid 监控信息显示页面 访问地址 <a src="http://localhost:8080/druid/index.html"> -->
|
||||
<servlet>
|
||||
<servlet-name>DruidStatView</servlet-name>
|
||||
<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
|
||||
<init-param>
|
||||
<!-- 允许清空统计数据 -->
|
||||
<param-name>resetEnable</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- 用户名 -->
|
||||
<param-name>loginUsername</param-name>
|
||||
<param-value>druid</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- 密码 -->
|
||||
<param-name>loginPassword</param-name>
|
||||
<param-value>druid</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>DruidStatView</servlet-name>
|
||||
<url-pattern>/druid/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<!--配置WebStatFilter用于采集web-jdbc关联监控的数据-->
|
||||
<filter>
|
||||
<filter-name>DruidWebStatFilter</filter-name>
|
||||
<filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>exclusions</param-name>
|
||||
<param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>DruidWebStatFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
|
||||
</web-app>
|
9
spring/spring-druid-mybatis/src/main/webapp/index.jsp
Normal file
9
spring/spring-druid-mybatis/src/main/webapp/index.jsp
Normal file
@ -0,0 +1,9 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>index</title>
|
||||
</head>
|
||||
<body>
|
||||
hello Spring !
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user