Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/369.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 服务器端渲染使用Spring引导进行响应_Java_Reactjs_Spring Boot_Thymeleaf_Server Side Rendering - Fatal编程技术网

Java 服务器端渲染使用Spring引导进行响应

Java 服务器端渲染使用Spring引导进行响应,java,reactjs,spring-boot,thymeleaf,server-side-rendering,Java,Reactjs,Spring Boot,Thymeleaf,Server Side Rendering,我正在浏览以下使用SpringBoot和React的教程。 React是否会在这里进行服务器端渲染,因为它将被渲染到Thymeleaf模板中?对于上下文,我放置了下面教程中的Thymeleaf模板和React文件代码 src/main/resources/templates/index.html <!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org"> <head lang="en"> &l

我正在浏览以下使用SpringBoot和React的教程。

React是否会在这里进行服务器端渲染,因为它将被渲染到Thymeleaf模板中?对于上下文,我放置了下面教程中的Thymeleaf模板和React文件代码

src/main/resources/templates/index.html

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head lang="en">
    <meta charset="UTF-8"/>
    <title>ReactJS + Spring Data REST</title>
    <link rel="stylesheet" href="/main.css" />
</head>

<body>

    <div id="react"></div>

    <script src="built/bundle.js"></script>

</body>
</html>

ReactJS+Spring数据REST
src/main/js/app.js-呈现代码

ReactDOM.render(
    <App />,
    document.getElementById('react')
)
ReactDOM.render(
,
document.getElementById('react')
)

在给定示例中,React未呈现在服务器端。thymeleafhtml按原样输出。如本教程所示,通过调用Spring Boot后端中的服务设置从客户端获取数据。

在给定示例中,React不会呈现为服务器端。thymeleafhtml按原样输出。如本教程所示,通过调用Spring Boot后端中的服务设置从客户端获取数据。

谢谢,我认为这是可能的情况,但不确定。谢谢,我认为这是可能的情况,但不确定。