中秋节到了,解决问题领月饼吃了

dayutou881108 2011-09-09 03:50:54

Jsp代码
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib uri="/webwork" prefix="ww" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="javascript">
function modify()
{
userDetailForm.action="UserModifyAction!search.action";
userDetailForm.submit();
}

function del()
{
userDetailForm.action="UserDelete.action";
userDetailForm.submit();
}
</script>
<body>
<form name="userDetailForm" method="post" action="">
<input type="hidden" name="userInfo.id" value="<ww:property value="userInfo.id"/>"/>
<input type="hidden" name="userInfo.name" value="<ww:property value="userInfo.name"/>"/>
<input type="hidden" name="userInfo.password" value="<ww:property value="userInfo.password"/>"/>
<input type="hidden" name="userInfo.email" value="<ww:property value="userInfo.email"/>"/>
<input type="hidden" name="userInfo.sex" value="<ww:property value="userInfo.sex"/>"/>
<input type="hidden" name="userInfo.age" value="<ww:property value="userInfo.age"/>"/>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td colspan="2">用户详情</td>
</tr>
<tr>
<td>姓名</td>
<td><ww:property value="userInfo.name" /></td>
</tr>
<tr>
<td>性别</td>
<!--<td><ww:property id="userInfo.sex"/></td>-->
<td><ww:if test="userInfo.sex==0">男</ww:if>
<ww:else>女</ww:else></td>
</tr>
<tr>
<td>年龄</td>
<td><ww:property value="userInfo.age"/></td>
</tr>
<tr>
<td>email</td>
<td><ww:property value="userInfo.email"/></td>
</tr>
<tr>
<td align="right"><input type="submit" value="修改" onClick="modify()"></td>
<td><input type="submit" value="删除" onClick="del()"></td>
</tr>
</table>
</form>
</body>
</html>




后台Action:
package com.inspur.report.web.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.inspur.report.bean.UserInfo;
import com.inspur.report.business.IUserService;
import com.opensymphony.webwork.interceptor.ServletRequestAware;
import com.opensymphony.webwork.interceptor.ServletResponseAware;
import com.opensymphony.xwork.Action;
import com.opensymphony.xwork.ActionSupport;
import com.opensymphony.xwork.ModelDriven;

/**
* @author $author
*/
public class UserModifyAction extends ActionSupport implements Action,
ModelDriven{
private UserInfo userInfo = new UserInfo();

private IUserService userService;

/**
* @see com.opensymphony.xwork.Action#execute()
*/
public String search(UserInfo inputUserInfo) {
Integer userId = inputUserInfo.getId();
if (userId == null) {
return Action.ERROR;
}
List userList = userService.getAllUser();
UserInfo retuser = null;
for (int i = 0; i < userList.size(); i++) {
retuser = (UserInfo) userList.get(i);
if (retuser.getId() == userId) {
break;
}
}
return Action.SUCCESS;
}

public String save(UserInfo inputUserInfo) {
if (userService.saveUser(userInfo) == 0) {
return Action.ERROR;
}
return Action.SUCCESS;
}

public String execute() throws Exception {
return Action.SUCCESS;

}

public Object getModel() {
// TODO Auto-generated method stub
return userInfo;
}

public UserInfo getUserInfo() {
return userInfo;
}

public void setUserInfo(UserInfo userInfo) {
this.userInfo = userInfo;
}

public IUserService getUserService() {
return userService;
}

public void setUserService(IUserService userService) {
this.userService = userService;
}



}


控制台的错误是
java.lang.IllegalArgumentException: Neither search() nor it's doXxx() equivalent is defined in action class com.inspur.report.web.action.UserModifyAction
但是明明search() 方法在呀
...全文
287 27 打赏 收藏 转发到动态 举报
写回复
用AI写文章
27 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
while(true)
{
new MoonCake("豆沙");
}
gmogle 2011-09-09
  • 打赏
  • 举报
回复
dayutou881108 2011-09-09
  • 打赏
  • 举报
回复
liuyuhua0066 2011-09-09
  • 打赏
  • 举报
回复
骗纸 坏淫--
[Quote=引用 23 楼 dayutou881108 的回复:]
引用 22 楼 liuyuhua0066 的回复:
不包邮么?O(∩_∩)O哈哈~

引用 20 楼 dayutou881108 的回复:
引用 18 楼 liuyuhua0066 的回复:
贴你现在的页面代码

好 分全给你 另外在济南的话送月饼

包邮。。。。。我哪点实习工资挥霍不起。。。呀 果果
[/Quote]
dayutou881108 2011-09-09
  • 打赏
  • 举报
回复
[Quote=引用 22 楼 liuyuhua0066 的回复:]
不包邮么?O(∩_∩)O哈哈~

引用 20 楼 dayutou881108 的回复:
引用 18 楼 liuyuhua0066 的回复:
贴你现在的页面代码

好 分全给你 另外在济南的话送月饼
[/Quote]
包邮。。。。。我哪点实习工资挥霍不起。。。呀 果果
liuyuhua0066 2011-09-09
  • 打赏
  • 举报
回复
不包邮么?O(∩_∩)O哈哈~
[Quote=引用 20 楼 dayutou881108 的回复:]
引用 18 楼 liuyuhua0066 的回复:
贴你现在的页面代码

