首先在pom文件中添加依赖
<!-- 添加 graalvm js-->
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
<version>20.2.0</version>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<version>20.2.0</version>
</dependency>
集成依赖后我们就可以在项目中使用相关的功能 controller内容
import com.exam.service.JavaScriptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class JsController {
@Autowired
private JavaS

最低0.47元/天 解锁文章
4876

被折叠的 条评论
为什么被折叠?



