我在使用谷歌应用引擎部署的网站上找到我的MailDispatcherServlet
java文件时遇到问题。这是一个单页的网站,问题是在contact me
形式,我点击提交浏览器的那一刻说它无法从Java Mail API找到我的servlet和我的逻辑。我认为问题出在app.yaml
文件中。如何在我的java项目中找到我的Servlet和EJB文件的路径? BTW我的项目在使用Glassfish服务器的本地机器上正常工作。
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
static_files: website/index.html
upload: website/index.html
- url: /
static_dir: website
考虑到您使用的是app.yaml文件,我相信您正在使用App Engine Flexible环境。您需要将文件更改为更像这样[1],因为您的文件是为Python应用程序设置的。
您可以在此处找到App Engine灵活应用程序的示例[2]以获取更多指导。
如果您使用的是App Engine Standard环境,则根本不需要app.yaml。您可以在此处关注App Engine Standard上的示例应用程序[3]。
[1] App Engine灵活的Java应用程序上的App.yaml文件:https://github.com/GoogleCloudPlatform/getting-started-java/blob/master/bookshelf/2-structured-data/src/main/appengine/app.yaml
[2] App Engine灵活文档的书架教程:https://cloud.google.com/java/getting-started/tutorial-app
[3] App Engine标准文档的留言板教程:https://cloud.google.com/appengine/docs/standard/java/building-app/