我开始学习struts2,不知道很多,请各位老师帮帮我。我有这样的动作课
public class LoginAction extends ActionSupport {
private String login;
private String password;
private Collection<News> newses = new ArrayList<News>();
public String execute() {
UserDao userDao = new UserDao();
if(userDao.checkUser(getLogin(),getPassword())){
NewsDao newDao = new NewsDao();
setNewses(newDao.getAllNews());
return SUCCESS;
}
return ERROR;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Collection<News> getNewses() {
NewsDao newDao = new NewsDao();
setNewses(newDao.getAllNews());
return newses;
}
public void setNewses(Collection<News> newses) {
this.newses = newses;
}
}
当执行方法返回成功时,它重定向到news.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title><s:text name="news.page.title"/></title>
</head>
<body>
<s:text name="news.page.main.label"/>
<s:iterator status="stat" value="newses">
<s:property value="title"/>
<s:property value="body"/>
<s:property value="user.name"/>
</s:iterator>
<s:include value="../jspf/footer.jsp" />
</body>
</html>
但结果它显示这样的东西
并且不显示我的收藏..(带有页脚按钮的文本字段和文本区域)帮助我,请告诉我我做错了什么谢谢