62,620
社区成员
发帖
与我相关
我的任务
分享String baseElementName = "#";
try {
baseElementName = baseElement.getText().trim();//trim()返回字符串的副本,忽略前导空白和尾部空白
} catch (Exception e) {
LOG.warn("cannot get name of current base element");
}if(baseElement.getText()!=null)是不是楼主想要的非空判断呢 } catch (IOException e) {
e.printStackTrace();
}[/quote]
异常栈 会溢出吗[/quote]e.printStackTrace(); 是打印出异常的值栈信息的。。一般捕获到了异常,程序就走异常处理的代码了,不会接着往下往下走了,你去回顾一下java的异常处理机制吧~ } catch (IOException e) {
e.printStackTrace();
}[/quote]
异常栈 会溢出吗 } catch (IOException e) {
e.printStackTrace();
}[/quote]
LOG.warn("cannot get name of current base element",e);
} catch (IOException e) {
e.printStackTrace();
}