Caused by: java.lang.NumberFormatException: For input string: "performance-now.js"

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qing_gee/article/details/86063942
DEBUG 2019-01-08 10:43:53,507 org.springframework.web.servlet.DispatcherServlet: Handler execution resulted in exception - forwarding to resolved error view: ModelAndView: reference to view with name 'error'; model is {statusCode=300, message=Failed to convert value of type [java.lang.String] to required type [java.lang.Long]; nested exception is java.lang.NumberFormatException: For input string: "performance-now.js"}
org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type [java.lang.String] to required type [java.lang.Long]; nested exception is java.lang.NumberFormatException: For input string: "performance-now.js"
	at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:123)
	at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:121)
	at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:161)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:128)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:114)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at com.cmower.common.filter.SessionValidateFilter.doFilter(SessionValidateFilter.java:156)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NumberFormatException: For input string: "performance-now.js"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Long.parseLong(Long.java:589)
	at java.lang.Long.valueOf(Long.java:803)
	at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:211)
	at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:113)
	at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:468)
	at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:441)
	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:199)
	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:108)
	at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:64)
	at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:47)
	at org.springframework.validation.DataBinder.convertIfNecessary(DataBinder.java:688)
	at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:115)
	... 42 more

Web应用中一直报上面这个错误,不明白为什么?项目中没有请求加载performance-now.js,但不知道为什么后台就一直会请求这个文件。

然后找了好久不知道解决办法,就问青苗科技的石磊,他告诉了我答案:

原来是谷歌浏览器自己请求的!害我研究了好半天。

我换成了火狐浏览器,就不再有performance-now.js的请求错误了。


java.lang.NumberFormatException: For input string: "" 求救……

12-13

String[] fids=(String[])ac.getParameters().get("fid");rn String[] fimgs=(String[])ac.getParameters().get("fimg");rn User user=(User)ac.getSession().get("user");rn rn System.out.println(fids); 这个可以输出内容,rn Integer f=Integer.parseInt(fids[0].trim()); 这个可不能转化为Integerrnrn System.out.println(f);rn页面报下面异常,控制台没有报异常。求救!rnrnjava.lang.NumberFormatException: For input string: ""rn java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)rn java.lang.Integer.parseInt(Integer.java:468)rn java.lang.Integer.parseInt(Integer.java:497)rn com.lore.actions.FolderAction.editFolder(FolderAction.java:68)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:306)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:306)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn

java.lang.NumberFormatException: For input string: ""

11-26

严重: Servlet.service() for servlet jsp threw exceptionrnjava.lang.NumberFormatException: For input string: ""rn at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)rn at java.lang.Long.parseLong(Long.java:424)rn at java.lang.Long.(Long.java:671)rn at org.apache.el.lang.ELArithmetic$LongDelegate.coerce(ELArithmetic.java:186)rn at org.apache.el.lang.ELArithmetic.coerce(ELArithmetic.java:357)rn at org.apache.el.lang.ELArithmetic.subtract(ELArithmetic.java:277)rn at org.apache.el.parser.AstMinus.getValue(AstMinus.java:40)rn at org.apache.el.parser.AstGreaterThan.getValue(AstGreaterThan.java:37)rn at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)rn at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:935)rn at org.apache.jsp.WEB_002dINF.views.dbfx.report.ylfx_jsp._jspx_meth_c_005fwhen_005f11(ylfx_jsp.java:1590)rn at org.apache.jsp.WEB_002dINF.views.dbfx.report.ylfx_jsp._jspx_meth_c_005fchoose_005f5(ylfx_jsp.java:1555)rn at org.apache.jsp.WEB_002dINF.views.dbfx.report.ylfx_jsp._jspx_meth_c_005fwhen_005f4(ylfx_jsp.java:1205)rn at org.apache.jsp.WEB_002dINF.views.dbfx.report.ylfx_jsp._jspx_meth_c_005fchoose_005f2(ylfx_jsp.java:1156)rn at org.apache.jsp.WEB_002dINF.views.dbfx.report.ylfx_jsp._jspx_meth_c_005fforEach_005f2(ylfx_jsp.java:514)rn at org.apache.jsp.WEB_002dINF.views.dbfx.report.ylfx_jsp._jspx_meth_c_005fforEach_005f1(ylfx_jsp.java:396)rn at org.apache.jsp.WEB_002dINF.views.dbfx.report.ylfx_jsp._jspService(ylfx_jsp.java:217)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)rn at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164)rn at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)rn at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)rn at com.xr.common.interceptor.LoginInterceptor.intercept(LoginInterceptor.java:18)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor.intercept(AnnotationWorkflowInterceptor.java:135)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:161)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:233)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Thread.java:619)rn2015-11-26 10:14:45 org.apache.catalina.core.StandardWrapperValve invokern

