0
私はstrutsに2つのアプリケーションがあり、もう1つは春です。 strutsアプリケーションからは、モデルを返すajax呼び出しを通じてSpringアプリケーションコントローラを呼び出すリンクが1つあります。ajaxを使用したセッションタイムアウトの問題
strutsアプリケーションでセッションタイムアウトが20分あり、strutsアプリケーションでレンダリングされるスプリングアプリケーションのトランザクションを実行している間、strutsアプリケーションのセッションタイムアウトは同じままで、20分後にログアウトします。
strutsアプリケーションJSPページ。
<body>
<div id="content"></div>
</body>
<script type="text/javascript">
$(document).ready(function() {
var sessionId = '<%= sessionId %>'
$.ajax({
type: "GET",
url: '/springapp/index.app?id='+sessionId,
data: "" ,
success: function(response){
$('#content').html(response);
},
error: function(e){
alert('Error: ' + e);
console.log(e)
}
});
});
</script>
スプリングアプリケーションコントローラ。
@RequestMapping(value = "/*.app", method = {RequestMethod.GET, RequestMethod.POST})
public String jspController(ServletRequest req, ServletResponse res) throws exception {
LOGGER.debug("inside jspController() start");
HttpServletRequest request = (HttpServletRequest) req;
String model = request.getRequestURI();
if (model.endsWith("index.app")) {
String sessionKey = request.getParameter("employeeId");
SpringStrutsHandshake springStrutsHandshake = securityDelegate.getUserId(sessionKey);
User user = userDelegate.getUserByEmployeeId(springStrutsHandshake.getUserId());
user.setSessionKey(sessionKey);
request.setAttribute("USER", user);
model = "candidateList";
} else {
model = model.substring(model.lastIndexOf("/") + 1, model.lastIndexOf("."));
}
return model;
}
レンダリングされた春のアプリケーションページにトランザクションがあるとタイムアウトの問題を解決する方法を教えてください。