好 分全给你 另外在济南的话送月饼
[/Quote]
dayutou881108 2011-09-09
  • 打赏
  • 举报
回复
[Quote=引用 15 楼 huangchenliang 的回复:]
顶你,获得用户信息传个用户ID就行了。干嘛把个整个对象都传过去、
思路ls已经写得很明确的。

PS:月饼拿来。
[/Quote]
一看你的头像我就不能给你月饼吃 因为我是凯密。。。你懂得的
dayutou881108 2011-09-09
  • 打赏
  • 举报
回复
[Quote=引用 18 楼 liuyuhua0066 的回复:]
贴你现在的页面代码
[/Quote]
好 分全给你 另外在济南的话送月饼
zhuzhangliang 2011-09-09
  • 打赏
  • 举报
回复
公司没发月饼,今天客户让我们吃月饼了,哈哈。。。
liuyuhua0066 2011-09-09
  • 打赏
  • 举报
回复
贴你现在的页面代码
瑾安 2011-09-09
  • 打赏
  • 举报
回复
路过学习
dayutou881108 2011-09-09
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 liuyuhua0066 的回复:]
这个只是实例,需要修改的,直接用肯定不行……
在页面用个hidden,值为userInfo.userId
在modify方法中,用js取得userId
然后再传值到后台

引用 13 楼 dayutou881108 的回复:
引用 10 楼 liuyuhua0066 的回复:
userId你直接从userDetailForm.action="UserModifyAction!sear……
[/Quote]
详细点 我代码都写好了
完美灬缺陷 2011-09-09
  • 打赏
  • 举报
回复
顶你,获得用户信息传个用户ID就行了。干嘛把个整个对象都传过去、
思路ls已经写得很明确的。

PS:月饼拿来。
liuyuhua0066 2011-09-09
  • 打赏
  • 举报
回复
这个只是实例,需要修改的,直接用肯定不行……
在页面用个hidden,值为userInfo.userId
在modify方法中,用js取得userId
然后再传值到后台
[Quote=引用 13 楼 dayutou881108 的回复:]
引用 10 楼 liuyuhua0066 的回复:
userId你直接从userDetailForm.action="UserModifyAction!search.action?userId="+__ 传递过去就行。

search方法加参数做什么?

哥哥你这种方法我的页面直接不动了。。。。后台不报错
[/Quote]
dayutou881108 2011-09-09
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 liuyuhua0066 的回复:]
userId你直接从userDetailForm.action="UserModifyAction!search.action?userId="+__ 传递过去就行。

search方法加参数做什么?
[/Quote]
哥哥你这种方法我的页面直接不动了。。。。后台不报错
coooliang 2011-09-09
  • 打赏
  • 举报
回复
public String search(UserInfo inputUserInfo){}
改为:
public String search(){}

我一般这样
userDetailForm.action="UserModifyAction!search";
疯狂的驴子 2011-09-09
  • 打赏
  • 举报
回复
去掉参数就可以啊。lz
liuyuhua0066 2011-09-09
  • 打赏
  • 举报
回复
userId你直接从userDetailForm.action="UserModifyAction!search.action?userId="+__ 传递过去就行。

search方法加参数做什么?
liuyuhua0066 2011-09-09
  • 打赏
  • 举报
回复
String search(UserInfo inputUserInfo)
参数??
ypkonig 2011-09-09
  • 打赏
  • 举报
回复
等着领
加载更多回复(7)
资源下载链接为: https://pan.quark.cn/s/9e7ef05254f8 “使用 Python 为中秋节绘制一块美味的月饼”是利用 Python 的 turtle 库来绘制一个类似月饼的图形。turtle 库是一个简单的图形用户界面(GUI)库,通过编程可以绘制各种图形。在这个案例中,我们会用它来构建一个圆形或其他类似月饼形状的图像,以此庆祝中秋节。这种教程或代码示例具有一定的参考价值,尤其是对于对编程感兴趣、想尝试绘制有趣图形的人来说,可以作为学习 Python 图形绘制和使用 turtle 库的起点。 Python 的 turtle 库提供了多种方法,比如 forward() 和 backward() 用于控制 turtle 的移动,left() 和 right() 用于改变方向,circle() 用于绘制圆形,fillcolor() 和 begin_fill()、end_fill() 用于填充颜色等。在绘制月饼时,这些方法都非常有用。例如,可以先设置 turtle 的颜色,移动到合适位置,绘制一个圆形作为月饼主体,再用其他颜色绘制装饰图案,比如花纹或文字。 这个项目专注于结合 Python 编程和中秋节主题,通过编程绘制出象征节日的月饼形象。turtle 库的常用方法还包括 color() 设置线条颜色,penup() 和 pendown() 控制是否绘制线条,goto() 定位 turtle 的位置等。在实际操作中,可能会遇到一些问题,比如 PyCharm 出现警告,但这通常不影响程序运行。解决方法是查看源代码,调整 __all__ 变量的定义,确保所有需要的方法都被正确引入。 在绘制过程中,首先导入 turtle 库并创建一个 turtle 对象,然后设置绘图速度,用 circle() 函数画出月饼的基本形状,再通过 fillcolor() 和 b

67,542

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