40,6 → 40,9 |
*/ |
Map<String, Object> session = ActionContext.getContext().getSession(); |
|
private final HttpServletRequest request = (HttpServletRequest) ActionContext |
.getContext().get(StrutsStatics.HTTP_REQUEST); |
|
/* |
* (non-Javadoc) |
* |
55,13 → 58,18 |
* |
* @return {@link Action#SUCCESS} |
*/ |
public String add() |
public String save() |
{ |
if (!"1".equals(this.request.getParameter("edit"))) |
{ |
User user = this.userDAO.searchUsername((String) this.session |
.get("username")); |
ObjectEntity obj = new ObjectEntity(user, new ObjectType(ObjectType.TERM), |
user, null, new Date(), false, this.term, null, null); |
ObjectEntity obj = new ObjectEntity(user, |
new ObjectType(ObjectType.TERM), user, null, new Date(), false, |
this.term, null, null); |
this.term.setObject(obj); |
} |
|
if (this.termDAO.saveOrUpdate(this.term)) |
{ |
return Action.SUCCESS; |
77,7 → 85,7 |
*/ |
public String list() |
{ |
this.termList = this.termDAO.listTerm(); |
this.termList = this.termDAO.getTerms(); |
return Action.SUCCESS; |
} |
|
94,6 → 102,7 |
this.term = this.termDAO.getTermById(id); |
if (this.term != null) |
{ |
this.term.edit = true; |
return Action.SUCCESS; |
} |
} |
108,13 → 117,10 |
*/ |
private int getIdParameter() |
{ |
HttpServletRequest request = (HttpServletRequest) ActionContext |
.getContext().get(StrutsStatics.HTTP_REQUEST); |
|
int id = -1; |
try |
{ |
id = Integer.parseInt(request.getParameter("id")); //$NON-NLS-1$ |
id = Integer.parseInt(this.request.getParameter("id")); //$NON-NLS-1$ |
} |
catch (Exception e) |
{ |