我是 Java 新手,我正在尝试使用 Firebase 托管 Java Web 应用 https://www.firebase.com.
Problem
我的问题似乎是我的index.html
我的 Java 文件结构中不存在该文件。因此,我不能在我的firebase.json
file.
Question
- 关于如何托管 Java Web 应用程序,我不明白什么?
- java web 应用程序有吗
index.html
部署时文件(显然,Firebase 需要)?
- 我该如何成功托管我的 Java Web 应用程序?
Firebase 托管设置说明:
设置与安装
首次安装
您应该安装 Node.js(您不需要运行 Node,只需安装它即可)
$npm install -g firebase-tools
or $sudo npm install -g firebase-tools
更新之前安装的 Firebase 工具
$npm update -g firebase-tools
or $sudo npm update -g firebase-tools
部署您的网站
-
$cd
进入您的网站目录并运行$firebase init
- 然后部署您的网站
$firebase deploy
我的错误信息:
当我按照托管说明并浏览到https://my-example-firebase.firebaseio.com/
我收到以下错误消息。
找不到网页
该文件不存在并且没有index.html
在当前目录中找到或404.html
在根目录中。
为什么我会看到这个?
您可能为您的应用程序部署了错误的目录。检查你的firebase.json
并确保公共目录指向包含index.html
file.
我的 firebase.json
{
"firebase": "my-example-firebase",
"public": ".",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
如你所见,我的firebase.json
文件假设我的root
目录是我的public
目录。然而,这不包含index.html
文件。因此,这就是我认为我所缺少的关于 Java Web 应用程序和文件结构的结构。没有index.html
file.
我的文件结构
(由 Eclipse 搭建)(部分)如下所示。
root
Deployment descriptor: myproject
JAX-WS Web Services
Java Resources
Javascript Resources
build
src
com.example.myproject
MyprojectUI.java
MyprojectUI
test
libraries
WebContent
ivy.xml
ivysettings.xml
我全部看完了,没有index.html
文件。我想知道是否需要将某些内容编译为 HTML 和 Javascript?然后提供该文件?我迷失了,很困惑。请有人帮忙。