NumberFormatException是什么东西啊?

asiaec 2003-03-28 01:28:45
帮我猜一下是什么问题吧!


java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:394)
at java.lang.Integer.parseInt(Integer.java:476)
at com.jetech.rpms.system.util.RightUtil.getUnit(RightUtil.java:169)
at com.jetech.rpms.system.util.RightUtil.searchRight(RightUtil.java:94)
at com.jetech.rpms.system.util.RightUtil.initRightInfo(RightUtil.java:46
)
...全文
333 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
skysaint 2003-03-28
  • 打赏
  • 举报
回复
用try和catch捕获,再处理异常
hanty 2003-03-28
  • 打赏
  • 举报
回复
先判断是否为空,再格式数字类型
tangqiuzheng 2003-03-28
  • 打赏
  • 举报
回复
我请问龙津啤酒,能不能告诉我怎么阅读那些异常信息:(即怎么根据那些异常代号查找原因呀?)
xgchar 2003-03-28
  • 打赏
  • 举报
回复
Thrown to indicate that the application has attempted to convert a string to one of the numeric types, but that the string does not have the appropriate format.


NumberFormatException
public NumberFormatException()



Constructs a NumberFormatException with no detail message.

NumberFormatException
public NumberFormatException(String s)

Constructs a NumberFormatException with the specified detail message.

Parameters:
s - the detail message.
comnetorgcn 2003-03-28
  • 打赏
  • 举报
回复
方法Integer.parseInt(String a),当a为空或者不含有数字时可能会报这样的错
asiaec 2003-03-28
  • 打赏
  • 举报
回复
request.setAttribute("pagectl",pageCtl);
request.setAttribute("personlist",col);
return mapping.findForward("success");
这是一个已经集成了聊天发送文字表情和语音功能的输入模块 无需再写任何代码 自己写的 5分绝对值 使用方法: 第一步:文件怎么放 把三个文件夹里的东西分别放在制定的地方就行 第二步:布局到我的activity中 把它当成一个普通的view就好 放在你想放的位置 以下是我在自己项目里放的位置 放在布局的最低端 <com example defined SendMassageRelativeLayout android:id "@+id rl bottom" android:layout width "fill parent" android:layout height "wrap content" android:layout alignParentBottom "true" android:background "#aaa" > 第三步:怎么用该控件实现发送文字表情和语音 首先 在activity中获得该SendMassageRelativeLayout 并设置两个参数 第一个是语音的录音要放的文件夹路径(文件夹要在activity中建好) 通过SendMassageRelativeLayout对象 SetRootPath String path 设置 第二个是对象SendMessageListener对象 这个对象是一个自定义的接口 要在activity中实现 通过SendMassageRelativeLayout对象 SetSendMessageListener this ;设置 其中this是因为该activity实现了接口 也可以自定义一个类来实现接口 然后在SendMessageListener接口的两个函数中实现语音与 普通文字表情的发送代码就行了 public void getAndSendMessage String str 是发送文字与表情的 点击发送时会调用这个方法 表情已经转变为字符串 str就是要发送的内容 至于要发到哪怎么发自己编写 显示的时候还要解析一下 分离出表情 下面说解析过程 文件中提供的一个类ExpressionUtil java就是解析的工具类 只需要在设置显示的TextView内容时用以下代码就行 String message; 消息具体内容 String zhengze "f0[0 9]{2}|f10[0 7]"; 正则表达式 用 try { SpannableString spannableString ExpressionUtil getExpressionString context message zhengze ; myTextView setText spannableString ; } catch NumberFormatException e { e printStackTrace ; } catch SecurityException e { e printStackTrace ; } catch IllegalArgumentException e { e printStackTrace ; } 语音的发送 语音发送的时候会执行实现接口中的public void getAndSendVoice String path int time 方法path是录制的语音在本地的绝对路径 time是语音的时长 秒为单位 至于接下来是要通过网络发送出去还是播放 自己实现ok了 总之很简单方便 表情输入 文字输入 录音 以及这些功能的切换都已经在内部实现 不需要任何代码 ">这是一个已经集成了聊天发送文字表情和语音功能的输入模块 无需再写任何代码 自己写的 5分绝对值 使用方法: 第一步:文件怎么放 把三个文件夹里的东西分别放在制定的地方就行 第二步:布局到我的activity中 [更多]

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