17 |
Description
18 |
This application demonstrates how to use a Redis instance to back your session. Notice that there is no JSESSIONID cookie. We are also able to customize the way of identifying what the requested session id is.
19 |
20 |
Try it
21 |
22 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | Attribute Name |
36 | Attribute Value |
37 |
38 |
39 |
40 |
41 |
42 | |
43 | |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/src/test/java/com/yzb/lee/springsession/SpringRestTemplateTest.java:
--------------------------------------------------------------------------------
1 | package com.yzb.lee.springsession;
2 |
3 | import java.math.BigDecimal;
4 |
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 | import org.springframework.http.HttpEntity;
8 | import org.springframework.http.ResponseEntity;
9 | import org.springframework.util.concurrent.ListenableFuture;
10 | import org.springframework.util.concurrent.ListenableFutureCallback;
11 | import org.springframework.web.client.AsyncRestTemplate;
12 |
13 | import com.yzb.lee.springsession.domain.ConsumerLoanInfo;
14 |
15 | public class SpringRestTemplateTest {
16 | private static final Logger LOGGER = LoggerFactory.getLogger(SpringRestTemplateTest.class);
17 | private static final String OBJ_URL = "http://localhost:8081/rest/handle";
18 |
19 | public static void main(String[] args) {
20 | ConsumerLoanInfo info = queryConsumerLoan();
21 | doPush(info);
22 | }
23 | private static ConsumerLoanInfo queryConsumerLoan() {
24 | ConsumerLoanInfo loanInfo = new ConsumerLoanInfo();
25 | loanInfo.setAffCity("深圳市");
26 | loanInfo.setAffProvince("广东省");
27 | loanInfo.setAppNo("201802499349340");
28 | loanInfo.setBankCardNo("66600049329049983498");
29 | loanInfo.setBankCellPhone("15174480311");
30 | loanInfo.setBankCode("23294");
31 | loanInfo.setBankCustId("430682199212159130");
32 | loanInfo.setBankCustName("李隆基");
33 | loanInfo.setBankName("不知道什么行");
34 | loanInfo.setCellPhone("15174480311");
35 | loanInfo.setContractLmt(new BigDecimal(20000.00));
36 | loanInfo.setGender("男");
37 | loanInfo.setIdNo("430682199212159130");
38 | loanInfo.setInterestRate(new BigDecimal(0.16));
39 | loanInfo.setLoanTerm(36);
40 | loanInfo.setName("李隆基");
41 | loanInfo.setOrderLmtAmt(new BigDecimal(0.16));
42 | loanInfo.setProductCd("000408");
43 | loanInfo.setProductName("驾费分期");
44 |
45 | return loanInfo;
46 | }
47 | /**
48 | * 信息推送
49 | * @param info 推送的信息实体
50 | */
51 | private static void doPush(ConsumerLoanInfo info) {
52 | AsyncRestTemplate restTemplate = new AsyncRestTemplate();
53 | HttpEntity