I am using spring security in my application and my session time out is 30 min. and i am also using some ajax call in the front end.
my issues are:-
Problem-1 I am doing .xml file uploading through ajax call it will take more than 30 min it may b take 1 hour(it depends on the file size). how to handle session time out for ajax call in spring security or any other way? because after file uploaded successfully it redirect me to login page actually i don't need this. i want to update my session in server side while any ajax call is happening in my application.
Please help me to solve this issue.
Ajax Code
function uploadForm() {
if ($('div.bootstrap-filestyle').find('input[type="text"]')
.val() == "") {
alert("No file selected");
} else {
var selectedActionUrl = $("#drpLink").val();
console.log(selectedActionUrl);
var Url = "";
if (selectedActionUrl == 1) {
Url = "${pageContext.request.contextPath}/excellUpload";
}
console.log('file uploading..');
var $statusMsgDiv = $('div#status-msg');
$('#result').html('');
var $uploadFrm = $("#uploadForm");
$uploadFrm.attr('action', fUrl);
$uploadFrm.ajaxForm(
{
beforeSend : function() {
//some logic
},
success : function(jsonRes) {
//some logic
},
error : function(xhr, textStatus,errorThrown) {
//some logic
}).submit();
}
return false;
}
Server Side Code
web.xml file
//..... some code
Login.jsp
<error-page>
<error-code>404</error-code>
<location>/404</location>
</error-page>
<session-config>
<session-timeout>30</session-timeout>
<tracking-mode>COOKIE</tracking-mode>
</session-config>
problem 2
should i need to update my session time out value each time in fileUpload controller or need to write any other controller which can serve all the ajax request or response ? please help me to fix this issue. Thanks in advance.....