`
zjx2388
  • 浏览: 1342914 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

if(!order_address.equals("")&&order_address != null){

    博客分类:
  • J2SE
阅读更多

008-7-7 14:09:24 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet customerInfoManagerment threw exception java.lang.NullPointerException at servlet.CustomerInfoManagerment.service(CustomerInfoManagerment.java:72) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source)

这个是今天在tomcat下报的一个错误

我找了好一会才弄清“罪魁祸首”

出错代码:

if(!order_address.equals("")&&order_address != null){

````

}

改正后的代码:

if(order_address != null&&!order_address.equals("")){

````

}

总节;

以后判断都得先判断是否为空对象即null,再判断是否为空值""

分享到:
评论

相关推荐

    Hibernate学习资料(离线查询)

    Restrictions.isNull("address"))) .add(Restrictions.between("age", new Integer(22), new Integer(24))) .list(); ``` 这里同时使用了`like`和`isNull`条件,并通过`between`指定年龄范围。 #### 排序 对于...

    ZendFramework中文文档

    10.4.7. ORDER BY 分句 10.4.8. 通过总数和偏移量进行LIMIT限制 10.4.9. 通过页数和总数进行LIMIT限制 10.5. Zend_Db_Table 10.5.1. 简介 10.5.2. 开始 10.5.3. 表名和主键 10.5.4. 插入数据 10.5.5. 更新...

    一个适合新手学习的电商项目

    if (redis == null || "".equals(redis) || "[]".equals(redis)) { jedisClient.set(tbUser.getId().toString(), JsonUtils.objectToJson(cookie)); List<CartItem> list = JsonUtils.jsonToList(json, CartItem...

    Java邮件开发Fundamentals of the JavaMail API

    With the JavaMail API, in order to communicate with a server, you need a provider for a protocol. The creation of protocol-specific providers is not covered in this course because Sun provides a ...

    LINQ TO OBJECTS USING C# 4.0

    if (source == null) throw new ArgumentNullException(nameof(source)); return source.Average(person => person.Age); } ``` #### 6. **使用 C# 4.0 的语言增强功能** - **动态特性**: - C# 4.0 引入...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    We can declare data members of type Foo* or Foo&. We can declare (but not define) functions with arguments, and/or return values, of type Foo. (One exception is if an argument Foo or const Foo& has a...

    Spring Data JPA 简单查询--方法定义规则(详解)

    3. `Is` 或 `Equals`:用于判断属性是否等于某个值。 4. `Between`:用于查询属性值在两个值之间。 5. `LessThan`:查询属性值小于指定值。 6. `LessThanEqual`:查询属性值小于或等于指定值。 7. `GreaterThan`:...

Global site tag (gtag.js) - Google Analytics