}
if (!isFormSubmission(request)) {
DetailSymbol detailSymbol = null;
if (request.getParameter("symbolId")!=null) {
detailSymbol = detailSymbolManager.getByIdPDetailSymbol(Integer.valueOf(request.getParameter("symbolId")));
} else {
detailSymbol = new DetailSymbol();
}
if (request.getParameter("type")!=null){
detailSymbol.setType(request.getParameter("type"));
request.getSession().setAttribute("type",request.getParameter("type"));
}
if (detailSymbol.getDefectType()!=null && detailSymbol.getDefectType().getDefectTypeId()!=null){
request.getSession().setAttribute("defectTypeId",detailSymbol.getDefectType().getDefectTypeId());
request.setAttribute("defectVarityList", defectVarityManager.getDefectVaritiesByType(detailSymbol.getDefectType().getDefectTypeId().toString()));
}else{
request.setAttribute("defectVarityList", new ArrayList());
}
if (detailSymbol.getWayToSymbol() == null || detailSymbol.getWayToSymbolImage().equals("")) {
String saveWay = ImageUtil.getUniqueJPEGFile(request);
request.setAttribute("saveWay", saveWay);
detailSymbol.setWayToSymbol(saveWay);
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(FileHelper.getCurrentPath(request)+detailSymbol.getWayToSymbol()));
out.writeObject(new ObjectPicture());
out.close();
String saveWayImage = "image" + saveWay;
detailSymbol.setWayToSymbolImage(saveWayImage);
request.setAttribute("saveWayImage", saveWayImage);
request.getSession().setAttribute("saveWayImage", saveWayImage);
request.getSession().setAttribute("saveWay", saveWay);
} else {
request.getSession().setAttribute("saveWayImage", detailSymbol.getWayToSymbolImage());
request.getSession().setAttribute("saveWay", detailSymbol.getWayToSymbol());
request.getSession().setAttribute("loadWay", detailSymbol.getWayToSymbol());
}
return detailSymbol;