apply-clients 3.5.5-64 → 3.5.5-66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/build/dev-server.js +11 -8
  2. package/package.json +1 -1
  3. package/src/App.vue +25 -25
  4. package/src/components/android/AppCheckTakePic.vue +168 -168
  5. package/src/components/android/Process/AppChargeList.vue +391 -391
  6. package/src/components/android/Process/AppExplorationUser.vue +508 -508
  7. package/src/components/android/Process/AppServiceControl.vue +1755 -1755
  8. package/src/components/product/PcZhihuanManagement.vue +160 -160
  9. package/src/components/product/Print/BuildOrder/buildOrderList.vue +339 -339
  10. package/src/components/product/Process/Processes/selectApply.vue +251 -251
  11. package/src/components/product/Process/Processes/selectBcakApply.vue +250 -250
  12. package/src/components/product/Supervisory/SupervisoryControl.vue +141 -141
  13. package/src/filiale/fugou/android/AppAddMaterialScience.vue +444 -444
  14. package/src/filiale/fugou/android/AppAddReplacement.vue +341 -341
  15. package/src/filiale/fugou/android/AppChargeManagement.vue +739 -739
  16. package/src/filiale/fugou/android/AppExplorationUser.vue +508 -508
  17. package/src/filiale/fugou/android/AppInstallationDetails.vue +542 -542
  18. package/src/filiale/fugou/android/AppServiceControl.vue +1840 -1840
  19. package/src/filiale/fugou/pc/AddReplacement.vue +340 -340
  20. package/src/filiale/fugou/pc/ExplorationSelect.vue +524 -524
  21. package/src/filiale/fugou/pc/ServiceControl.vue +1714 -1712
  22. package/src/filiale/fugou/pc/StopApplyList.vue +291 -291
  23. package/src/filiale/fugou/pc/addMaterialScience.vue +481 -481
  24. package/src/filiale/fugou/pc/addressAndUserinfoManagement.vue +216 -216
  25. package/src/filiale/fugou/pc/chargeReport.vue +215 -215
  26. package/src/filiale/fugou/pc.js +18 -18
  27. package/src/filiale/jinhuang/pc/ServiceControl.vue +1932 -1932
  28. package/src/filiale/yangchunboneng/android/AppExplorationUser.vue +585 -585
  29. package/src/filiale/yangchunboneng/android/AppInstallationMaterial.vue +1116 -1116
  30. package/src/filiale/yangchunboneng/android/AppProcessSupervisory.vue +331 -331
  31. package/src/filiale/yangchunboneng/android/AppSuperServiceControl.vue +1524 -1524
  32. package/src/filiale/yangchunboneng/android/AppUpload.vue +205 -205
  33. package/src/filiale/yangchunboneng/pc/ApplyUpload.vue +392 -392
  34. package/src/filiale/yangchunboneng/pc/ExplorationUser.vue +191 -191
  35. package/src/filiale/yangchunboneng/pc/InstallInfoSelect.vue +365 -365
  36. package/src/filiale/yangchunboneng/pc/StopApplyList.vue +294 -294
  37. package/src/filiale/yangchunboneng/pc/SupervisoryControlNew.vue +142 -142
  38. package/src/filiale/yangchunboneng/pc/SupervisoryServiceControl.vue +902 -902
  39. package/src/filiale/yangchunboneng/pc/SupervisoryServiceControlNew.vue +901 -901
  40. package/src/filiale/yangchunboneng/pc/buildOrderList.vue +337 -337
  41. package/src/filiale/yangchunboneng/pc/printBuildOrder.vue +173 -172
  42. package/src/filiale/yangchunboneng/pc.js +27 -27
  43. package/src/main.js +1 -2
  44. package/src/test/SessionTestServlet.java +69 -0
  45. package/webapp/WEB-INF/web.xml +52 -0
  46. package/webapp/session-test.jsp +59 -0
