别着急,首先你选request出来你传过来的参数,都打印出来看看是不是要获得的值,然后再逐个付给你需要的变量,并打印出来看看结果,应该不会出现你所说的这个错误的
解决方案 »
- 求ACCP6.0毕业设计hr
- 问:是否一个项目中只能有一个侦听器 ?
- jsp项目运行时出现的问题
- 请教javax.naming.NameNotFoundException: Name evn is not bound in this Context
- 哪位知道悬浮菜单是怎么实现的??急
- Weblogic8.0与Tomcat5.0的RequestDispatch类的使用区别?
- java中文乱码问题
- 放100分,征求一下意见!
- 急!!!怎么用超链接<a>传送参数,参数的值为jsp动态计算出来的?
- Oscache集群环境下报错重写并序列化了
- 为什么getString 出把地址给取出来,0x32432432432,怎么办啊?
- 求助:关于建立聊天室的问题,求助资料!!!!!!
即使是用ActionForm也不用怕,照样改名字,再通过getParameter的方式得到值后,通过
ActionForm的set方法设置相应的值。
String sql2 = "";
String type = "";
String userid = "";
int pt_size = 8;
String houseid="",addaction = "", add_memo = ""; if (hsBean.session.getValue("userid") != null) {
if (!hsBean.session.getValue("userid").equals("")) {
userid = (hsBean.session.getValue("userid").equals("") ? "" :
hsBean.session.getValue("userid").toString());
}
}
Statement stmt1 = hsBean.getStatement();
Statement stmt = hsBean.getStatement();
Statement stat = hsBean.getStatement();
Statement stat1 = hsBean.getStatement();
ResultSet rs, rs1; String city = "";
String ydowner = "";
String yddblink = "";
String ydurl = "";
String sql = "";
String modify_city = "";
hsBean.println("city:"+hsBean.getParameter("city"));
hsBean.println("add_memo:"+hsBean.getParameter("add_memo"));
hsBean.println("addaction:"+hsBean.getParameter("addaction"));
hsBean.println("houseid:"+hsBean.getParameter("houseid"));
if (hsBean.getParameter("city") != null) {
city = hsBean.getParameter("city");
}
if (hsBean.getParameter("houseid") != null && houseid.equals("")) {
houseid=hsBean.getParameter("houseid");
}
sql = "select * from " + hsBean.profileowner + "cityinfo" +
hsBean.profiledblink + " where connecthost='" + hsBean.profileip +
"' and name='" + city + "'";
hsBean.println(sql);
rs = hsBean.executeQuery(sql, stmt);
if (rs.next()) {
ydowner = rs.getString("ownername") + ".";
yddblink = rs.getString("dblink");
ydurl = rs.getString("cityurl");
modify_city = rs.getString("name");
}
rs.close(); hsBean.println("<html>");
hsBean.println("<head>"); hsBean.println(
"<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>");
hsBean.println(
"<LINK href='/js/eall2002.css' rel=stylesheet type=text/css>");
hsBean.println("<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>");
hsBean.println("<!--");
hsBean.println("function form2_onsubmit()");
hsBean.println("{");
hsBean.println("if(form2.add_memo.value ==''){");
hsBean.println(" alert('内容不得为空');");
hsBean.println(" form2.add_memo.focus();");
hsBean.println("return false;");
hsBean.println(" }");
hsBean.println("return true");
hsBean.println("}");
hsBean.println("//-->");
hsBean.println("</SCRIPT>");
hsBean.println("</head><body>");
hsBean.println(
"<table width='700' border='0' cellspacing='0' cellpadding='0' height='21'>");
hsBean.println("<tr>");
hsBean.println("<td id=mainftitle>[ 房源详细信息 ]</td>");
hsBean.println("</tr>");
hsBean.println("</table>");
sql2 = "select * from " + ydowner + "tb_eval_baseinfo" + yddblink +
" where id=" + houseid;
hsBean.println(sql2);
rs1 = hsBean.executeQuery(sql2, stat1);
if (rs1.next()) {
String input_depart = rs1.getString("INPUT_DEPART"); hsBean.println(
"<form name='inputform' action='/servlet/bheall.sh_yd_eval_modify_info?city=" +
modify_city + "' method=\"POST\" >");
hsBean.println("<input type=hidden name=houseid value=" + houseid + ">");
//第1行
hsBean.println("<table border=0 cellspacing=1 cellpadding=0 id=bgtable width=700 align=center>");
hsBean.println(
"<tr><td id=bgtitle colspan=4 align=center><b>房 屋 信 息</b> //////////////………………………这里是很多数据库查询,都用到了houseid,太多了,就不贴了……………………………………… hsBean.println(
"<input type=submit class=mybutton name=modify value='修改'>");
hsBean.println("<input type=hidden name=oprtype value=''>");
hsBean.println(" <input type=button onClick='javascript:return del();' name=delete class=mybutton value='删除'>");
hsBean.println("</td>");
hsBean.println("</tr></table><div align=center>");
hsBean.println(" <input type=button class=mybutton name=back value='返回' onClick='javascript:history.back();'>");
hsBean.println("</div></form>");
//追加反馈信息
if (hsBean.getParameter("addaction") != null) {
addaction = hsBean.getParameter("addaction");
hsBean.println("the addaction is:" + addaction);
if (addaction.equals("add")) {
if (rs1.getString("add_memo") == null) {
add_memo = hsBean.getParameter("add_memo");
}
else {
add_memo = rs1.getString("add_memo") +
hsBean.getParameter("add_memo");
}
String mysql = "update " + ydowner + "tb_eval_baseinfo" + yddblink +
" set add_memo='" + add_memo + "' where id=" + houseid;
hsBean.println(mysql);
hsBean.executeUpdate(mysql, stmt1);
hsBean.sendRedirect("/servlet/bheall.sh_yd_eval_view_info?city=" +
modify_city + "&houseid=" + houseid);
}
}
add_memo = rs1.getString("add_memo");
if (add_memo == null) {
add_memo = "暂无反馈信息!";
}
hsBean.println("<div align=center><table id=bgtable width='700' border='0' cellspacing='1' cellpadding='0' align=center>");
hsBean.println(
"<form name=form2 method=\"post\" action=/servlet/bheall.sh_yd_eval_view_info_1? LANGUAGE=javascript onsubmit='return form2_onsubmit()'>");
hsBean.println("<input type=text name=houseid value=" + houseid + ">");
hsBean.println("<input type=text name=city value='" + modify_city + "'>");
hsBean.println("<input type=text name=addaction value='add'>");
hsBean.println("<tr><td id=bgtitle>反馈内容:</td><td id=bgbody colspan=2>" +
add_memo + "</td></tr>");
hsBean.println("<tr><td id=bgtitle>增加反馈内容:</td><td id=bgbody><input name=add_memo type=text class=myinput size=70 ></td>");
hsBean.println("<td id=bgbody size=90><input type=submit value='提 交' class=mybutton ></td></tr>");
hsBean.println("</form>");
hsBean.println("</table></div>");
hsBean.println("</body>");
hsBean.println("</html>");
houseid=hsBean.getParameter("houseid");
}可以接受其他参数,否则,就不可以了