【发布时间】:2017-12-19 10:22:29
【问题描述】:
我正在为我的应用程序使用 IE 11。我在这里面临会话问题。
在进行第一次交易时,在交易响应 jsp 页面中,我得到当前交易没有说 1000 [(TransactionDO) session.getAttribute("txnDetails");]。 在同一个 jsp 中,我在 div 中执行了 ng-init="GetTxnResponse()",从该 js 函数获取事务编号为 1000。
然后我在没有注销的情况下使用同一会话进行第二次事务,在事务响应 jsp 页面中,我从 http 会话中获取当前事务编号为 1001。 在来自 ng-init="GetTxnResponse()" js 函数的同一 jsp 中,将事务编号设为 1000 而不是 1001。
它只出现在 IE 中。请帮忙解决。以下是我的代码供参考。
-- JSP代码--
<fmt:setLocale value='en_US' />
<%
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
// HTTP 1.1.
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
TransactionDO txnDO = (TransactionDO) session.getAttribute("txnDetails");
System.out.println("Txn no : "+txnDO.txnNo()); // Here i get 1001 second time
%>
<fmt:bundle basename="applicationresources">
<div ng-controller="txnController"
ng-init="GetTxnResponse()" >
---
---
</div>
</fmt:bundle>
-- JS代码--
self.GetTxnResponse = function() {
if (txnStatus == '00') {
$http.get(CONTEXT_PATH + '/getResponseDetails').success(function(data) {
// Here i get 1000 from data second time
}
}
-- Java 代码--
@RequestMapping(value="/getResponseDetails", method=RequestMethod.GET)
public @ResponseBody TransactionDO getResponseDetails(HttpServletRequest httpRequest){
TransactionDO txnDO = null;
txnDO = (TransactionDO) httpRequest.getSession().getAttribute("txnDetails");
return txnDO;
}
【问题讨论】:
标签: java angularjs jsp internet-explorer websphere