Java Paypal Express签出中出现空指针异常,并给出空白页
在Express Checkout中,显示总计,但不显示产品名称和其他详细信息 并给出错误NUll指针异常并添加“=”然后显示为空Java Paypal Express签出中出现空指针异常,并给出空白页,java,jsp,paypal,Java,Jsp,Paypal,在Express Checkout中,显示总计,但不显示产品名称和其他详细信息 并给出错误NUll指针异常并添加“=”然后显示为空 public HashMap CallShortcutExpressCheckout(String item, String paymentAmount, String currencyCodeType, String paymentType, String returnURL
public HashMap CallShortcutExpressCheckout(String item, String paymentAmount, String currencyCodeType, String paymentType,
String returnURL, String cancelURL,
HttpSession session)
{
session.setAttribute("paymentType", paymentType);
session.setAttribute("currencyCodeType", currencyCodeType);
/*
Construct the parameter string that describes the PayPal payment
the varialbes were set in the web form, and the resulting string
is stored in $nvpstr
*/
String nvpstr = "&PAYMENTREQUEST_0_AMT=" + paymentAmount + "&PAYMENTREQUEST_0_PAYMENTACTION=" + paymentType + "&ReturnUrl=" + URLEncoder.encode( returnURL ) + "&CANCELURL=" + URLEncoder.encode( cancelURL ) + "&PAYMENTREQUEST_0_CURRENCYCODE=" + currencyCodeType;
nvpstr=nvpstr+ "&L_PAYMENTREQUEST_0_NAME0="+item;
nvpstr=nvpstr+ "&L_PAYMENTREQUEST_0_QTY0="+item;
nvpstr=nvpstr+ "&L_PAYMENTREQUEST_0_AMT0="+item;
System.out.println("item="+item);
/*
Make the call to PayPal to get the Express Checkout token
If the API call succeded, then redirect the buyer to PayPal
to begin to authorize payment. If an error occured, show the
resulting errors
*/
System.out.println("amountpay="+paymentAmount);
HashMap nvp = httpcall("SetExpressCheckout", nvpstr);
String strAck = nvp.get("ACK").toString();
if(strAck !=null && strAck.equalsIgnoreCase("Success"))
{
session.setAttribute("TOKEN", nvp.get("TOKEN").toString());
}
return nvp;
}
并显示blank expresscheckout.jsp显示堆栈跟踪:StandardWrapperValve[jsp]:Servlet.service for Servlet jsp在org.apache.jsp.expresscheckout_jsp.\u jsp服务expresscheckout_jsp.java:520在org.apache.jasper.runtime.HttpJspBase.serviceHttpJspBase.java:111在javax.Servlet.http.HttpServlet.serviceHttpServlet.java:790在org.apache.jasper.servlet.JspServletWrapper.serviceJspServletWrapper.java:411在org.apache.jasper.servlet.JspServlet.serviceJspFileJspServlet.java:473我想问题出在jsp中。