mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-29 08:05:04 +08:00
Initial Commit
This commit is contained in:
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
.idea/
|
||||||
|
out/
|
||||||
|
/.metadata/
|
||||||
|
/web/META-INF/context.xml
|
||||||
|
*.iml
|
||||||
|
~*
|
||||||
|
.DS_Store
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
BIN
lib/slf4j-simple-1.7.12.jar
Normal file
BIN
lib/slf4j-simple-1.7.12.jar
Normal file
Binary file not shown.
35
src/love/sola/netsupport/Index.java
Normal file
35
src/love/sola/netsupport/Index.java
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
package love.sola.netsupport;
|
||||||
|
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.annotation.WebServlet;
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2014/8/4.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
@WebServlet(name = "Index",urlPatterns = "/",loadOnStartup = 1)
|
||||||
|
public class Index extends HttpServlet {
|
||||||
|
|
||||||
|
|
||||||
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
doGet(request, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
request.setCharacterEncoding("utf-8");
|
||||||
|
response.addHeader("Content-type", "text/plain;charset=utf-8");
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
PrintWriter out = response.getWriter();
|
||||||
|
out.println("Wechat Ticket System (WTS) 0.1 Copyright 2015 Sola all rights reserved. | Commercial license for ZSC Network Support Department (ZSCNSD).");
|
||||||
|
out.println("For any problem, Please contact loli@sola.love.");
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
src/love/sola/netsupport/api/GetUser.java
Normal file
48
src/love/sola/netsupport/api/GetUser.java
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
package love.sola.netsupport.api;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import love.sola.netsupport.sql.SQLQuery;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.annotation.WebServlet;
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2014/8/20.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
@WebServlet(name = "GetUser",urlPatterns = "/api/getuser",loadOnStartup = 1)
|
||||||
|
public class GetUser extends HttpServlet {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(ServletConfig config) throws ServletException {
|
||||||
|
super.init(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
doGet(request, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
request.setCharacterEncoding("utf-8");
|
||||||
|
response.addHeader("Content-type", "text/plain;charset=utf-8");
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
PrintWriter out = response.getWriter();
|
||||||
|
String name = request.getParameter("name");
|
||||||
|
if (name == null) {
|
||||||
|
out.println("Username required.");
|
||||||
|
} else {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
out.println(gson.toJson(SQLQuery.getUserFromName(name)));
|
||||||
|
}
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
56
src/love/sola/netsupport/enums/ISPType.java
Normal file
56
src/love/sola/netsupport/enums/ISPType.java
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
package love.sola.netsupport.enums;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2014/8/20.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
public enum ISPType {
|
||||||
|
|
||||||
|
|
||||||
|
TELECOM("Telecom", 1),
|
||||||
|
UNICOM("Unicom", 2),
|
||||||
|
CHINAMOBILE("ChinaMobile", 3),;
|
||||||
|
|
||||||
|
private static final Map<String, ISPType> NAME_MAP = new HashMap<>();
|
||||||
|
private static final Map<Integer, ISPType> ID_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
for (ISPType type : values()) {
|
||||||
|
if (type.name != null) {
|
||||||
|
NAME_MAP.put(type.name.toLowerCase(), type);
|
||||||
|
}
|
||||||
|
if (type.id > 0) {
|
||||||
|
ID_MAP.put(type.id, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final String name;
|
||||||
|
public final int id;
|
||||||
|
|
||||||
|
ISPType(String name, int id) {
|
||||||
|
this.name = name;
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ISPType fromName(String name) {
|
||||||
|
if (name == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return NAME_MAP.get(name.toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ISPType fromId(int id) {
|
||||||
|
return ID_MAP.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
24
src/love/sola/netsupport/pojo/User.java
Normal file
24
src/love/sola/netsupport/pojo/User.java
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
package love.sola.netsupport.pojo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import love.sola.netsupport.enums.ISPType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2014/8/20.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class User {
|
||||||
|
|
||||||
|
private final int id;
|
||||||
|
private final String name;
|
||||||
|
private final long studentId;
|
||||||
|
private String netAccount;
|
||||||
|
private ISPType isp;
|
||||||
|
private String wechatId;
|
||||||
|
|
||||||
|
}
|
||||||
63
src/love/sola/netsupport/sql/SQLQuery.java
Normal file
63
src/love/sola/netsupport/sql/SQLQuery.java
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
package love.sola.netsupport.sql;
|
||||||
|
|
||||||
|
import love.sola.netsupport.pojo.User;
|
||||||
|
import love.sola.netsupport.enums.ISPType;
|
||||||
|
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2014/8/20.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
public class SQLQuery {
|
||||||
|
|
||||||
|
public static final String COLUMN_ID = "id";
|
||||||
|
public static final String COLUMN_NAME = "name";
|
||||||
|
public static final String COLUMN_STUDENT_ID = "studentid";
|
||||||
|
public static final String COLUMN_NET_ACCOUNT = "netaccount";
|
||||||
|
public static final String COLUMN_ISP = "isp";
|
||||||
|
public static final String COLUMN_WECHAT = "wechat";
|
||||||
|
|
||||||
|
public static DataSource ds;
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
InitialContext ic = new InitialContext();
|
||||||
|
ds = (DataSource) ic.lookup("java:comp/env/jdbc/netsupport");
|
||||||
|
ds.setLoginTimeout(3);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static User getUserFromName(String name) {
|
||||||
|
Connection conn = null;
|
||||||
|
try {
|
||||||
|
conn = ds.getConnection();
|
||||||
|
PreparedStatement ps = conn.prepareStatement("SELECT * FROM user_info WHERE name=?");
|
||||||
|
ps.setString(1, name);
|
||||||
|
ResultSet rs = ps.executeQuery();
|
||||||
|
if (rs.next()) {
|
||||||
|
return new User(rs.getInt(COLUMN_ID),
|
||||||
|
rs.getString(COLUMN_NAME),
|
||||||
|
rs.getLong(COLUMN_STUDENT_ID),
|
||||||
|
rs.getString(COLUMN_NET_ACCOUNT),
|
||||||
|
ISPType.fromId(rs.getInt(COLUMN_ISP)),
|
||||||
|
rs.getString(COLUMN_WECHAT));
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
} finally {
|
||||||
|
if (conn != null) try { conn.close(); } catch (SQLException e) { }
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
102
src/love/sola/netsupport/wechat/WxMpServlet.java
Normal file
102
src/love/sola/netsupport/wechat/WxMpServlet.java
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
package love.sola.netsupport.wechat;
|
||||||
|
|
||||||
|
import love.sola.netsupport.wechat.handler.RegisterHandler;
|
||||||
|
import me.chanjar.weixin.common.util.StringUtils;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpMessageRouter;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpService;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpServiceImpl;
|
||||||
|
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
||||||
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
|
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.annotation.WebServlet;
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2015/11/2.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
@WebServlet(name = "WxMpServlet", urlPatterns = "/wechattest", loadOnStartup = 2)
|
||||||
|
public class WxMpServlet extends HttpServlet {
|
||||||
|
|
||||||
|
public static WxMpServlet instance;
|
||||||
|
protected WxMpInMemoryConfigStorage config;
|
||||||
|
protected WxMpService wxMpService;
|
||||||
|
protected WxMpMessageRouter wxMpMessageRouter;
|
||||||
|
|
||||||
|
public WxMpServlet() {
|
||||||
|
instance = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() throws ServletException {
|
||||||
|
super.init();
|
||||||
|
|
||||||
|
config = new WxMpInMemoryConfigStorage();
|
||||||
|
config.setAppId("*****");
|
||||||
|
config.setSecret("*****");
|
||||||
|
config.setToken("*****");
|
||||||
|
// config.setAesKey("SolaAES");
|
||||||
|
|
||||||
|
wxMpService = new WxMpServiceImpl();
|
||||||
|
wxMpService.setWxMpConfigStorage(config);
|
||||||
|
wxMpMessageRouter = new WxMpMessageRouter(wxMpService);
|
||||||
|
wxMpMessageRouter.rule().async(false).rContent("^").handler(new RegisterHandler()).end();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||||
|
throws ServletException, IOException {
|
||||||
|
|
||||||
|
response.setContentType("text/html;charset=utf-8");
|
||||||
|
response.setStatus(HttpServletResponse.SC_OK);
|
||||||
|
|
||||||
|
String signature = request.getParameter("signature");
|
||||||
|
String nonce = request.getParameter("nonce");
|
||||||
|
String timestamp = request.getParameter("timestamp");
|
||||||
|
|
||||||
|
if (!wxMpService.checkSignature(timestamp, nonce, signature)) {
|
||||||
|
// Signature fail
|
||||||
|
response.getWriter().println("Access Denied");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String echostr = request.getParameter("echostr");
|
||||||
|
if (StringUtils.isNotBlank(echostr)) {
|
||||||
|
// validate request
|
||||||
|
response.getWriter().println(echostr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String encryptType = StringUtils.isBlank(request.getParameter("encrypt_type")) ? "raw" : request.getParameter("encrypt_type");
|
||||||
|
|
||||||
|
if ("raw".equals(encryptType)) {
|
||||||
|
WxMpXmlMessage inMessage = WxMpXmlMessage.fromXml(request.getInputStream());
|
||||||
|
WxMpXmlOutMessage outMessage = wxMpMessageRouter.route(inMessage);
|
||||||
|
response.getWriter().write(outMessage.toXml());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("aes".equals(encryptType)) {
|
||||||
|
String msgSignature = request.getParameter("msg_signature");
|
||||||
|
WxMpXmlMessage inMessage = WxMpXmlMessage.fromEncryptedXml(request.getInputStream(), config, timestamp, nonce, msgSignature);
|
||||||
|
WxMpXmlOutMessage outMessage = wxMpMessageRouter.route(inMessage);
|
||||||
|
response.getWriter().write(outMessage.toEncryptedXml(config));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
response.getWriter().println("Unknown encrypt-type");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||||
|
doPost(req, resp);
|
||||||
|
}
|
||||||
|
}
|
||||||
10
src/love/sola/netsupport/wechat/handler/HandlerList.java
Normal file
10
src/love/sola/netsupport/wechat/handler/HandlerList.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package love.sola.netsupport.wechat.handler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2015/11/5.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
public class HandlerList {
|
||||||
|
}
|
||||||
27
src/love/sola/netsupport/wechat/handler/RegisterHandler.java
Normal file
27
src/love/sola/netsupport/wechat/handler/RegisterHandler.java
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package love.sola.netsupport.wechat.handler;
|
||||||
|
|
||||||
|
import me.chanjar.weixin.common.exception.WxErrorException;
|
||||||
|
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpService;
|
||||||
|
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
||||||
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2015/11/4.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
public class RegisterHandler implements WxMpMessageHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService, WxSessionManager sessionManager)
|
||||||
|
throws WxErrorException {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package love.sola.netsupport.wechat.intercepter;
|
||||||
|
|
||||||
|
import com.google.common.cache.Cache;
|
||||||
|
import com.google.common.cache.CacheBuilder;
|
||||||
|
import me.chanjar.weixin.common.exception.WxErrorException;
|
||||||
|
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpMessageInterceptor;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpService;
|
||||||
|
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2015/11/4.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
public class CheckSpamIntercepter implements WxMpMessageInterceptor {
|
||||||
|
|
||||||
|
private static Cache<String, Long> cache = CacheBuilder.newBuilder()
|
||||||
|
.concurrencyLevel(4)
|
||||||
|
.weakKeys()
|
||||||
|
.maximumSize(10000)
|
||||||
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean intercept(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService, WxSessionManager sessionManager) throws WxErrorException {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
80
web/WEB-INF/web.xml
Normal file
80
web/WEB-INF/web.xml
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<!-- General description of your web application -->
|
||||||
|
|
||||||
|
<display-name>Network Support Application</display-name>
|
||||||
|
<description>
|
||||||
|
If you have any problem, please contact loli@sola.love .
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<!-- Servlet definitions for the servlets that make up
|
||||||
|
your web application, including initialization
|
||||||
|
parameters. With Tomcat, you can also send requests
|
||||||
|
to servlets not listed here with a request like this:
|
||||||
|
|
||||||
|
http://localhost:8080/{context-path}/servlet/{classname}
|
||||||
|
|
||||||
|
but this usage is not guaranteed to be portable. It also
|
||||||
|
makes relative references to images and other resources
|
||||||
|
required by your servlet more complicated, so defining
|
||||||
|
all of your servlets (and defining a mapping to them with
|
||||||
|
a servlet-mapping element) is recommended.
|
||||||
|
|
||||||
|
Servlet initialization parameters can be retrieved in a
|
||||||
|
servlet or JSP page by calling:
|
||||||
|
|
||||||
|
String value =
|
||||||
|
getServletConfig().getInitParameter("name");
|
||||||
|
|
||||||
|
where "name" matches the <param-name> element of
|
||||||
|
one of these initialization parameters.
|
||||||
|
|
||||||
|
You can define any number of servlets, including zero.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>C3P0Test</servlet-name>
|
||||||
|
<servlet-class>love.sola.netsupport.C3P0Test</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Define mappings that are used by the servlet container to
|
||||||
|
translate a particular request URI (context-relative) to a
|
||||||
|
particular servlet. The examples below correspond to the
|
||||||
|
servlet descriptions above. Thus, a request URI like:
|
||||||
|
|
||||||
|
http://localhost:8080/{contextpath}/graph
|
||||||
|
|
||||||
|
will be mapped to the "graph" servlet, while a request like:
|
||||||
|
|
||||||
|
http://localhost:8080/{contextpath}/saveCustomer.do
|
||||||
|
|
||||||
|
will be mapped to the "controller" servlet.
|
||||||
|
|
||||||
|
You may define any number of servlet mappings, including zero.
|
||||||
|
It is also legal to define more than one mapping for the same
|
||||||
|
servlet, if you wish to.
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>C3P0Test</servlet-name>
|
||||||
|
<url-pattern>/c3p0test</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Define the default session timeout for your application,
|
||||||
|
in minutes. From a servlet or JSP page, you can modify
|
||||||
|
the timeout for a particular session dynamically by using
|
||||||
|
HttpSession.getMaxInactiveInterval(). -->
|
||||||
|
|
||||||
|
<session-config>
|
||||||
|
<session-timeout>30</session-timeout> <!-- 30 minutes -->
|
||||||
|
</session-config>
|
||||||
|
|
||||||
|
</web-app>
|
||||||
Reference in New Issue
Block a user