java.lang.NumberFormatException:对于输入字符串:

时间:2014-08-02 08:51:37

标签: jsp jsf

我需要将此参数值传递到其他页面。我怎样才能从中得到价值感谢提前......我在等你的回复

 <a href="return1.jsp?bid=<%= rs.getString("bid") %>? isbn=<%=rs.getString("isbn")%>? bdate=<%= rs.getString("bdate") %>? rdate=<%= rs.getString("rdate") %>? mid=<%=rs.getString("mid")  %>"> 
       <input type="button" value="Return" class="btn btn-primary" /></a>

但是我得到这样的错误..

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.jasper.JasperException: org.apache.jasper.JasperException: java.lang.NumberFormatException: For input string: "8? isbn=008? bdate=2014-08-03? rdate=2014-8-9? mid=76"
    at org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:361)

感谢...

1 个答案:

答案 0 :(得分:1)

您可以选择几种选项:

  • 使用Javascript获取值并将窗口位置更改为目标页面
  • 服务器端获取参数并重定向到包含这些参数的其他页面
  • 或服务器端转发而不是重定向。

需要更多信息才能了解您的代码。

至于你的例外,问题是HTTP查询字符串应该使用&#34;&amp;&#34;而不是&#34;?&#34;结合参数。

您可以尝试更改为以下内容:

 <a href="return1.jsp?bid=<%= rs.getString("bid") %>&isbn=<%=rs.getString("isbn")%>&bdate=<%= rs.getString("bdate") %>&rdate=<%= rs.getString("rdate") %>&mid=<%=rs.getString("mid")  %>">