【问题标题】:jsp - whats wrong with my import of a jar file?jsp - 我的 jar 文件导入有什么问题?
【发布时间】:2018-08-01 16:00:39
【问题描述】:

我正在尝试将 Simplify Commerce 支付系统集成到我的项目中 但我似乎无法正确处理。

这是问题之一:

<%@ page import="com.simplify.package"%>
and I got this error after mousing over the red wavy line:  

Syntax error on token "package", * expected
 I then added a `*` like this `com.simplify.package.*`  

 And I got this: 
 `Syntax error on token "package", Identifier expected`

 I already added all the .jar files to the `WEB-INF/lib` folder.
  What seems to be the problem?

我正在尝试导入jar文件的jsp:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="com.simplify.package.*" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Pay Now!</title>
</head>
<body>
<%
    PaymentsApi.PUBLIC_KEY =  "";
    PaymentsApi.PRIVATE_KEY = "";

    CardToken cardToken = CardToken.create(new PaymentsMap()
        .set("card.addressCity", "OFallon")
        .set("card.addressState", "MO")
        .set("card.cvc", "123")
        .set("card.expMonth", 11)
        .set("card.expYear", 19)
        .set("card.number", "5105105105105100")
);

System.out.println(cardToken);
%>

PaymentsApiCardToken下面有红色的路线

【问题讨论】:

  • 在你的jsp中这行之前,你能在这里显示那个代码
  • 这是&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%&gt; 行之前的代码,这是第一行。 @Ashish Singh
  • 您是否检查过结构为 'com.simplify.package' 的包是否存在?
  • 我该如何检查? @Ashish Singh
  • 通过查看为 jar 文件提供的文档。也许在 win-rar 中打开文件并查看包结构是否存在。很有可能没有这样的包结构

标签: java jsp jar e-commerce mastercard


【解决方案1】:

解压jar文件查看包结构即可解决。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-07-29
    • 2021-10-01
    • 2020-08-09
    • 2013-03-18
    • 2012-05-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多