SDKに付属しているeBayサンプルアプリケーション(署名リダイレクト)を使用しようとしています。
アプリケーションをwebappsディレクトリにコピーし、適切な変更を加えて実行しました。
今、私はこのエラーを受け取っています。
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 16 in the generated java file
Only a type can be imported. signinredirect.Global resolves to a package
An error occurred at line: 18 in the jsp file: /credentials.jsp
Global cannot be resolved
15: String signInURL = "";
16: String ApiServerUrl = "";
17: String reqError ="";
18: String devId = Global.getProperty("devId");
19: String certId = Global.getProperty("certId");
20: String appId = Global.getProperty("appId");
21: //runame of this sample application
jspコード:
<html>
<head>
<title>
eBay signin redirection sample with new token fetch flow
</title>
</head>
<body bgcolor="#ffffff">
<%@ page import="com.ebay.sdk.*" %>
<%@ page import="com.ebay.sdk.call.*" %>
<%@ page import="signinredirect.Global" %>
<%@ page import="java.net.URLEncoder" %>
<%@ page errorPage="errorPage.jsp" %>
<%
String signInURL = "";
String ApiServerUrl = "";
String reqError ="";
String devId = Global.getProperty("devId");
String certId = Global.getProperty("certId");
String appId = Global.getProperty("appId");
//runame of this sample application
String runame = Global.getProperty("runame");
if (request.getParameter("goToSignin") != null ) {
reqError="";
int environment = Integer.parseInt(request.getParameter("EnvList"));
if (environment == 1 ) {
// Sandbox
signInURL =Global.getProperty("sandboxSignInUrl");
ApiServerUrl = Global.getProperty("sandboxAPIUrl");
} else if (environment ==2) {
// Production
signInURL = Global.getProperty("ebaySignInUrl");
ApiServerUrl = Global.getProperty("ebayAPIUrl");
}
//Get the Credentials Information
devId = request.getParameter("DevID");
if(devId.length() == 0 )
throw new SdkException("Please enter developer ID.");
appId = request.getParameter("AppID");
if( appId.length() == 0 )
throw new SdkException("Please enter application ID.");
certId = request.getParameter("CertID");
if( certId.length() == 0 )
throw new SdkException("Please enter certificate ID.");
//Get the runame
runame = request.getParameter("RuName");
if(runame.length() == 0)
throw new SdkException("Please enter runame of the sample application");
ApiContext apiContext = Global.createApiContext(devId, appId, certId, ApiServerUrl );
ApiLogging apiLogging = new ApiLogging();
apiContext.setApiLogging(apiLogging);
session.setAttribute("apicontext", apiContext );
GetSessionIDCall api = new GetSessionIDCall(apiContext);
api.setRuName(runame);
String ruParams="params="+runame +"-"+(environment==1?"Sandbox":"Production");
try {
String sessionID = api.getSessionID();
String encodedSesssionIDString =URLEncoder.encode(sessionID,"UTF-8");
session.setAttribute("sessionID", sessionID);
response.sendRedirect(response.encodeRedirectURL(signInURL + "&RuName=" + runame + "&SessID=" + encodedSesssionIDString + "&ruparams=" + ruParams));
} catch(SdkHTTPException ex) {
reqError = "Call failed: " + ex.getMessage();
} catch(Exception ex) {
reqError = ex.getMessage();
}
}
%>
JavaクラスGlobalが存在します。インポートが失敗しているようです。誰かが私が間違ったことをした可能性があることを教えてもらえますか?