@@ -1,172 +1,173 @@
1
- <template>
2
- <style id="printBuildOrderStyle">
3
- #printBuildOrder td{
4
- height: 30px;
5
- text-align: center;
6
- }
7
- #printBuildOrder table{
8
- margin: auto;
9
- width: 100%;
10
- border-collapse:collapse;
11
- border: 1px solid black;
12
- }
13
- #printBuildOrder h1,h2,h3,h4,h5,h6 {
14
- text-align: center;
15
- }
16
- .sign {
17
- vertical-align: top;
18
- padding: 10px;
19
- }
20
- .material {
21
- text-align: left;
22
- vertical-align: top;
23
- padding: 10px;
24
- }
25
- </style>
26
-
27
- <div id="printBuildOrder">
28
- <h2><span style="letter-spacing: 15px">阳春市博能燃气有限公司</span></h2>
29
- <h2><span style="letter-spacing: 15px">工程派工单</span></h2>
30
- <table border="1">
31
- <tr>
32
- <td>用户编号:</td>
33
- <td>{{ selectdata.f_userinfo_code }}</td>
34
- <td>工单编号:</td>
35
- <td>{{ selectdata.f_child_apply_num }}</td>
36
- <td>工程编号:</td>
37
- <td>{{ selectdata.f_apply_num }}</td>
38
- </tr>
39
- <tr>
40
- <td>用户名称:</td>
41
- <td>{{ selectdata.f_user_name }}</td>
42
- <td>派工日期:</td>
43
- <td>{{ selectdata.f_dispatch_date }}</td>
44
- </tr>
45
- <tr>
46
- <td>地址:</td>
47
- <td colspan="5">{{ selectdata.f_address}}</td>
48
- </tr>
49
- <tr>
50
- <td>户数:</td>
51
- <td>{{ selectdata.f_apply_count}}</td>
52
- <td>用气点数量:</td>
53
- <td>{{ selectdata.f_furnace_num }}</td>
54
- <td>报建类型:</td>
55
- <td>{{ selectdata.f_apply_type }}</td>
56
- </tr>
57
- <tr>
58
- <td>区域:</td>
59
- <td>{{ selectdata.f_apply_region }}</td>
60
- <td>是否内投:</td>
61
- <td>{{ selectdata.f_is_inward }}</td>
62
- <td>报建性质:</td>
63
- <td>{{ selectdata.f_gas_nature }}</td>
64
- </tr>
65
- <tr>
66
- <td>联系人:</td>
67
- <td>{{ selectdata.f_user_name }}</td>
68
- <td>用户电话:</td>
69
- <td>{{ selectdata.f_phone }}</td>
70
- <td>预计通气时间:</td>
71
- <td>{{ selectdata.f_yjgase_time }}</td>
72
- </tr>
73
- <tr>
74
- <td>施工人:</td>
75
- <td>{{ selectdata.f_budget_people }}</td>
76
- <td>用气设备:</td>
77
- <td>{{ selectdata.f_gas_appliances }}</td>
78
- <td>计划开工时间:</td>
79
- <td>{{ selectdata.f_release_date }}</td>
80
- </tr>
81
- <tr>
82
- <td>施工内容:</td>
83
- <td colspan="3">{{ selectdata.f_install_situation }}</td>
84
- <td>计划完工时间:</td>
85
- <td>{{ selectdata.f_commencement_date }}</td>
86
- </tr>
87
- <tr>
88
- <td>备注:</td>
89
- <td colspan="5">{{ selectdata.f_apply_remarks }}</td>
90
- </tr>
91
- <tr>
92
- <td>派单人:</td>
93
- <td>{{ selectdata.f_dispatcher }}</td>
94
- <td colspan="2"></td>
95
- <td>操作人:</td>
96
- <td>{{ f_operator }}</td>
97
- </tr>
98
- </table>
99
- </div>
100
- <print-element v-show="false" v-ref:print id='printBuildOrder' styleid='printBuildOrderStyle'
101
- top='10' left='30' width='100%' height='100%' :type="type">
102
- </print-element>
103
- </template>
104
-
105
- <script>
106
- Date.prototype.Format = function (fmt) {
107
- var o = {
108
- "M+": this.getMonth() + 1, //月份
109
- "d+": this.getDate(), //日
110
- "H+": this.getHours(), //小时
111
- "m+": this.getMinutes(), //分
112
- "s+": this.getSeconds(), //秒
113
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
114
- "S": this.getMilliseconds() //毫秒
115
- };
116
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
117
- for (var k in o)
118
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
119
- return fmt;
120
- }
121
- export default {
122
- title: '施工安装通知单',
123
- props: {
124
- selectdata: {
125
- type: Object
126
- },
127
- type: {
128
- type: String
129
- }
130
- },
131
- data () {
132
- return {
133
- f_operator: this.$login.f.name,
134
- showModal: false,
135
- userfile: null
136
- }
137
- },
138
- ready () {
139
- },
140
- methods: {
141
- print () {
142
- this.$refs.print.PrintTable()
143
- }
144
- },
145
- computed: {
146
- parse () {
147
- return JSON.parse(this.selectdata.f_install_project).toString()
148
- },
149
- orgs () {
150
- return this.$login.f.orgs
151
- }
152
- }
153
- }
154
- </script>
155
-
156
- <style scoped>
157
- .control-label-justify {
158
- display: inline-block;
159
- vertical-align: top;
160
- width: 130px;
161
- text-align: justify;
162
- font-family: PingFang-SC-Bold;
163
- }
164
-
165
- .control-label-justify::after {
166
- content: "";
167
- display: inline-block;
168
- width: 100%;
169
- overflow: hidden;
170
- height: 0;
171
- }
172
- </style>
1
+ <template>
2
+ <style id="printBuildOrderStyle">
3
+ #printBuildOrder td{
4
+ height: 30px;
5
+ text-align: left;
6
+ padding-left: 10px;
7
+ vertical-align: middle;
8
+ }
9
+ #printBuildOrder table{
10
+ margin: auto;
11
+ width: 100%;
12
+ border-collapse:collapse;
13
+ border: 1px solid black;
14
+ }
15
+ #printBuildOrder h1,h2,h3,h4,h5,h6 {
16
+ text-align: center;
17
+ }
18
+ .sign {
19
+ vertical-align: top;
20
+ padding: 10px;
21
+ }
22
+ .material {
23
+ text-align: left;
24
+ vertical-align: top;
25
+ padding: 10px;
26
+ }
27
+ </style>
28
+
29
+ <div id="printBuildOrder">
30
+ <h2><span style="letter-spacing: 15px">阳春市博能燃气有限公司</span></h2>
31
+ <h2><span style="letter-spacing: 15px">工程派工单</span></h2>
32
+ <table border="1">
33
+ <tr>
34
+ <td style="width: 120px;">用户编号:</td>
35
+ <td style="width: 230px;">{{ selectdata.f_userinfo_code }}</td>
36
+ <td style="width: 120px;">工单编号:</td>
37
+ <td >{{ selectdata.f_child_apply_num }}</td>
38
+ <td style="width: 120px;">工程编号:</td>
39
+ <td >{{ selectdata.f_apply_num }}</td>
40
+ </tr>
41
+ <tr>
42
+ <td>用户名称:</td>
43
+ <td colspan="3">{{ selectdata.f_user_name }}</td>
44
+ <td>派工日期:</td>
45
+ <td>{{ selectdata.f_dispatch_date }}</td>
46
+ </tr>
47
+ <tr>
48
+ <td>地址:</td>
49
+ <td colspan="5">{{ selectdata.f_address}}</td>
50
+ </tr>
51
+ <tr>
52
+ <td>户数:</td>
53
+ <td>{{ selectdata.f_apply_count}}</td>
54
+ <td>用气点数量:</td>
55
+ <td>{{ selectdata.f_furnace_num }}</td>
56
+ <td>报建类型:</td>
57
+ <td>{{ selectdata.f_apply_type }}</td>
58
+ </tr>
59
+ <tr>
60
+ <td>区域:</td>
61
+ <td>{{ selectdata.f_apply_region }}</td>
62
+ <td>是否内投:</td>
63
+ <td>{{ selectdata.f_is_inward }}</td>
64
+ <td>报建性质:</td>
65
+ <td>{{ selectdata.f_gas_nature }}</td>
66
+ </tr>
67
+ <tr>
68
+ <td>联系人:</td>
69
+ <td>{{ selectdata.f_user_name }}</td>
70
+ <td>用户电话:</td>
71
+ <td>{{ selectdata.f_phone }}</td>
72
+ <td>预计通气时间:</td>
73
+ <td>{{ selectdata.f_yjgase_time }}</td>
74
+ </tr>
75
+ <tr>
76
+ <td>施工人:</td>
77
+ <td>{{ selectdata.f_budget_people }}</td>
78
+ <td>用气设备:</td>
79
+ <td>{{ selectdata.f_gas_appliances }}</td>
80
+ <td>计划开工时间:</td>
81
+ <td>{{ selectdata.f_release_date }}</td>
82
+ </tr>
83
+ <tr>
84
+ <td>施工内容:</td>
85
+ <td colspan="3">{{ selectdata.f_install_situation }}</td>
86
+ <td>计划完工时间:</td>
87
+ <td>{{ selectdata.f_commencement_date }}</td>
88
+ </tr>
89
+ <tr>
90
+ <td>备注:</td>
91
+ <td colspan="5">{{ selectdata.f_apply_remarks }}</td>
92
+ </tr>
93
+ <tr>
94
+ <td>派单人:</td>
95
+ <td colspan="3">{{ selectdata.f_dispatcher }}</td>
96
+ <td>操作人:</td>
97
+ <td>{{ f_operator }}</td>
98
+ </tr>
99
+ </table>
100
+ </div>
101
+ <print-element v-show="false" v-ref:print id='printBuildOrder' styleid='printBuildOrderStyle'
102
+ top='10' left='30' width='100%' height='100%' :type="type">
103
+ </print-element>
104
+ </template>
105
+
106
+ <script>
107
+ Date.prototype.Format = function (fmt) {
108
+ var o = {
109
+ "M+": this.getMonth() + 1, //月份
110
+ "d+": this.getDate(), //日
111
+ "H+": this.getHours(), //小时
112
+ "m+": this.getMinutes(), //分
113
+ "s+": this.getSeconds(), //秒
114
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
115
+ "S": this.getMilliseconds() //毫秒
116
+ };
117
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
118
+ for (var k in o)
119
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
120
+ return fmt;
121
+ }
122
+ export default {
123
+ title: '施工安装通知单',
124
+ props: {
125
+ selectdata: {
126
+ type: Object
127
+ },
128
+ type: {
129
+ type: String
130
+ }
131
+ },
132
+ data () {
133
+ return {
134
+ f_operator: this.$login.f.name,
135
+ showModal: false,
136
+ userfile: null
137
+ }
138
+ },
139
+ ready () {
140
+ },
141
+ methods: {
142
+ print () {
143
+ this.$refs.print.PrintTable()
144
+ }
145
+ },
146
+ computed: {
147
+ parse () {
148
+ return JSON.parse(this.selectdata.f_install_project).toString()
149
+ },
150
+ orgs () {
151
+ return this.$login.f.orgs
152
+ }
153
+ }
154
+ }
155
+ </script>
156
+
157
+ <style scoped>
158
+ .control-label-justify {
159
+ display: inline-block;
160
+ vertical-align: top;
161
+ width: 130px;
162
+ text-align: justify;
163
+ font-family: PingFang-SC-Bold;
164
+ }
165
+
166
+ .control-label-justify::after {
167
+ content: "";
168
+ display: inline-block;
169
+ width: 100%;
170
+ overflow: hidden;
171
+ height: 0;
172
+ }
173
+ </style>
@@ -1,27 +1,27 @@
1
- import Vue from 'vue'
2
-
3
- let specialComp = {
4
- 'exploration-user': (resolve) => { require(['./pc/ExplorationUser.vue'], resolve) },
5
- 'exploration-select': (resolve) => { require(['./pc/ExplorationSelect.vue'], resolve) },
6
- 'service-control': (resolve) => { require(['./pc/ServiceControl.vue'], resolve) },
7
- 'apply-charge-management': (resolve) => { require(['./pc/chargeManagement.vue'], resolve) },
8
- 'file-upload': (resolve) => { require(['./pc/FileUpload.vue'], resolve) },
9
- 'apply-upload': (resolve) => { require(['./pc/ApplyUpload.vue'], resolve) },
10
- 'installinfoselect': (resolve) => { require(['./pc/InstallInfoSelect.vue'], resolve) },
11
- 'installation-details': (resolve) => { require(['./pc/InstallationDetails.vue'], resolve) },
12
- 'apply-charge-list': (resolve) => { require(['./pc/ApplyChargeList.vue'], resolve) },
13
- 'add-material-science': (resolve) => { require(['./pc/addMaterialScience.vue'], resolve) },
14
- 'apply-devices-management': (resolve) => { require(['./pc/devicesManagement.vue'], resolve) },
15
- 'service-view': (resolve) => { require(['./pc/ServiceView.vue'], resolve) },
16
- 'supervisory-service-view': (resolve) => { require(['./pc/SupervisoryServiceView'], resolve) },
17
- 'other-charge-management': (resolve) => { require(['./pc/otherchargeManagement.vue'], resolve) },
18
- 'supervisory-service-control': (resolve) => { require(['./pc/SupervisoryServiceControl'], resolve) },
19
- 'supervisory-service-control-new': (resolve) => { require(['./pc/SupervisoryServiceControlNew'], resolve) },
20
- 'supervisory-list': (resolve) => { require(['./pc/SupervisoryList.vue'], resolve) },
21
- 'supervisory-list-new': (resolve) => { require(['./pc/SupervisoryListNew.vue'], resolve) },
22
- 'stop-apply-list': (resolve) => { require(['./pc/StopApplyList.vue'], resolve) },
23
- 'supervisory-control-new': (resolve) => { require(['./pc/SupervisoryControlNew'], resolve) },
24
- 'build-order-list': (resolve) => { require(['./pc/buildOrderList'], resolve) },
25
- 'print-build-order': (resolve) => { require(['./pc/printBuildOrder'], resolve) }
26
- }
27
- exports.specialComp = specialComp
1
+ import Vue from 'vue'
2
+
3
+ let specialComp = {
4
+ 'exploration-user': (resolve) => { require(['./pc/ExplorationUser.vue'], resolve) },
5
+ 'exploration-select': (resolve) => { require(['./pc/ExplorationSelect.vue'], resolve) },
6
+ 'service-control': (resolve) => { require(['./pc/ServiceControl.vue'], resolve) },
7
+ 'apply-charge-management': (resolve) => { require(['./pc/chargeManagement.vue'], resolve) },
8
+ 'file-upload': (resolve) => { require(['./pc/FileUpload.vue'], resolve) },
9
+ 'apply-upload': (resolve) => { require(['./pc/ApplyUpload.vue'], resolve) },
10
+ 'installinfoselect': (resolve) => { require(['./pc/InstallInfoSelect.vue'], resolve) },
11
+ 'installation-details': (resolve) => { require(['./pc/InstallationDetails.vue'], resolve) },
12
+ 'apply-charge-list': (resolve) => { require(['./pc/ApplyChargeList.vue'], resolve) },
13
+ 'add-material-science': (resolve) => { require(['./pc/addMaterialScience.vue'], resolve) },
14
+ 'apply-devices-management': (resolve) => { require(['./pc/devicesManagement.vue'], resolve) },
15
+ 'service-view': (resolve) => { require(['./pc/ServiceView.vue'], resolve) },
16
+ 'supervisory-service-view': (resolve) => { require(['./pc/SupervisoryServiceView'], resolve) },
17
+ 'other-charge-management': (resolve) => { require(['./pc/otherchargeManagement.vue'], resolve) },
18
+ 'supervisory-service-control': (resolve) => { require(['./pc/SupervisoryServiceControl'], resolve) },
19
+ 'supervisory-service-control-new': (resolve) => { require(['./pc/SupervisoryServiceControlNew'], resolve) },
20
+ 'supervisory-list': (resolve) => { require(['./pc/SupervisoryList.vue'], resolve) },
21
+ 'supervisory-list-new': (resolve) => { require(['./pc/SupervisoryListNew.vue'], resolve) },
22
+ 'stop-apply-list': (resolve) => { require(['./pc/StopApplyList.vue'], resolve) },
23
+ 'supervisory-control-new': (resolve) => { require(['./pc/SupervisoryControlNew'], resolve) },
24
+ 'build-order-list': (resolve) => { require(['./pc/buildOrderList'], resolve) },
25
+ 'print-build-order': (resolve) => { require(['./pc/printBuildOrder'], resolve) }
26
+ }
27
+ exports.specialComp = specialComp
package/src/main.js CHANGED
@@ -9,12 +9,11 @@ import {material} from 'material-client'
9
9
  import apply from './apply'