java.lang.NumberFormatException: For input string: "201005040119"

05-04

代码:rnpublic void orderSave(Order order) rn Connection conn = null;rn PreparedStatement pstmt = null;rn rn SimpleDateFormat format = new SimpleDateFormat("yyyyMMddmmss");rn Date date = new Date(System.currentTimeMillis());rn String sid = format.format(date);rn rn int id = Integer.parseInt(sid);rn rn try rn conn = DB.getConn();rn rn String sql = "insert into salesorder values (?, ?, ?, ?, ?, ?)";rn pstmt = DB.getPstmt(conn, sql);rn rn pstmt.setInt(1, id);rn pstmt.setInt(2, order.getUser().getId());rn pstmt.setString(3, order.getAddr());rn pstmt.setTimestamp(4, order.getODate());rn pstmt.setDouble(5, order.getStatus());rn pstmt.setDouble(6, order.getTotalprice());rn pstmt.executeUpdate();rn rn rn catch(SQLException e) rn e.printStackTrace();rn rn finally rn DB.close(conn);rn DB.close(pstmt);rn rn rn rnrnrnMysql数据库结构rn+------------+---------------+------+-----+---------+-rn| Field | Type | Null | Key | Default |rn+------------+---------------+------+-----+---------+-rn| id | int(18) | NO | PRI | 0 |rn| userid | int(11) | YES | | NULL |rn| addr | varchar(255) | YES | | NULL |rn| odate | datetime | YES | | NULL |rn| status | int(11) | YES | | NULL |rn| totalprice | decimal(18,2) | YES | | NULL |rn+------------+---------------+------+-----+---------+-rnrn每次提交前后台总是报rnjava.lang.NumberFormatException: For input string: "201005040119"rn at java.lang.NumberFormatException.forInputString(Unknown Source)rn at java.lang.Integer.parseInt(Unknown Source)rn at java.lang.Integer.parseInt(Unknown Source)rn我觉得我已经将他转化成int了,为什么还For input string: "201005040119"rn麻烦大家了!!谢谢!!

错误java.lang.NumberFormatException: For input string: ""

04-27

exception rnrnjavax.servlet.ServletException: java.lang.NumberFormatException: For input string: ""rn org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.yufeng.utils.EncodingFilter.doFilter(EncodingFilter.java:24)rnrnroot cause rnrnjava.lang.NumberFormatException: For input string: ""rn java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)rn java.lang.Integer.parseInt(Integer.java:468)rn java.lang.Integer.parseInt(Integer.java:497)rn org.yufeng.struts.action.ArticleAction.admin_add_article(ArticleAction.java:463)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)rn org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.yufeng.utils.EncodingFilter.doFilter(EncodingFilter.java:24)rn我在用jsp编程做一个Struts+Spring+Hibernate文档管理系统,以上错误是在执行上传文件时出现的,具体情况:在admin_add_article.jsp中填写文档信息,点击该页面上传按钮跳转至do_upload.jsp显示上传信息,就是在点击“上传”按钮之后do_upload.jsp无法显示并出现以上错误。rn admin_add_article.jsprn<%@ page contentType="text/html;charset=UTF-8" import="java.util.*,com.jspsmart.upload.*" %>rn<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>rnrn rn 文章资源管理rn rn rn rn rn rn rn rn rn rn rnrnrn rn rn rn rnrn rn rn 文 章 详 细 信 息 rn rn rn rn rn rn rn rn 文章标题rn rn rn rn rn rn rn rn // 此处有文章其它信息的设置的代码,应该与此帖问题无关,在此省略rn rn rn 上传文件rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn <%rn rn out.println(" 文件路径(FilePath) "+getServletContext().getRealPath("/")+"");rn %> rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn do_upload.jsprn<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,com.jspsmart.upload.*" errorPage="" %>rnrnrn 文件上传处理页面rn rnrnrn rn<%rn // 新建一个SmartUpload对象rn SmartUpload su = new SmartUpload();rn // 上传初始化rn su.initialize(pageContext);rn // 设定上传限制rn // 1.限制每个上传文件的最大长度。rn //su.setMaxFileSize(40000);rn // 2.限制总上传数据的长度。rn su.setTotalMaxFileSize(150000);rn // 3.设定允许上传的文件(通过扩展名限制),仅允许doc,txt文件。rn //su.setAllowedFilesList("doc,txt");rn // 4.设定禁止上传的文件(通过扩展名限制),禁止上传带有exe,bat,jsp,htm,html扩展名的文件和没有扩展名的文件。rn //su.setDeniedFilesList("exe,bat,jsp,htm,html,,");rn // 上传文件rn su.upload();rn // 将上传文件全部保存到指定目录rn int count = su.save("/upload");rn out.println(count+"个文件上传成功! ");rn // 逐一提取上传文件信息,同时可保存文件。rn for (int i=0;i");rn out.println("表单项名(FieldName)"+file.getFieldName()+"");rn out.println("文件长度(Size)"+file.getSize()+"");rn out.println("文件名(FileName)"+file.getFileName()+"");rn out.println("文件扩展名(FileExt)" +file.getFileExt()+"");rn out.println("文件全名(FilePathName)"+file.getFilePathName()+"");rn out.println(" ");rn rn%>rnrn返回rnrnrn刚开始学jsp,恳请大家指点迷津!谢谢

