Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.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
在GAE java标准环境中配置路由_Java_Eclipse_Angular_Google App Engine - Fatal编程技术网

在GAE java标准环境中配置路由

在GAE java标准环境中配置路由,java,eclipse,angular,google-app-engine,Java,Eclipse,Angular,Google App Engine,我在java标准环境中有一个GAE应用程序用于后端,angular 4.0用于前端 该应用程序在本地运行良好,但部署后,在刷新或尝试键入所需页面的url时,我会收到404错误 我知道我必须定义一个路由回退,如中所述,以便将每个未知请求重定向到我的index.html 我从许多stackoverflow GAE appengine python问题中了解到,解决方案包括配置app.yaml文件 好吧,但是怎么做呢?在appengine标准环境中,app.yaml文件在staging文件夹中自动生成

我在java标准环境中有一个GAE应用程序用于后端,angular 4.0用于前端

该应用程序在本地运行良好,但部署后,在刷新或尝试键入所需页面的url时,我会收到404错误

我知道我必须定义一个路由回退,如中所述,以便将每个未知请求重定向到我的index.html

我从许多stackoverflow GAE appengine python问题中了解到,解决方案包括配置app.yaml文件

好吧,但是怎么做呢?在appengine标准环境中,app.yaml文件在staging文件夹中自动生成,如下所示,但当我使用googlepluginforeclipse部署时,一切都发生在后台,我无法访问它

runtime: java7
inbound_services:
- warmup
derived_file_type:
- java_precompiled
threadsafe: True
auto_id_policy: default
api_version: '1.0'
handlers:
- url: (/.*/)
static_files: __static__\1index.html
upload: __NOT_USED__
require_matching_file: True
login: optional
secure: optional
- url: (/)
static_files: __static__\1index.html
upload: __NOT_USED__
require_matching_file: True
login: optional
secure: optional
- url: (/.*)
static_files: __static__\1
upload: __NOT_USED__
require_matching_file: True
login: optional
secure: optional
- url: /.*
script: unused
login: optional
secure: optional
有人能告诉我在appengine java标准环境中部署之前是否有方法编辑app.yaml文件吗。
最近也发布了类似的消息,但目前没有回应。

我认为您将浏览器端的角度路由与服务器端URL路由混淆了,后者由
web.xml
描述

我猜您的
web.xml
缺少一个用于加载
index.html
的欢迎文件。例如,这里有一个简单的
web.xml
,它应该可以做到这一点:

<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
 <welcome-file-list>
   <welcome-file>index.html</welcome-file>
 </welcome-file-list>
</web-app>

index.html

标准java环境不使用
app.yaml
,请参见hi-Dan,谢谢您的回答。我知道医生,我已经读了十分之一遍来寻找我的问题。事实是:当我使用GoogleCloudforEclipse插件部署时,创建了app.yaml(以及index.yaml)文件。我的问题是:如何使角度路由在GAE java标准环境中工作?