and this is how you get the task id's of the tasks allocated to a user before you display them on a jsp ..
Keep the task id in a hidden field if you so desire.
public List<ApproveLeaveModel> getPersonalList(String username) {
List<ApproveLeaveModel> approvalList = new ArrayList<ApproveLeaveModel>();
List<Task> personalTaskList = taskService.findPersonalTasks(username); // finds personal tasks alloted to a user.
for(Task t : personalTaskList){
String tId = t.getId();
Set<String> variableNames = taskService.getVariableNames(tId);
Map<String,Object> variables = taskService.getVariables(tId, variableNames);
Integer reqId= (Integer)variables.get("requestId");
String requestId = reqId.toString();
if(requestId!=null){
ApproveLeaveModel alm = leaveModuleDao.getLeaveRequestbyId(requestId);
alm.setTaskId(tId);
approvalList.add(alm);
}
}
return approvalList;
}