struts2 怎么从jsp传JavaBean给action
${sessionScope.user.getUserId()}${sessionScope.user.getUName()}${sessionScope.user.ge...
${sessionScope.user.getUserId()} ${sessionScope.user.getUName()} ${sessionScope.user.getUPass()} ${sessionScope.user.getNickname()}
这是传的方法private Blog_user user; private Blog blog; public Blog_user getUser() { return user; } public void setUser(Blog_user user) { this.user = user; } public Blog getBlog() { return blog; } public void setBlog(Blog blog) { this.blog = blog; } public String execute() throws Exception { System.out.println("uName:"+user.getUName()); if(null != user) { BlogDao bd = new BlogDao(); user = bd.Login(user); if(null == user) { return Action.SUCCESS; } else { boolean flag = bd.AddBlog(blog, user); if(flag) { return LOGIN; } else { return SUCCESS; } } } return SUCCESS; } 这是接收 可是接收的时候提示这个Error setting expression 'user' with value '[Ljava.lang.String;@413eabd9'ognl.MethodFailedException: Method "setUser" failed for object com.action.Add_BlogAction@58ba93d1 [java.lang.NoSuchMethodException: com.action.Add_BlogAction.setUser([Ljava.lang.String;)]BlogID BlogTitle BlogMaster 1 AAAA af 2 BBBB wd 3 CCCC LL 4 DDDD gw 5 EEEE af 6 FFFF af 7 GGGG wd 8 HHHH LL 9 IIII af 1001 af 123 master 这是jsp页面显示的 user内容都能显示 求帮忙! 展开
这是传的方法private Blog_user user; private Blog blog; public Blog_user getUser() { return user; } public void setUser(Blog_user user) { this.user = user; } public Blog getBlog() { return blog; } public void setBlog(Blog blog) { this.blog = blog; } public String execute() throws Exception { System.out.println("uName:"+user.getUName()); if(null != user) { BlogDao bd = new BlogDao(); user = bd.Login(user); if(null == user) { return Action.SUCCESS; } else { boolean flag = bd.AddBlog(blog, user); if(flag) { return LOGIN; } else { return SUCCESS; } } } return SUCCESS; } 这是接收 可是接收的时候提示这个Error setting expression 'user' with value '[Ljava.lang.String;@413eabd9'ognl.MethodFailedException: Method "setUser" failed for object com.action.Add_BlogAction@58ba93d1 [java.lang.NoSuchMethodException: com.action.Add_BlogAction.setUser([Ljava.lang.String;)]BlogID BlogTitle BlogMaster 1 AAAA af 2 BBBB wd 3 CCCC LL 4 DDDD gw 5 EEEE af 6 FFFF af 7 GGGG wd 8 HHHH LL 9 IIII af 1001 af 123 master 这是jsp页面显示的 user内容都能显示 求帮忙! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询