当前位置: 代码迷 >> Java Web开发 >> jsp:forward出现错误
  详细解决方案

jsp:forward出现错误

热度:111   发布时间:2016-04-17 12:42:01.0
jsp:forward出现异常
本人从数据库里查询出记录后,删除一条后,在删除处理页面返回的时候,总是出现异常..
请各位大侠帮我看看........

delete processing page...
<%
String id=request.getParameter("id");
String database=request.getParameter("database");
database=new String(database.trim().getBytes("ISO-8859-1"),"GB2312");
  String electrical_code=request.getParameter("elec_code");
  String room=request.getParameter("room");
  room=new String(room.getBytes("ISO-8859-1"),"GB2312");
  String model=request.getParameter("model");
  model=new String(model.getBytes("ISO-8859-1"),"GB2312");
  String attri=request.getParameter("attri");
  attri=new String(attri.getBytes("ISO-8859-1"),"GB2312");
  String port=request.getParameter("port");
  port=new String(port.getBytes("ISO-8859-1"),"GB2312");
String sql="delete from "+database+" where iid ='"+id+"'";
search.delete_pro(sql);

%>
<jsp:forward page="sw_process_q4.jsp?elec_code=<%=electrical_code%>&room=<%=room%>&model=<%=model%>&attri=<%=attri%>&port=<%=port%>"></jsp:forward>
</body>


return page....

<body>
<jsp:useBean id="search" scope="page" class="bean.JdbcBeanConn"></jsp:useBean>
<jsp:setProperty name="search" property="*"/>
<% 
  //request.setCharacterEncoding("gb2312");
   
  String bsc1=request.getParameter("bsc");
  bsc1=new String(bsc1.getBytes("ISO-8859-1"),"GB2312");
  String a_mms=request.getParameter("a_msc");
  a_mms=new String(a_mms.getBytes("ISO-8859-1"),"GB2312");
  String BSC_ROOM=request.getParameter("bsc_room");
  BSC_ROOM=new String(BSC_ROOM.trim().getBytes("ISO-8859-1"),"GB2312");
  String xcdr=request.getParameter("xcdr");
  xcdr=new String(xcdr.getBytes("ISO-8859-1"),"GB2312");
  String z_mms=request.getParameter("z_mms");
  //z_mms=new String(z_mms.getBytes("ISO-8859-1"),"GB2312");
  String xcdr_room=request.getParameter("xcdr_room");
  xcdr_room=new String(xcdr_room.getBytes("ISO-8859-1"),"GB2312");
  //String database=request.getParameter("database");
  ResultSet rs=null;
  String sql=null;
  sql="select * from wire_xcdr where bsc like '%" + bsc1 + "%'and mms like '%" + a_mms + "%'and a_room like '%" + BSC_ROOM + "%' and xcdr like '%" + xcdr + "%'and z_mms like '%" + z_mms + "%'and z_room like '%" + xcdr_room + "%' order by electrical_code";
 
  rs=search.execueteQuery(sql);
  int len=rs.getMetaData().getColumnCount();
  if(rs!=null){
  %>
<p class="gene">查询结果:<span align="center" class="gene" style="color:red"><a href="wu_export.jsp?bsc=<%=bsc1%>&bsc_room=<%=BSC_ROOM %>&a_mms=<%=a_mms %>&xcdr=<%=xcdr %>&z_mms=<%=z_mms%>&z_room=<%=xcdr_room %>">导出查询结果到excel</a></span></p>
<table border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#999999">
  <tr>
 <th>电路代码</th>
 <th>BSC</th>
  <th>BSC机房</th>
  <th>MMS</th>
  相关解决方案