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

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;
}


}

你可能感兴趣的:(ActionContext.getContext().getValueStack().push(pList);//放入到对象栈的栈顶)