java.lang.NumberFormatException: For input string: ""问题

09-24

type Exception reportrnrnmessagernrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexceptionrnrnjava.lang.NumberFormatException: For input string: ""rn java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)rn java.lang.Integer.parseInt(Integer.java:468)rn java.lang.Integer.parseInt(Integer.java:497)rn gao.servlet.ManagerServlet.doGet(ManagerServlet.java:30)rn gao.servlet.ManagerServlet.doPost(ManagerServlet.java:322)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn这是报错页面是说ManagerServlet的30和322有错么rnpackage gao.servlet;rnrnimport java.io.IOException;rnimport gao.java.*;rnimport java.util.*;rnrnimport javax.servlet.ServletException;rnimport javax.servlet.http.HttpServlet;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnimport javax.servlet.http.HttpSession;rnrnpublic class ManagerServlet extends HttpServlet rnrn rn public void doGet(HttpServletRequest request, HttpServletResponse response)rn throws ServletException, IOException rnrn request.setCharacterEncoding("utf-8");rn response.setContentType("text/html");rn response.setCharacterEncoding("utf-8");rn DBHandle dbh=new DBHandle();rn int pageSize=10;rn int pageCount=0;rn int pageNow=1;rn int rowCount=0;/rn String flag=request.getParameter("flag");rn String pageNowStr=request.getParameter("pageNow");rn if(pageNowStr==null||pageNowStr=="") pageNowStr="1";rn pageNow=Integer.parseInt(pageNowStr.trim());

java.lang.NumberFormatException: For input string: ""怎么回事?

07-22

java.lang.NumberFormatException: For input string: ""rn at java.lang.NumberFormatException.forInputString(Unknown Source)rn at java.lang.Integer.parseInt(Unknown Source)rn at java.lang.Integer.parseInt(Unknown Source)rn at action.SomebodyAction.execute(SomebodyAction.java:53)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)rn2008-7-22 10:41:26 org.apache.struts.action.RequestProcessor processExceptionrn警告: Unhandled Exception thrown: class java.lang.NumberFormatExceptionrn2008-7-22 10:41:26 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet action threw exceptionrnjava.lang.NumberFormatException: For input string: ""rn at java.lang.NumberFormatException.forInputString(Unknown Source)rn at java.lang.Integer.parseInt(Unknown Source)rn at java.lang.Integer.parseInt(Unknown Source)rn at dco.SomebodyDCO.getAllUser(SomebodyDCO.java:78)rn at action.SomebodyAction.execute(SomebodyAction.java:68)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)

java.lang.NumberFormatException: For input string: "pageCount" java.lang.Number

11-01

