开发者

AppEngine, how to use static html files

开发者 https://www.devze.com 2023-01-22 15:49 出处:网络
Please, help me, how I can use html fi开发者_Python百科les in my appengine application for Java environment (Java SDK)?

Please, help me, how I can use html fi开发者_Python百科les in my appengine application for Java environment (Java SDK)? When I open it in my browser I got error: HTTP ERROR 404 Problem accessing /myapp/. Reason: NOT_FOUND


I think it depends on what you intend to do :

If you want to serve a static page inside your app : import (or create) the html page in the folder : YourProject/war Then you can call it with a relative link in your application:

<a href = 'MyPage.html'> My link </a>


If you want to start the app with a static page, then you must declare it in : YourPRoject/war/WEB-INF/web.xml file, by adding somthing like this this :

<welcome-file-list>
   <welcome-file>sign.html</welcome-file>
</welcome-file-list>

I hope it helps !


Have you had a look through the Getting Started documentation?


I added the following to the app.yaml file and it worked for me. This declaration needs to be made right after app_version. Please note that I have placed my html files in the main directory itself.

handlers:
-   url: /(.*\.html)
    static_files: \1
    upload: (.*html)
0

精彩评论

暂无评论...
验证码 换一张
取 消