10
10
 
11
11
  all()
12
- apply('yangchunboneng')
12
+ apply('fugou')
13
13
  ldap()
14
14
  sale()
15
15
  material()
16
16
  system(false)
17
-
18
17
  require('system-clients/src/styles/less/bootstrap.less')
19
18
  require('./expandcss.less')
20
19
  new Vue({
@@ -0,0 +1,69 @@
1
+ package test;
2
+
3
+ import java.io.IOException;
4
+ import java.io.PrintWriter;
5
+ import java.text.SimpleDateFormat;
6
+ import java.util.Date;
7
+ import java.util.Enumeration;
8
+
9
+ import javax.servlet.ServletException;
10
+ import javax.servlet.annotation.WebServlet;
11
+ import javax.servlet.http.HttpServlet;
12
+ import javax.servlet.http.HttpServletRequest;
13
+ import javax.servlet.http.HttpServletResponse;
14
+ import javax.servlet.http.HttpSession;
15
+
16
+ @WebServlet("/session-test")
17
+ public class SessionTestServlet extends HttpServlet {
18
+ private static final long serialVersionUID = 1L;
19
+
20
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
21
+ throws ServletException, IOException {
22
+ response.setContentType("text/html;charset=UTF-8");
23
+ PrintWriter out = response.getWriter();
24
+
25
+ HttpSession session = request.getSession();
26
+ String sessionId = session.getId();
27
+ String jvmRoute = "";
28
+
29
+ // 从sessionId中提取jvmRoute
30
+ if (sessionId.contains(".")) {
31
+ jvmRoute = sessionId.substring(sessionId.lastIndexOf(".") + 1);
32
+ }
33
+
34
+ out.println("<!DOCTYPE html>");
35
+ out.println("<html><head><title>Session测试</title>");
36
+ out.println("<style>body{font-family:Arial;margin:20px;} .container{border:1px solid #ddd;padding:20px;}</style>");
37
+ out.println("</head><body><div class='container'>");
38
+ out.println("<h1>Tomcat集群Session测试</h1>");
39
+
40
+ out.println("<h3>服务器信息</h3>");
41
+ out.println("<p>服务器: " + request.getServerName() + ":" + request.getServerPort() + "</p>");
42
+ out.println("<p>JVM路由: " + jvmRoute + "</p>");
43
+ out.println("<p>Session ID: " + sessionId + "</p>");
44
+
45
+ // 显示当前session中的所有属性
46
+ out.println("<h3>当前Session属性</h3>");
47
+ Enumeration<String> attributeNames = session.getAttributeNames();
48
+ if (!attributeNames.hasMoreElements()) {
49
+ out.println("<p>Session中没有属性</p>");
50
+ } else {
51
+ out.println("<ul>");
52
+ while (attributeNames.hasMoreElements()) {
53
+ String name = attributeNames.nextElement();
54
+ out.println("<li>" + name + " = " + session.getAttribute(name) + "</li>");
55
+ }
56
+ out.println("</ul>");
57
+ }
58
+
59
+ // 添加一个新的session属性
60
+ String timestamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
61
+ session.setAttribute("lastAccess", timestamp);
62
+
63
+ out.println("<h3>已添加新属性</h3>");
64
+ out.println("<p>lastAccess = " + timestamp + "</p>");
65
+
66
+ out.println("<p><a href='session-test'>刷新页面</a></p>");
67
+ out.println("</div></body></html>");
68
+ }
69
+ }
@@ -0,0 +1,52 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
5
+ http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
6
+ version="3.1">
7
+
8
+ <!-- 启用会话复制 -->
9
+ <distributable/>
10
+
11
+ <!-- 会话配置 -->
12
+ <session-config>
13
+ <session-timeout>30</session-timeout>
14
+ </session-config>
15
+
16
+ <!-- 应用程序名称 -->
17
+ <display-name>您的应用名称</display-name>
18
+
19
+ <!-- 会话配置 -->
20
+ <session-config>
21
+ <!-- 会话超时时间(分钟) -->
22
+ <session-timeout>30</session-timeout>
23
+ <!-- Cookie配置 -->
24
+ <cookie-config>
25
+ <!-- 启用HttpOnly以提高安全性 -->
26
+ <http-only>true</http-only>
27
+ <!-- 如果使用HTTPS,可以启用secure -->
28
+ <!-- <secure>true</secure> -->
29
+ </cookie-config>
30
+ <!-- 跟踪模式 -->
31
+ <tracking-mode>COOKIE</tracking-mode>
32
+ </session-config>
33
+
34
+ <!-- 欢迎文件列表 -->
35
+ <welcome-file-list>
36
+ <welcome-file>index.html</welcome-file>
37
+ <welcome-file>index.jsp</welcome-file>
38
+ </welcome-file-list>
39
+
40
+ <!-- 错误页面配置 -->
41
+ <error-page>
42
+ <error-code>404</error-code>
43
+ <location>/error/404.html</location>
44
+ </error-page>
45
+ <error-page>
46
+ <error-code>500</error-code>
47
+ <location>/error/500.html</location>
48
+ </error-page>
49
+
50
+ <!-- 其他应用程序特定的配置... -->
51
+
52
+ </web-app>
@@ -0,0 +1,59 @@
1
+ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <title>Session共享测试</title>
7
+ <style>
8
+ body { font-family: Arial, sans-serif; margin: 20px; }
9
+ .container { border: 1px solid #ddd; padding: 20px; border-radius: 5px; }
10
+ .info { background-color: #f8f8f8; padding: 10px; margin: 10px 0; }
11
+ .success { color: green; }
12
+ .error { color: red; }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <div class="container">
17
+ <h1>Tomcat集群Session共享测试</h1>
18
+
19
+ <div class="info">
20
+ <p><strong>服务器信息:</strong> <%= application.getServerInfo() %></p>
21
+ <p><strong>JVM路由(jvmRoute):</strong> <%= System.getProperty("jvmRoute", "未设置") %></p>
22
+ <p><strong>Tomcat实例名称:</strong> <%= System.getProperty("catalina.base") %></p>
23
+ <p><strong>当前会话ID:</strong> <%= session.getId() %></p>
24
+ </div>
25
+
26
+ <%
27
+ // 获取当前时间作为默认值
28
+ String currentTime = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date());
29
+
30
+ // 处理表单提交
31
+ if ("POST".equalsIgnoreCase(request.getMethod())) {
32
+ String sessionValue = request.getParameter("sessionValue");
33
+ if (sessionValue != null && !sessionValue.trim().isEmpty()) {
34
+ session.setAttribute("testValue", sessionValue);
35
+ out.println("<p class='success'>会话值已设置为: " + sessionValue + "</p>");
36
+ }
37
+ }
38
+
39
+ // 获取当前会话值
40
+ String testValue = (String) session.getAttribute("testValue");
41
+ %>
42
+
43
+ <form method="post" action="session-test.jsp">
44
+ <h3>设置Session值</h3>
45
+ <input type="text" name="sessionValue" value="<%= currentTime %>" style="width: 250px;">
46
+ <input type="submit" value="保存到Session">
47
+ </form>
48
+
49
+ <div style="margin-top: 20px;">
50
+ <h3>当前Session值</h3>
51
+ <% if (testValue != null) { %>
52
+ <p>存储在Session中的值: <strong><%= testValue %></strong></p>
53
+ <% } else { %>
54
+ <p class="error">Session中没有存储值</p>
55
+ <% } %>
56
+ </div>
57
+ </div>
58
+ </body>
59
+ </html>