<%@ page language="java" import = "java.util.*" contentType="text/html; charset=UTF-8"rn pageEncoding="UTF-8"%>rnrn<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>rn<%@page language = "java" import = "com.itzcn.HibernateSession.*,com.itzcn.util.*,com.itzcn.Model.*" %>rnrnrn rn rn rn TTMSrn rn rnrn rn rn rn rn rn rn rn rn TTTTT剧院票务管理系统rn rn rnrn rn rn rn 贤心rn rn rn rn 基本资料rn rn rn 安全设置rn rn rn rn rn 退了rn rn rn rnrn rn rn rn rn rn 员工管理rn rn rn 添加员工rn rn rn 编辑员工rn rn rn rn rn rn rn rn rn rnrn rn rn <%rn int pageCount = 0;rn int pageNo = 1; rn int count = UtilMethod.getCount();rn System.out.println(count);rn int pageSize = 4;rn pageCount = (count%pageSize == 0)?(count/pageSize):(count/pageSize + 1);//确定一共有多少页rn // int pageCount = 1;rn String pageNostr = request.getParameter("pageSize");rn if(pageNostr != null && !"".equals(pageNostr))rn rn pageNo = Integer.parseInt(pageNostr);rn rn rn rn request.setAttribute("pageCount", pageCount);rn request.setAttribute("pageNo", pageNo);rn List listUser = UtilMethod.findByPage(pageNo, pageSize);rn Iterator iterator = listUser.iterator();rn rn %>rn rn rn rn rn rn rn rn rn rn rn 编号rn 姓名rn 性别rn 电话rn 邮箱rn 操作rn rn rn rn rn <% rn while(iterator.hasNext())rn rn User user = (User) iterator.next(); rn rn %>rn rn <%=user.getId() %>rn <%=user.getUsername() %>rn <%=user.getSex() %>rn <%=user.getPhone() %>rn <%=user.getEmail() %>rn 修改rn 删除rn rn rn rn <%rn rn %>rn rn 共$requestScope.pageCount 页,当前第$pageNo 页首页rn rn rn 上一页rn rn rn rn rn rn rn 下一页rn rn rn rn rn rn 尾页rn rn rn rn rn rn rn $pageNo rn rn rn rn rn rn $toPage rn rn rn rn rn rn rn rn rn rn rn rn 添加用户rn rn rnrn rn rn rn <%HibernateFactorySession.closeSession(); %>rn rn rnrn rn rn rn rn rn rn rnrnrn这个代码会报这个错:rnroot cause rnjava.lang.NumberFormatException: For input string: "pageCount"rn java.lang.NumberFormatException.forInputString(Unknown Source)rn java.lang.Integer.parseInt(Unknown Source)rn java.lang.Integer.valueOf(Unknown Source)rn org.apache.jasper.compiler.JspUtil.coerceToInt(JspUtil.java:605)rn org.apache.jasper.compiler.Generator$GenerateVisitor.convertString(Generator.java:3184)rn org.apache.jasper.compiler.Generator$GenerateVisitor.evaluateAttribute(Generator.java:3001)rn org.apache.jasper.compiler.Generator$GenerateVisitor.generateSetters(Generator.java:3106)rn org.apache.jasper.compiler.Generator$GenerateVisitor.generateCustomStart(Generator.java:2276)rn org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1768)rn org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1538)rn org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2375)rn org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2427)rn org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2433)rn org.apache.jasper.compiler.Node$Root.accept(Node.java:474)rn org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2375)rn org.apache.jasper.compiler.Generator.generate(Generator.java:3517)rn org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:250)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rn org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)rnrn求大神帮忙解决

程序出现了java.lang.NumberFormatException: For input string: ""

10-16

