java.lang.NullPointerException
Struts has detected an unhandled exception:
Messages:
File: com/sterning/books/web/actions/BooksAction.java
Line number: 40
--------------------------------------------------------------------------------
Stacktraces
java.lang.NullPointerException
com.sterning.books.web.actions.BooksAction.list(BooksAction.java:40)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
package com.sterning.books.web.actions;
import java.util.Collection;
import com.sterning.books.model.Books;
import com.sterning.books.services.iface.IBooksService;
import com.sterning.commons.AbstractAction;
import com.sterning.commons.Pager;
import com.sterning.commons.PagerService;
public class BooksAction extends AbstractAction {
private IBooksService booksService;
private PagerService pagerService;
private Books book;
private Pager pager;
protected Collection availableItems;
protected String currentPage;
protected String pagerMethod;
protected String totalRows;
protected String bookId;
protected String queryName="1";
protected String queryValue="1";
protected String searchName;
protected String searchValue;
protected String queryMap;
public String list() throws Exception {
if(queryMap ==null||queryMap.equals("")){
}else{
String[] str=queryMap.split("~");
this.setQueryName(str[0]);
this.setQueryValue(str[1]);
}
//System.out.println("asd1"+this.getQueryValue());
//这里出错,网上的例子来的。。。。。: http://blog.csdn.net/zhicc/archive/2009/07/28/4386849.aspx
int totalRow=booksService.getRows(this.getQueryName(),this.getQueryValue());
pager=pagerService.getPager(this.getCurrentPage(), this.getPagerMethod(), totalRow);
this.setCurrentPage(String.valueOf(pager.getCurrentPage()));
this.setTotalRows(String.valueOf(totalRow));
availableItems=booksService.getBooks(this.getQueryName(),this.getQueryValue(),pager.getPageSize(), pager.getStartRow());
this.setQueryName(this.getQueryName());
this.setQueryValue(this.getQueryValue());
this.setSearchName(this.getQueryName());
this.setSearchValue(this.getQueryValue());
return SUCCESS;
}
相关推荐
java.lang.NullPointerException出现的几种原因及解决方案
主要介绍了java.lang.NullPointerException出现的几种原因及解决方案,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
java.lang.NullPointerException的解决方法
启动Tomcat时出现了下面的这种错误,找了很久的原因终于知道是因为tomcat和jdk要放在任意一个盘的根目录下面,而不能是放在 而不能放在某个盘根目录下的子目录里面,最好是放在C盘的根目录下面(比如C:\tomcat-6.0.20、C:\jdk1.6)!
CRASH问题:java.lang.NullPointerException
java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.widget.ImageView.setImageResource(int)’ on a null object reference 今天在家练习ListView的时候,遇到一个java.lang.NullPointerException的空指针异常,log如下: 2020-05-10 15:40:29.249 20436-20436/? E/k.myapplicatio: Unknown bits set in runtime_flag
绝望,上传文件失败。。遇到并解决java.lang.NullPointerException
解决报错:java.lang.NullPointerException 解决方法:将文件的编码方式改为utf-8即可! 截图: 修改成功后: 代码: import os import json import re def json_to_html(i,cvenum): print('正在处理:'+cvenum) head = 漏洞对应信息摘要 \ cvesummary for this cve tail = #padding-left: 320px cvesummary_context = head + i +
java.lang.NullPointerException的可能原因及处理.docx
java.lang.NullPointerException的可能原因及处理.docx


Eclipse
