Methods Summary |
---|
public java.lang.String | getCategory()
return category;
|
public java.lang.String | getMsg()
return msg;
|
public void | setCategory(java.lang.String category)
this.category = category;
|
public void | setMsg(java.lang.String msg)
this.msg = msg;
|
public void | setNewsBean(NewsBean newsBean)
this.newsBean = newsBean;
|
public void | setRequestMethod(java.lang.String requestMethod)
this.requestMethod = requestMethod;
|
public void | setValidUser(EmployeeBean validUser)
this.validUser = validUser;
|
public java.lang.String | store()Creates a new NewsItemBean and sets its properties based
on the "category" and "msg" request parameters, plus
the firstName and lastName properties of the authenticated
user (an EmployeeBean accessible as the "validUser" session
attribute). The NewItemBean is then added to the NewsBean.
This action is only performed for POST request.
if ("POST".equals(requestMethod)) {
NewsItemBean item = new NewsItemBean();
item.setCategory(category);
item.setMsg(msg);
item.setPostedBy(validUser.getFirstName() + " " +
validUser.getLastName());
newsBean.setNewsItem(item);
}
return "success";
|