I want to know what all kind of data one must store in the session map of ActionContext?
For example:
From a jsp after an event is triggered, control goes to my action class. In my action class if i get some data from database and want that data to be rendered in the next jsp to be displayed, so shall I store that data in session map or in some other object of ActionContext like parametres, application,request, etc ??
I am adding the following variables in my session map:
session.remove("MESSAGE"); // Some message Strings
session.remove("ERROR");// Some Error Strings
session.remove("TSRequestDetailsMap"); // Dto Map from DB
session.remove("TowerReqGenDtoMap");
session.remove("RequestFileName");
session.remove("ResponseFileName");
session.remove("ResponseFileDetailsDto");// DTO
session.remove("Output");// Output Strings
session.remove("RequestType");
Is it right to put such variables in session or shall i keep some of them in other like in application map or ValueStack ???
My MESSAGE and ERROR strings are not field errors/messages particular to a field but messages in general like if the map got from DB comes empty, etc. Something like this:
tsReqDetailsMap = slsRequestResponseDetailsLocal.getRequestDetailsForTargetSuspect(operatorIds, requestType, startDate, endDate,loginMode);
if(!tsReqDetailsMap.isEmpty()){
session.put("TSRequestDetailsMap", tsReqDetailsMap);
}else{
session.put("MESSAGE", "Request not found for specified time period for "+requestType);
}