private CruiseLogServer cruiseserver; //server接口
public CruiseLogServer getCruiseserver() {
return cruiseserver;
}
public void setCruiseserver(CruiseLogServer cruiseserver) {
this.cruiseserver = cruiseserver;
}
public String showCruiseLog() {
System.out.println("wuyu123");
int currentPage = 1; // 当前页
int maxPage = 10; // 一页有几条
if (null != page) {
currentPage = Integer.parseInt(page);
}
current = currentPage;
//debug 的时候就到了这里走不下去了 cruiseserver 是null
pagemodel = cruiseserver.findByScrollServer((currentPage - 1)* maxPage, maxPage);
return "success";
}
下面是spring
<bean id="cruiselogserver" class="com.huzhouport.cruiselog.service.impl.CruiseLogServerImpl">
<property name="dao" ref="cruiselogdao"></property>
</bean>
<bean name="cruiseLogAction" class="com.huzhouport.cruiselog.action.CruiseLogAction" >
<property name="cruiseserver" ref="cruiselogserver"></property>
</bean>
------解决方案--------------------
这样改了以后,还是 null?
------解决方案--------------------
private CruiseLogServer cruiseserver; 你这个名字应该跟配置文件里的名字是一样的。这样猜能找到。不然会是null