rt以下是代码,代码中state为int类型,name为string类型,想实现分页查询,可是一点下一页或者选到某一页就会报错,sql语句也没有写错,在数据库中都能查到,可是就是报错,请大神帮忙看看到底怎么回事rn[code=java]public void doPost(HttpServletRequest request, HttpServletResponse response)rn throws ServletException, IOException rnrn request.setCharacterEncoding("utf-8");rn response.setCharacterEncoding("utf-8");rn XmBillService service=new XmBillServiceImpl();rn int page=Integer.parseInt(request.getParameter("page"));rn String name=request.getParameter("goodsname");rn String state=request.getParameter("billstate");rn if(name==null)rn name ="";rn rn if(state==null)rn try rn rn int sum=service.findPageByGoodsName(name);rn rn Listlist=service.findByGoodsName(name, page, 5);rn int totalPage=0;rn if(sum%5==0)rn totalPage=sum/5;rn elsern totalPage=sum/5+1;rn rn request.setAttribute("list", list);rn request.setAttribute("name", name);rn request.setAttribute("state", state);rn request.setAttribute("page", page);rn request.setAttribute("totalPage", totalPage);rn request.getRequestDispatcher("admin_bill_list.jsp").forward(request, response);rn System.out.println(page+";"+name+";"+state);rn catch (SQLException e) rn rn e.printStackTrace();rn rn rn elsern try rn rn int sum=service.findPageByGoodsNameAndBillState(name,Integer.parseInt(state));rn Listlist=service.findByGoodsNameAndBillState(name, Integer.parseInt(state), page, 5);rn int totalPage=0;rn if(sum%5==0)rn totalPage=sum/5;rn elsern totalPage=sum/5+1;rn rn request.setAttribute("list", list);rn request.setAttribute("name", name);rn request.setAttribute("page", page);rn request.setAttribute("totalPage", totalPage);rn request.getRequestDispatcher("admin_bill_list.jsp").forward(request, response);rn System.out.println(page+";"+name+";"+state);rn catch (SQLException e) rn rn e.printStackTrace();rn rn rn rn [/code]

java.lang.NumberFormatException: For input string: 亟需帮助

12-20

HTTP Status 500 -rnrntype Exception reportrnrnmessagernrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexceptionrnrnorg.apache.jasper.JasperException: An exception occurred processing JSP page /front/personal/trepair_query.jsp at line 190rnrn187: rn188: rn189: rn190: $repairForm.repairTorepairIdrn191: $repairForm.repairStaffId rn192: $repairForm.repairRatern193: $repairForm.repairDaternrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)rn org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:690)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnroot causernrnjava.lang.NumberFormatException: For input string: "repairTorepairId"rn java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)rn java.lang.Integer.parseInt(Integer.java:447)rn java.lang.Integer.parseInt(Integer.java:497)rn javax.el.ArrayELResolver.coerce(ArrayELResolver.java:153)rn javax.el.ArrayELResolver.getValue(ArrayELResolver.java:45)rn javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)rn org.apache.el.parser.AstValue.getValue(AstValue.java:97)rn org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)rn org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:923)rn org.apache.jsp.front.personal.trepair_005fquery_jsp._jspService(trepair_005fquery_jsp.java:328)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)rn org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:690)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.rnrnApache Tomcat/6.0.13

java.lang.NumberFormatException: For input string: "" 如何解决

04-16

//从模型中获取数据rn OrderItemBeanForm oifrom = (OrderItemBeanForm)form; rnrn String id = org.apache.commons.lang.StringUtils.defaultString(oifrom.getId()); rn String year=org.apache.commons.lang.StringUtils.defaultString(oifrom.getYear()); rn String month=org.apache.commons.lang.StringUtils.defaultString(oifrom.getMonth()); rn String day=org.apache.commons.lang.StringUtils.defaultString(oifrom.getDay()); rnrnrn rn //转换字符格式rn rn id=new String(id.getBytes("ISO-8859-1"),"gb2312");rn year=new String(year.getBytes("ISO-8859-1"),"gb2312");rn month=new String(month.getBytes("ISO-8859-1"),"gb2312");rn day=new String(day.getBytes("ISO-8859-1"),"gb2312");rnrn long lid=new Long(Long.parseLong(id));rn Date date=new Date(Integer.parseInt(year),Integer.parseInt(month),Integer.parseInt(day));rnrn抛出异常为:java.lang.NumberFormatException: For input string: "" rnjava.lang.NumberFormatException.forInputString(NumberFormatException.java:48) rnjava.lang.Long.parseLong(Long.java:424) rnjava.lang.Long.parseLong(Long.java:461) rncom.iwtxokhtd.action.CreateOrderItemAction.execute(CreateOrderItemAction.java:53) rnorg.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) rnorg.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) rnorg.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) rnorg.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) rnjavax.servlet.http.HttpServlet.service(HttpServlet.java:710) rnjavax.servlet.http.HttpServlet.service(HttpServlet.java:803) rnrnrn53行对应为:long lid=new Long(Long.parseLong(id));rnrn

没有更多推荐了,返回首页