apply-clients 3.5.5-73 → 3.5.5-74
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.
- package/build/dev-server.js +6 -7
- package/package.json +1 -1
- package/src/App.vue +2 -2
- package/src/components/android/AppCheckTakePic.vue +168 -168
- package/src/components/android/Process/AppServiceControl.vue +1755 -1755
- package/src/components/product/Install/ContractCharge.vue +210 -210
- package/src/components/product/PcZhihuanManagement.vue +160 -160
- package/src/components/product/Print/BuildOrder/buildOrderList.vue +339 -339
- package/src/components/product/Process/Processes/selectApply.vue +251 -251
- package/src/components/product/Process/Processes/selectBcakApply.vue +250 -250
- package/src/filiale/fugou/android/AppAddMaterialScience.vue +444 -444
- package/src/filiale/fugou/android/AppAddReplacement.vue +341 -341
- package/src/filiale/fugou/android/AppChargeManagement.vue +739 -739
- package/src/filiale/fugou/android/AppExplorationUser.vue +508 -508
- package/src/filiale/fugou/android/AppInstallationDetails.vue +542 -542
- package/src/filiale/fugou/android/AppServiceControl.vue +1840 -1840
- package/src/filiale/fugou/pc/AddReplacement.vue +340 -340
- package/src/filiale/fugou/pc/ExplorationSelect.vue +524 -524
- package/src/filiale/fugou/pc/ServiceControl.vue +1714 -1714
- package/src/filiale/fugou/pc/StopApplyList.vue +291 -291
- package/src/filiale/fugou/pc/addMaterialScience.vue +481 -481
- package/src/filiale/fugou/pc/addressAndUserinfoManagement.vue +216 -216
- package/src/filiale/fugou/pc/chargeReport.vue +215 -215
- package/src/filiale/fugou/pc.js +18 -18
- package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +527 -527
- package/src/filiale/yangchunboneng/android/AppContractCharge.vue +210 -210
- package/src/filiale/yangchunboneng/android.js +21 -21
- package/src/filiale/yangchunboneng/pc/ApplyUpload.vue +392 -392
- package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +612 -612
- package/src/filiale/yangchunboneng/pc/SupervisoryControl.vue +141 -141
- package/src/filiale/yangchunboneng/pc.js +29 -29
- package/src/main.js +3 -4
- package/src/test/SessionTestServlet.java +69 -0
- package/webapp/WEB-INF/web.xml +52 -0
- package/webapp/session-test.jsp +59 -0
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex-row">
|
|
3
|
-
<div class="basic-main">
|
|
4
|
-
<div :class="showData ? 'top' : 'auto'">
|
|
5
|
-
<supervisory-list v-ref:query :show-data="showData"></supervisory-list>
|
|
6
|
-
</div>
|
|
7
|
-
<div v-if="showtotal" style="height: 89%">
|
|
8
|
-
<div class="col-sm-2" style="margin-top: 20px">
|
|
9
|
-
<supervisory-chart :selectdata="selectdata"></supervisory-chart>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="col-sm-10" style="margin-top: 20px">
|
|
12
|
-
<tabset v-ref:tabs :close="false">
|
|
13
|
-
<tab :header='selectdata.defname'>
|
|
14
|
-
<supervisory-service-control :selectdata="selectdata" :node-snapshot="true"></supervisory-service-control>
|
|
15
|
-
</tab>
|
|
16
|
-
<tab header='附件'>
|
|
17
|
-
<apply-upload :blodid="selectdata.f_process_id"
|
|
18
|
-
:pblobid="selectdata.f_parent_process_id"
|
|
19
|
-
:isupload = "true"
|
|
20
|
-
:isdelete="true"
|
|
21
|
-
:isusetype="true"
|
|
22
|
-
:isremark = "true"
|
|
23
|
-
:takeimg="false"
|
|
24
|
-
:issearch="true"
|
|
25
|
-
:defname="selectdata.defname">
|
|
26
|
-
</apply-upload>
|
|
27
|
-
</tab>
|
|
28
|
-
</tabset>
|
|
29
|
-
</div>
|
|
30
|
-
<div style="height: 1%">
|
|
31
|
-
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
</template>
|
|
38
|
-
<script>
|
|
39
|
-
import Vue from 'vue'
|
|
40
|
-
import {HttpResetClass} from 'vue-client'
|
|
41
|
-
export default {
|
|
42
|
-
title: '流程监控',
|
|
43
|
-
data () {
|
|
44
|
-
return {
|
|
45
|
-
showtotal: false, // 控制详细信息显示
|
|
46
|
-
showData: true,
|
|
47
|
-
selectdata: {},
|
|
48
|
-
xmlname: '' // 配置文件名称
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
created () {
|
|
52
|
-
},
|
|
53
|
-
methods: {
|
|
54
|
-
// 获取页面配置json文件
|
|
55
|
-
async loadName () {
|
|
56
|
-
let data = {
|
|
57
|
-
workname: this.selectdata.processname
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
let res = await this.$resetpost(
|
|
61
|
-
'rs/logic/ApplyGetConfigs',
|
|
62
|
-
{data: data},
|
|
63
|
-
{resolveMsg: null, rejectMsg: '配置数据获取失败!!!'}
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
Vue.prototype.$workflow_vue = res.data
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
events: {
|
|
70
|
-
// 刷新控制层
|
|
71
|
-
async 'breakControl' (servicedata) {
|
|
72
|
-
|
|
73
|
-
if (servicedata.id) {
|
|
74
|
-
let data = {
|
|
75
|
-
condition: `u.id = ${servicedata.id}`,
|
|
76
|
-
data: {
|
|
77
|
-
orgid: this.$login.f.orgid
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
let res = await this.$resetpost(
|
|
81
|
-
'rs/sql/supervisory',
|
|
82
|
-
{data: data},
|
|
83
|
-
{resolveMsg: null, rejectMsg: '数据更新失败,请手查询更新!!!'}
|
|
84
|
-
)
|
|
85
|
-
this.selectdata = Object.assign({}, this.selectdata, res.data[0])
|
|
86
|
-
} else {
|
|
87
|
-
this.selectdata = servicedata
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
this.showtotal = false
|
|
91
|
-
this.$nextTick(() => {
|
|
92
|
-
this.showtotal = true
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
'onMessage' (data) {
|
|
97
|
-
console.log('接收消息')
|
|
98
|
-
console.log(data)
|
|
99
|
-
if (data.type === 'apply-task') {
|
|
100
|
-
this.$refs.queryuser.$refs.cp.$refs.cri.search()
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
async 'apply' (val) {
|
|
104
|
-
this.selectdata = null
|
|
105
|
-
this.selectdata = val
|
|
106
|
-
this.showtotal = false
|
|
107
|
-
|
|
108
|
-
// 获取配置文件
|
|
109
|
-
await this.loadName()
|
|
110
|
-
|
|
111
|
-
this.$refs.query.$refs.cp.pager = false
|
|
112
|
-
this.showData = false
|
|
113
|
-
|
|
114
|
-
this.showtotal = true
|
|
115
|
-
},
|
|
116
|
-
'search' () {
|
|
117
|
-
// 关闭详细
|
|
118
|
-
this.showtotal = false
|
|
119
|
-
// 显示列表数据
|
|
120
|
-
this.showData = true
|
|
121
|
-
// 显示分页
|
|
122
|
-
this.$refs.query.$refs.cp.pager = true
|
|
123
|
-
// 调用查询
|
|
124
|
-
this.$refs.query.$refs.cp.$refs.cri.search()
|
|
125
|
-
},
|
|
126
|
-
'loadPage' () {
|
|
127
|
-
// 关闭详细
|
|
128
|
-
this.showtotal = false
|
|
129
|
-
// 显示列表数据
|
|
130
|
-
this.showData = true
|
|
131
|
-
// 显示分页
|
|
132
|
-
this.$refs.query.$refs.cp.pager = true
|
|
133
|
-
// 调用查询
|
|
134
|
-
this.$refs.query.$refs.cp.loadPage(this.$refs.query.model.pageIndex)
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
watch: {
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex-row">
|
|
3
|
+
<div class="basic-main">
|
|
4
|
+
<div :class="showData ? 'top' : 'auto'">
|
|
5
|
+
<supervisory-list v-ref:query :show-data="showData"></supervisory-list>
|
|
6
|
+
</div>
|
|
7
|
+
<div v-if="showtotal" style="height: 89%">
|
|
8
|
+
<div class="col-sm-2" style="margin-top: 20px">
|
|
9
|
+
<supervisory-chart :selectdata="selectdata"></supervisory-chart>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="col-sm-10" style="margin-top: 20px">
|
|
12
|
+
<tabset v-ref:tabs :close="false">
|
|
13
|
+
<tab :header='selectdata.defname'>
|
|
14
|
+
<supervisory-service-control :selectdata="selectdata" :node-snapshot="true"></supervisory-service-control>
|
|
15
|
+
</tab>
|
|
16
|
+
<tab header='附件'>
|
|
17
|
+
<apply-upload :blodid="selectdata.f_process_id"
|
|
18
|
+
:pblobid="selectdata.f_parent_process_id"
|
|
19
|
+
:isupload = "true"
|
|
20
|
+
:isdelete="true"
|
|
21
|
+
:isusetype="true"
|
|
22
|
+
:isremark = "true"
|
|
23
|
+
:takeimg="false"
|
|
24
|
+
:issearch="true"
|
|
25
|
+
:defname="selectdata.defname">
|
|
26
|
+
</apply-upload>
|
|
27
|
+
</tab>
|
|
28
|
+
</tabset>
|
|
29
|
+
</div>
|
|
30
|
+
<div style="height: 1%">
|
|
31
|
+
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
</template>
|
|
38
|
+
<script>
|
|
39
|
+
import Vue from 'vue'
|
|
40
|
+
import {HttpResetClass} from 'vue-client'
|
|
41
|
+
export default {
|
|
42
|
+
title: '流程监控',
|
|
43
|
+
data () {
|
|
44
|
+
return {
|
|
45
|
+
showtotal: false, // 控制详细信息显示
|
|
46
|
+
showData: true,
|
|
47
|
+
selectdata: {},
|
|
48
|
+
xmlname: '' // 配置文件名称
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
created () {
|
|
52
|
+
},
|
|
53
|
+
methods: {
|
|
54
|
+
// 获取页面配置json文件
|
|
55
|
+
async loadName () {
|
|
56
|
+
let data = {
|
|
57
|
+
workname: this.selectdata.processname
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let res = await this.$resetpost(
|
|
61
|
+
'rs/logic/ApplyGetConfigs',
|
|
62
|
+
{data: data},
|
|
63
|
+
{resolveMsg: null, rejectMsg: '配置数据获取失败!!!'}
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
Vue.prototype.$workflow_vue = res.data
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
events: {
|
|
70
|
+
// 刷新控制层
|
|
71
|
+
async 'breakControl' (servicedata) {
|
|
72
|
+
|
|
73
|
+
if (servicedata.id) {
|
|
74
|
+
let data = {
|
|
75
|
+
condition: `u.id = ${servicedata.id}`,
|
|
76
|
+
data: {
|
|
77
|
+
orgid: this.$login.f.orgid
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
let res = await this.$resetpost(
|
|
81
|
+
'rs/sql/supervisory',
|
|
82
|
+
{data: data},
|
|
83
|
+
{resolveMsg: null, rejectMsg: '数据更新失败,请手查询更新!!!'}
|
|
84
|
+
)
|
|
85
|
+
this.selectdata = Object.assign({}, this.selectdata, res.data[0])
|
|
86
|
+
} else {
|
|
87
|
+
this.selectdata = servicedata
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
this.showtotal = false
|
|
91
|
+
this.$nextTick(() => {
|
|
92
|
+
this.showtotal = true
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
},
|
|
96
|
+
'onMessage' (data) {
|
|
97
|
+
console.log('接收消息')
|
|
98
|
+
console.log(data)
|
|
99
|
+
if (data.type === 'apply-task') {
|
|
100
|
+
this.$refs.queryuser.$refs.cp.$refs.cri.search()
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
async 'apply' (val) {
|
|
104
|
+
this.selectdata = null
|
|
105
|
+
this.selectdata = val
|
|
106
|
+
this.showtotal = false
|
|
107
|
+
|
|
108
|
+
// 获取配置文件
|
|
109
|
+
await this.loadName()
|
|
110
|
+
|
|
111
|
+
this.$refs.query.$refs.cp.pager = false
|
|
112
|
+
this.showData = false
|
|
113
|
+
|
|
114
|
+
this.showtotal = true
|
|
115
|
+
},
|
|
116
|
+
'search' () {
|
|
117
|
+
// 关闭详细
|
|
118
|
+
this.showtotal = false
|
|
119
|
+
// 显示列表数据
|
|
120
|
+
this.showData = true
|
|
121
|
+
// 显示分页
|
|
122
|
+
this.$refs.query.$refs.cp.pager = true
|
|
123
|
+
// 调用查询
|
|
124
|
+
this.$refs.query.$refs.cp.$refs.cri.search()
|
|
125
|
+
},
|
|
126
|
+
'loadPage' () {
|
|
127
|
+
// 关闭详细
|
|
128
|
+
this.showtotal = false
|
|
129
|
+
// 显示列表数据
|
|
130
|
+
this.showData = true
|
|
131
|
+
// 显示分页
|
|
132
|
+
this.$refs.query.$refs.cp.pager = true
|
|
133
|
+
// 调用查询
|
|
134
|
+
this.$refs.query.$refs.cp.loadPage(this.$refs.query.model.pageIndex)
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
watch: {
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
</script>
|
|
@@ -1,29 +1,29 @@
|
|
|
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
|
-
'supervisory-control': (resolve) => { require(['./pc/SupervisoryControl'], resolve) },
|
|
25
|
-
'build-order-list': (resolve) => { require(['./pc/buildOrderList'], resolve) },
|
|
26
|
-
'apply-construction-Info': (resolve) => { require(['./pc/constructionInfo'], resolve) },
|
|
27
|
-
'print-build-order': (resolve) => { require(['./pc/printBuildOrder'], resolve) }
|
|
28
|
-
}
|
|
29
|
-
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
|
+
'supervisory-control': (resolve) => { require(['./pc/SupervisoryControl'], resolve) },
|
|
25
|
+
'build-order-list': (resolve) => { require(['./pc/buildOrderList'], resolve) },
|
|
26
|
+
'apply-construction-Info': (resolve) => { require(['./pc/constructionInfo'], resolve) },
|
|
27
|
+
'print-build-order': (resolve) => { require(['./pc/printBuildOrder'], resolve) }
|
|
28
|
+
}
|
|
29
|
+
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('
|
|
12
|
+
apply('fugou')
|
|
13
13
|
ldap()
|
|
14
|
-
sale(
|
|
14
|
+
sale()
|
|
15
15
|
material()
|
|
16
|
-
system(false
|
|
17
|
-
|
|
16
|
+
system(false)
|
|
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>
|