package com.digione.web.action.admin.aftersales;import java.io.PrintWriter;
import java.sql.Timestamp;
import java.util.Date;import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.ResultPath;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.rest.DefaultHttpHeaders;
import org.apache.struts2.rest.HttpHeaders;import com.entity.sale.FactorySaleoutlet;
import com.exception.RefundPercentageException;
import com.exception.ServiceLevelException;
import com.services.sale.aftersales.FactorySaleoutletServerImpl;
import com.web.action.admin.AdminActionBase;
@Namespace(value = "/admin/aftersales")
@Results( { @Result(name = "success", type = "redirectAction", params = {"actionName", "factorysaleoutlet" }) })
@ResultPath(value = "/webpages")
@InterceptorRefs( { @InterceptorRef("checkRightOfAdminStack") })
public class FactorysaleoutletAction extends AdminActionBase{ private Integer dictId1;
// 品牌字典
private Integer brandDict;
private Integer areaDict;
private Integer cityDict;
private String companyname;
private String contactname;
private String contactphone;
private String re;
private Integer inputUser;
private Timestamp inputTime;
private Integer inputuserId;
public Integer getInputuserId() {
return inputuserId;
}
public void setInputuserId(Integer inputuserId) {
this.inputuserId = inputuserId;
}
public Integer getDictId1() {
return dictId1;
}
public void setDictId1(Integer dictId1) {
this.dictId1 = dictId1;
}
public Integer getBrandDict() {
return brandDict;
}
public void setBrandDict(Integer brandDict) {
this.brandDict = brandDict;
}
public Integer getAreaDict() {
return areaDict;
}
public void setAreaDict(Integer areaDict) {
this.areaDict = areaDict;
}
public Integer getCityDict() {
return cityDict;
}
public void setCityDict(Integer cityDict) {
this.cityDict = cityDict;
}
public String getCompanyname() {
return companyname;
}
public void setCompanyname(String companyname) {
this.companyname = companyname;
}
public String getContactname() {
return contactname;
}
public void setContactname(String contactname) {
this.contactname = contactname;
}
public String getContactphone() {
return contactphone;
}
public void setContactphone(String contactphone) {
this.contactphone = contactphone;
}
public String getRe() {
return re;
}
public void setRe(String re) {
this.re = re;
}
public Integer getInputUser() {
return inputUser;
}
public void setInputUser(Integer inputUser) {
this.inputUser = inputUser;
}
public Timestamp getInputTime() {
return inputTime;
}
public void setInputTime(Timestamp inputTime) {
this.inputTime = inputTime;
}
//
public HttpHeaders index() {
return new DefaultHttpHeaders("index").disableCaching();
// return "index";
}
public HttpHeaders create(){
if(submitFrom == null || submitFrom == 1){
return index();
} else if(submitFrom == 2){
PrintWriter writer = super.getWriter();
try {
FactorySaleoutlet factorysaleoutlet=new FactorySaleoutlet();
// Date date = new Date();
// Timestamp nousedate = new Timestamp(date.getTime());
//
factorysaleoutlet.setDictId1(dictId1);
// factorysaleoutlet.setBrandDict(this.getBrandDict());
// factorysaleoutlet.setCityDict(this.getCityDict());
// factorysaleoutlet.setAreaDict(this.getAreaDict());
factorysaleoutlet.setCompanyname(companyname);
factorysaleoutlet.setContactname(contactname);
factorysaleoutlet.setContactphone(contactphone);
factorysaleoutlet.setInputTime(inputTime);
super.getServiceFactory().getFactorySaleoutletServer().creatFactorySaleoutlet(factorysaleoutlet); //空指针异常位置所在
}catch (Exception e) {
super.log.error(e.getMessage(),e);
}finally{
writer.flush();
writer.close();
writer = null;
}
}
return null;
}
public HttpHeaders show(){
return new DefaultHttpHeaders("editnew").disableCaching();
}
}2011-09-19 12:19:58 [com.web.action.admin.aftersales.FactorysaleoutletAction.create(FactorysaleoutletAction.java:150)]
java.lang.NullPointerException
at com.web.action.admin.aftersales.FactorysaleoutletAction.create(FactorysaleoutletAction.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
import java.sql.Timestamp;
import java.util.Date;import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.ResultPath;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.rest.DefaultHttpHeaders;
import org.apache.struts2.rest.HttpHeaders;import com.entity.sale.FactorySaleoutlet;
import com.exception.RefundPercentageException;
import com.exception.ServiceLevelException;
import com.services.sale.aftersales.FactorySaleoutletServerImpl;
import com.web.action.admin.AdminActionBase;
@Namespace(value = "/admin/aftersales")
@Results( { @Result(name = "success", type = "redirectAction", params = {"actionName", "factorysaleoutlet" }) })
@ResultPath(value = "/webpages")
@InterceptorRefs( { @InterceptorRef("checkRightOfAdminStack") })
public class FactorysaleoutletAction extends AdminActionBase{ private Integer dictId1;
// 品牌字典
private Integer brandDict;
private Integer areaDict;
private Integer cityDict;
private String companyname;
private String contactname;
private String contactphone;
private String re;
private Integer inputUser;
private Timestamp inputTime;
private Integer inputuserId;
public Integer getInputuserId() {
return inputuserId;
}
public void setInputuserId(Integer inputuserId) {
this.inputuserId = inputuserId;
}
public Integer getDictId1() {
return dictId1;
}
public void setDictId1(Integer dictId1) {
this.dictId1 = dictId1;
}
public Integer getBrandDict() {
return brandDict;
}
public void setBrandDict(Integer brandDict) {
this.brandDict = brandDict;
}
public Integer getAreaDict() {
return areaDict;
}
public void setAreaDict(Integer areaDict) {
this.areaDict = areaDict;
}
public Integer getCityDict() {
return cityDict;
}
public void setCityDict(Integer cityDict) {
this.cityDict = cityDict;
}
public String getCompanyname() {
return companyname;
}
public void setCompanyname(String companyname) {
this.companyname = companyname;
}
public String getContactname() {
return contactname;
}
public void setContactname(String contactname) {
this.contactname = contactname;
}
public String getContactphone() {
return contactphone;
}
public void setContactphone(String contactphone) {
this.contactphone = contactphone;
}
public String getRe() {
return re;
}
public void setRe(String re) {
this.re = re;
}
public Integer getInputUser() {
return inputUser;
}
public void setInputUser(Integer inputUser) {
this.inputUser = inputUser;
}
public Timestamp getInputTime() {
return inputTime;
}
public void setInputTime(Timestamp inputTime) {
this.inputTime = inputTime;
}
//
public HttpHeaders index() {
return new DefaultHttpHeaders("index").disableCaching();
// return "index";
}
public HttpHeaders create(){
if(submitFrom == null || submitFrom == 1){
return index();
} else if(submitFrom == 2){
PrintWriter writer = super.getWriter();
try {
FactorySaleoutlet factorysaleoutlet=new FactorySaleoutlet();
// Date date = new Date();
// Timestamp nousedate = new Timestamp(date.getTime());
//
factorysaleoutlet.setDictId1(dictId1);
// factorysaleoutlet.setBrandDict(this.getBrandDict());
// factorysaleoutlet.setCityDict(this.getCityDict());
// factorysaleoutlet.setAreaDict(this.getAreaDict());
factorysaleoutlet.setCompanyname(companyname);
factorysaleoutlet.setContactname(contactname);
factorysaleoutlet.setContactphone(contactphone);
factorysaleoutlet.setInputTime(inputTime);
super.getServiceFactory().getFactorySaleoutletServer().creatFactorySaleoutlet(factorysaleoutlet); //空指针异常位置所在
}catch (Exception e) {
super.log.error(e.getMessage(),e);
}finally{
writer.flush();
writer.close();
writer = null;
}
}
return null;
}
public HttpHeaders show(){
return new DefaultHttpHeaders("editnew").disableCaching();
}
}2011-09-19 12:19:58 [com.web.action.admin.aftersales.FactorysaleoutletAction.create(FactorysaleoutletAction.java:150)]
java.lang.NullPointerException
at com.web.action.admin.aftersales.FactorysaleoutletAction.create(FactorysaleoutletAction.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
解决方案 »
- is exceeding the 65535 bytes limit求解?
- 关于java内存泄露的问题
- CruiseControl持续集成中的问题svn update --non-interactive error=2
- <property name="hbm2ddl.auto">update</property>的问题
- jsp表单验证失败,求各位高手解答
- 怎么获取上传图片的路径
- 求struts 中用Filter实现每个页面的登录验证的代码--高分求解
- 关于DWR 和 Struts 结合的问题
- 高手请进:这个系统怎么做?简单点的,不需要GUI,只需要在控制台操作就行!
- 为什么我布署到weblogic7.0的web程序在局域网上不能访问呢?
- 关于java使用itext生成pdf的几个问题
- java 调用C#写的webservice接口,接口返回值为String[]
在调用这二个getXXX方法时作空判断。
并检查上面这个方法体中是否存在空指针隐患的代码。