ActionContext.getContext().getValueStack().push(pList);//放入到对象栈的栈顶

来源:互联网 发布:淘宝上怎么用微信支付 编辑:程序博客网 时间:2024/05/17 00:51
package com.tfy.oa.action;


import java.util.Collection;


import com.opensymphony.xwork2.ActionContext;
import com.tfy.oa.Util.BaseAction;
import com.tfy.oa.domain.Post;
import com.tfy.oa.service.PostService;


public class PostAction extends BaseAction<Post>{
private PostService postService;


public PostService getPostService() {
return postService;
}


public void setPostService(PostService postService) {
this.postService = postService;
}
public String findAllPost(){
Collection<Post> pList=this.postService.getAllPost();
ActionContext.getContext().getValueStack().push(pList);//放入到对象栈的栈顶
System.out.println("this.postService.getAllPost()=="+this.postService.getAllPost());
for(Post post:pList){
System.out.println("post.getPname()=="+post.getPname());
}
return listAction;
}


}