我不知道托管一个Java Web应用程序? [英] What am I not understanding about hosting a Java web app?

查看:171
本文介绍了我不知道托管一个Java Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java新手,我正尝试使用Firebase托管Java网络应用



问题



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



问题




  1. 我不了解如何托管Java Web应用程序?

  2. code> index.html 文件(显然,Firebase要求)?
  3. 如何成功托管我的Java Web b


    Firebase托管设置说明:




  4. b $ b


    SETUP&安装

    首次安装

    您应该安装Node.js不需要运行Node,只要安装它即可)



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


    $ b 更新以前安装的Firebase工具 p>

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



    部署您的网站
    $ b


    1. $ cd 放入您的网站目录并运行 $ firebase init

    2. $ firebase deploy







    我的错误信息:



    当我按照托管指令浏览 https:// my-example- firebase.firebaseio.com / 我收到以下错误讯息。


    未找到页面



    此文件不存在且没有<$ c $在当前目录中找到c> index.html 或在根目录下找到 404.html

    为什么我看到这个? 您可能已经为您的应用程序部署了错误的目录。检查你的 firebase.json 并确保公共目录指向一个包含 index.html 文件的目录。







    我的firebase.json



      {
    firebase:my-example-firebase,
    public:。,
    ignore:[
    firebase.json,
    ** /。*,
    ** / node_modules / **

    }

    正如您所看到的,我的 firebase.json code> root 目录是我的 public 目录。但是,它不包含 index.html 文件。因此,这是我认为我缺少Java Web应用程序和文件结构的结构。有没有 index.html 文件。






    我的文件结构



    (如Eclipse搭建的脚本)(部分)看起来像下面这样:

      root 
    部署描述符:myproject
    JAX-WS Web服务
    Java资源
    Javascript资源
    编译
    src
    com.example .myproject
    MyprojectUI.java
    MyprojectUI
    test
    libraries
    WebContent
    ivy.xml
    ivysettings.xml

    我查看了所有内容,没有 index.html 文件。我想知道如果我需要也许编译成HTML和Javascript的东西?然后提供该文件?我迷茫和困惑。请有人帮忙。 / p>

    Firebase托管无法用于运行您的Java Web应用程序。


    I am new to Java and I am trying to host a Java web app using Firebase.

    Problem

    My problem appears to be that my index.html file does not exist in my Java file structure. Therefore, I can not "point to it" in my firebase.json file.

    Question

    1. What am I not understanding about how to host a Java web app?
    2. Do java web apps have an index.html file when they are deployed (which, apparently, Firebase requires)?
    3. What can I do to successfully host my Java web app?


    Firebase hosting setup instructions:

    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


    My error message:

    When I follow the hosting instructions and browse to https://my-example-firebase.firebaseio.com/ I get the following error message.

    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.


    My firebase.json

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

    As you can see, my firebase.json file assumes my root directory is my public directory. However, that does not contain an index.html file. Therefore, this is what I think I am missing about the structure of a Java web app and file structure. There IS NO index.html file.


    My file structure

    (as scaffolded by Eclipse) (partially) looks like the following.

    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
    

    I looked all through it and there is no index.html file. I'm wondering if I need to maybe compile something into HTML and Javascript? Then serve that file? I'm lost and confused. Please somebody help.

    解决方案

    Firebase Hosting is for hosting static assets only, so HTML, JavaScript, CSS, images, etc.

    Firebase Hosting cannot be used to run your Java web application.

    这篇关于我不知道托管一个Java Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