Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringStarterAction.java =================================================================== diff -u -radbcf56486df0578f4daad72035ba4f0d9a2db22 -r2b229787ba0e9d63bf7ae74bf4fa095b6f0e31ff --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringStarterAction.java (.../NbAuthoringStarterAction.java) (revision adbcf56486df0578f4daad72035ba4f0d9a2db22) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringStarterAction.java (.../NbAuthoringStarterAction.java) (revision 2b229787ba0e9d63bf7ae74bf4fa095b6f0e31ff) @@ -83,6 +83,8 @@ static Logger logger = Logger.getLogger(NbAuthoringAction.class.getName()); + public final static String FORM="NbAuthoringForm"; + /** * This struts actionservlet gets called when the author double clicks * on the tool icon. If the toolContentId already exists in the tool content @@ -100,8 +102,8 @@ MessageResources resources = getResources(request); - NbAuthoringForm nbForm = (NbAuthoringForm)form; - + //to ensure that we are working with a new form, not one from previous session + NbAuthoringForm nbForm = new NbAuthoringForm(); NbWebUtil.cleanAuthoringSession(request); Long contentId = NbWebUtil.convertToLong(request.getParameter(NoticeboardConstants.TOOL_CONTENT_ID)); @@ -122,15 +124,13 @@ */ nbForm.setDefineLater((String)request.getParameter(NoticeboardConstants.DEFINE_LATER)); - - - request.getSession().setAttribute(NoticeboardConstants.TOOL_CONTENT_ID, contentId); /* * Retrieve the Service */ INoticeboardService nbService = NoticeboardServiceProxy.getNbService(getServlet().getServletContext()); + Map attachmentMap = nbForm.getAttachments(); if (!contentExists(nbService, contentId)) { @@ -154,7 +154,9 @@ //initialise the values in the form, so the values will be shown in the jsp nbForm.populateFormWithNbContentValues(nbContentNew); - + + + } else //content already exists on the database @@ -189,8 +191,7 @@ } //Setup the map containing the files that have been uploaded for this particular tool content id - Map attachmentMap = nbForm.getAttachments(); - + List attachmentIdList = nbService.getAttachmentIdsFromContent(nb); for (int i=0; i