编程语言
首页 > 编程语言> > 关于托管Java Web应用程序,我不了解什么?

关于托管Java Web应用程序,我不了解什么?

作者:互联网

我是Java的新手,正在尝试host a Java web app using Firebase.

问题

我的问题似乎是我的index.html文件在我的Java文件结构中不存在.因此,我不能在firebase.json文件中“指向它”.

>我对如何托管Java Web应用程序不了解?
> Java Web应用程序在部署时是否具有index.html文件(显然,Firebase要求)?
>如何成功托管Java Web应用程序?

Firebase托管设置说明:

SETUP & INSTALLATION

First Time Installation

You should have Node.js installed (you do not need to run Node, just have it installed)

$npm install -g firebase-tools or $sudo npm install -g firebase-tools

Updating Previously Installed Firebase Tools

$npm update -g firebase-tools or $sudo npm update -g firebase-tools

DEPLOY YOUR WEBSITE

  1. $cd into your website directory and run $firebase init
  2. Then deploy your website with $firebase deploy

我的错误讯息:

当我按照托管说明并浏览到https://my-example-firebase.firebaseio.com/时,出现以下错误消息.

Page Not Found

This file does not exist and there was no index.html found in the current directory or 404.html in the root directory.

Why am I seeing this?

You may have deployed the wrong directory for your application. Check your firebase.json and make sure the public directory is pointing to a directory that contains an index.html file.

我的firebase.json

{
  "firebase": "my-example-firebase",
  "public": ".",
  "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
  ]
}

如您所见,我的firebase.json文件假定我的根目录是我的公共目录.但是,该文件不包含index.html文件.因此,这就是我认为Java Web应用程序的结构和文件结构所缺少的.没有index.html文件.

我的档案结构

(由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?然后提供那个文件?我迷路了.请有人帮忙.

解决方法:

Firebase托管仅用于托管静态资产,因此可以托管HTML,JavaScript,CSS,图像等.

Firebase托管不能用于运行Java Web应用程序.

标签:java,firebase,node-js,web-applications,web-hosting
来源: https://codeday.me/bug/20191011/1893082.html