菜鸟诚恳请教调试jsp问题 在线等 sort_add.jsp的46行,可能有个变量是null 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是我的代码<%@ page contentType="text/html; charset=gb2312" %> <%@include file="../../pub/WuserSession.jsp"%><%/*添加和修改图片所属栏目分类的jsp页面**2005.5.18*///StrID 用来判断是否有记录String StrID = (String)request.getParameter("st_sortID");//StrOperation用来判断对数据库做什么操作String StrOperation = (String)request.getParameter("opt");String st_sortTitle="",st_sortMemo="" ,st_sortID="";//StrID==null进行添加操作 StrID!=null修改操作if(StrID!=null){ if(StrOperation.equals("update")){//修改提交 String strSql = "update KL_SortTable set "; strSql += " st_sortTitle='"+ request.getParameter("st_sortTitle") +"'" + ",st_sortMemo='"+ request.getParameter("st_sortMemo") +"'" + " where st_sortID="+StrID; int i=dbquery.executeUpdate(strSql); out.println("<script language='javascript'>"); out.println("location='sort_add.jsp'"); out.println("</script>"); out.flush(); }else{ String strSql = "select * from KL_SortTable where st_sortID="+ StrID; ResultSet rs = dbquery.executeQuery(strSql); if(rs.next()){ st_sortTitle=rs.getString("st_sortTitle"); st_sortMemo=rs.getString("st_sortMemo"); rs.close(); rs=null; } if(rs!=null)rs=null; dbquery.stmtcls(); }}else{ if(StrOperation.equals("insert")){//新增提交 String strSql = "insert into KL_SortTable (st_sortTitle,st_sortMemo)"; strSql += " values('"+ request.getParameter("st_sortTitle") +"','" + request.getParameter("st_sortMemo") +"')"; int i=dbquery.executeUpdate(strSql); out.println("<script language='javascript'>"); out.println("location='sort_add.jsp';"); out.println("</script>"); out.flush();}}%><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>无标题文档</title></head><body><p align="center">新增图片栏目</p><form name="form_add_update_sort" method="post" action="sort_add.jsp"> <div align="center"> <table width="60%" height="363" border="1" bordercolor="#9900FF"> <caption> </caption> <tr> <th width="74" height="46" scope="row">栏目标题</th> <td width="306"> <input name="st_sortTitle" type="text" id="st_sortTitle" value="<%=st_sortTitle%>" maxlength="50"></td> </tr> <tr> <th height="233" scope="row">栏目说明</th> <td nowrap bordercolor="#9966FF"> <div align="left"> <blockquote> <blockquote> <p name="textarea" rows="10"> <textarea name="st_sortMemo" rows="10" id="st_sortMemo"><%=st_sortMemo%></textarea> </p> </blockquote> </blockquote> </div></td> </tr> <tr> <td><%if(StrID!=null){ %> <input name="Submit1" type="submit" class="input_g" value="确定"> <input name="id" type="hidden" value="<%=st_sortID%>"> <input name="opt" type="hidden" value="update"> <% }else{ %> <input name="Submit2" type="submit" class="input_g" value="保存"> <input name="opt" type="hidden" value="insert"> <% }%></td> <td><input name="Submit3" type="button" class="input_g" value="取消" onclick="javascript:history.back();"></td> </tr> </table></div> <div align="center"></div></form><p> </p></body></html> 谁有jsp视频播放器代码? jxl.jar 导出表时创建表时语言有错,麻烦各位看下 怎么访问不到数据库了? 表单计算问题,请教大家了 求救!!! 各位大侠,谁会让两个div在一个水平线上显示,在线等!十万火急,谢谢! 不知大家都用什么做jsp Web报表(Free的) ★★★★★求助多語言問題?????? 初学者的菜鸟问题 链接格式该怎样写<a href="/WEB-INF/lib/com.user.UserServlet?id=11111">用户管理</a>这样写为什么总是出错? 下拉列表联动(高手请进-急用) JDK环境配置问题
<%@include file="../../pub/WuserSession.jsp"%>
<%
/*添加和修改图片所属栏目分类的jsp页面
**2005.5.18
*///StrID 用来判断是否有记录String StrID = (String)request.getParameter("st_sortID");//StrOperation用来判断对数据库做什么操作String StrOperation = (String)request.getParameter("opt");String st_sortTitle="",st_sortMemo="" ,st_sortID="";//StrID==null进行添加操作 StrID!=null修改操作if(StrID!=null){
if(StrOperation.equals("update")){//修改提交
String strSql = "update KL_SortTable set ";
strSql += " st_sortTitle='"+ request.getParameter("st_sortTitle") +"'"
+ ",st_sortMemo='"+ request.getParameter("st_sortMemo") +"'"
+ " where st_sortID="+StrID;
int i=dbquery.executeUpdate(strSql);
out.println("<script language='javascript'>");
out.println("location='sort_add.jsp'");
out.println("</script>");
out.flush();
}else{
String strSql = "select * from KL_SortTable where st_sortID="+ StrID;
ResultSet rs = dbquery.executeQuery(strSql);
if(rs.next()){
st_sortTitle=rs.getString("st_sortTitle");
st_sortMemo=rs.getString("st_sortMemo");
rs.close();
rs=null;
}
if(rs!=null)rs=null;
dbquery.stmtcls();
}
}
else{
if(StrOperation.equals("insert")){//新增提交
String strSql = "insert into KL_SortTable (st_sortTitle,st_sortMemo)";
strSql += " values('"+ request.getParameter("st_sortTitle") +"','"
+ request.getParameter("st_sortMemo") +"')";
int i=dbquery.executeUpdate(strSql);
out.println("<script language='javascript'>");
out.println("location='sort_add.jsp';");
out.println("</script>");
out.flush();
}
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<p align="center">新增图片栏目
</p>
<form name="form_add_update_sort" method="post" action="sort_add.jsp">
<div align="center">
<table width="60%" height="363" border="1" bordercolor="#9900FF">
<caption>
</caption>
<tr>
<th width="74" height="46" scope="row">栏目标题</th>
<td width="306">
<input name="st_sortTitle" type="text" id="st_sortTitle" value="<%=st_sortTitle%>" maxlength="50"></td>
</tr>
<tr>
<th height="233" scope="row">栏目说明</th>
<td nowrap bordercolor="#9966FF">
<div align="left">
<blockquote>
<blockquote>
<p name="textarea" rows="10">
<textarea name="st_sortMemo" rows="10" id="st_sortMemo"><%=st_sortMemo%></textarea>
</p>
</blockquote>
</blockquote>
</div></td>
</tr>
<tr>
<td><%if(StrID!=null){ %>
<input name="Submit1" type="submit" class="input_g" value="确定">
<input name="id" type="hidden" value="<%=st_sortID%>">
<input name="opt" type="hidden" value="update">
<%
}else{
%>
<input name="Submit2" type="submit" class="input_g" value="保存">
<input name="opt" type="hidden" value="insert"> <%
}%></td>
<td><input name="Submit3" type="button" class="input_g" value="取消" onclick="javascript:history.back();"></td>
</tr>
</table>
</div>
<div align="center"></div>
</form>
<p> </p>
</body>
</html>