我是 React 和 Express 的新手。我在端口 8080 上使用localhost:8080/site3路由创建了客户端:
import React, { Component } from 'react';
export default class Site3 extends Component {
componentDidMount() {
console.log('FETCHING');
fetch('http://localhost:3000/site3', {
method: "GET"
})
.then(res => {
res.json();
})
.then(result => {
console.log(result);
console.log('Finished fetching');
});
}
render() {
return content;
}
}
Run Code Online (Sandbox Code Playgroud)
服务器端端口 3000:
const express = require("express");
require("dotenv").config();
const app = express();
const data = [
{ id: "tt0110357", name: "The Lion King", genre: "animation" },
{ id: "tt0068646", name: "The …Run Code Online (Sandbox Code Playgroud) 我尝试运行下面的代码:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
但 IDE 向我显示错误:
Exception in thread "main" java.lang.IllegalArgumentException: PWC6309: Illegal compilerSourceVM: 12
at org.apache.jasper.JspC.setCompilerSourceVM(JspC.java:724)
at org.netbeans.modules.web.project.ant.JspC.main(JspC.java:80)
at org.netbeans.modules.web.project.ant.JspCSingle.main(JspCSingle.java:119)
F:\Code\Netbean project\Smartphone Shop\nbproject\build-impl.xml:936: Java returned: 1
BUILD FAILED (total time: 0 seconds)
Run Code Online (Sandbox Code Playgroud)
如何修复这个错误?我使用 Netbeans 11.0 和 Tomcat 9.0。