java web没有APP流行,“这里还没有什么”在Azure上部署Java Web App之后

I have a web app I want to deploy on Azure. I followed the recommended instructions and deployed my app, and according to the Azure portal, everything is working just fine. However, when I visit the base URL my app should reside in, I see a page that says the following:

This Java based web application has been successfully created

There's nothing here yet, but Microsoft Azure makes it simple to

publish content with GIT and FTP

Also when I visit any one of the endpoints (in this case, the /live endpoint) my app should have, I always see a page with the following message:

HTTP ERROR 404

Problem accessing /live. Reason:

Not Found

Powered by Jetty:// 9.3.13.v20161014

When I look at the directories on the machine, everything seems to be in place. All my files are inside wwwroot. However, there's another directory named webapp under wwwroot and inside it is another directory named ROOT with two files: index.jsp and background.png. index.jsp is the page that shows the aforementioned "There's nothing here yet" message.

I'm using Bitbucket as my source control provider and I use jetty to run my web app. I'm also using javalite as the library to manage my server and different endpoints.

解决方案

You'll need to put your stuff under wwwroot/webapps/ROOT/, or package as ROOT.war and drop that under wwwroot/webapps - it will get picked up and extracted automagically:

wwwroot

└── webapps

└── ROOT

├── about.jsp

├── Content

│   ├── favicon.ico

│   └── Site.css

├── Images

│   ├── banner_coffee.png

├── index.jsp

├── META-INF

│   ├── context.xml

│   └── MANIFEST.MF

├── orderconfirmation.jsp

├── placeorder.jsp

├── Scripts

│   ├── jquery-1.7.1.min.js

└── WEB-INF

├── classes

├── lib

├── log4j.properties

└── web.xml

The main thing in the repo is a webapps folder with ROOT.war. The Tomcat/Jetty server in App Service will look inside this folder for web apps to host.

ROOT.war represents the default web app (at the site root). Any WAR file that's otherwise named represents a web app accessbile at ~/.

Clearing things up

If your application sits in wwwroot/webapps/CoffeeShop/, then you'll access it at http://{site}.azurewebsites.net/CoffeeShop/.

If your application sits in wwwroot/webapps/ROOT/, then you'll access it at http://{site}.azurewebsites.net/.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值