关于#的传值问题,大家帮忙看下
大家帮个忙看看,这段代码temp3是一个含有#的字符串,传值的时候老出毛病:
while(rs.next())
{ out.print( " <TR> ");
String temp1=rs.getString( "sort_number ");
String temp2=rs.getString( "e_name ");
String temp3=rs.getString( "e_size ");
String temp4=rs.getString( "unit ");
String temp5=rs.getString( "amount ");
String temp6=rs.getString( "location ");
out.print( " <TD > "+temp1+ " </TD> ");
out.print( " <TD > "+temp2+ " </TD> ");
out.print( " <TD > "+temp3+ " </TD> ");
out.print( " <TD > "+temp4+ " </TD> ");
out.print( " <TD > "+temp5+ " </TD> ");
out.print( " <TD > "+temp6+ " </TD> ");
out.print( " <TD > <a href= 'zhuan1.jsp?sort_number1= "+temp1+ "&&e_name1= "+temp2+ "&&e_size1= "+temp3+ "&&unit1= "+temp4+ "&&amount1= "+temp5+ "&&location1= "+temp6+ " '> 确定 </a> </TD> ");
out.print( " </TR> ") ;
}
出的错误:
java.lang.NullPointerException org.apache.jsp.send1_jsp._jspService(send1_jsp.java:308)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802
我找找了说是带有#的字符串用?的传值方法好像传不过去,大家有什么好的办法吗?小弟新学,请高手指点下,谢谢!
------解决方案--------------------是哪一句出错了???就这样看不出来