无法在项目中包含外部文件 [英] unable to include external files in a project

查看:68
本文介绍了无法在项目中包含外部文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在IntelliJ目录中的P中创建了默认的播放应用程序.我已经用自己的html代码覆盖了默认的index.scala.html. html代码引用目录P之外的某些cssjs文件.为了包括这些外部文件,我使用项目配置设置添加了这些文件的目录.

I have created the default play application in IntelliJ in directory P. I have over-written the default index.scala.html with my own html code. The html code refers to some css and js files which are outside the directory P. To include these external files, I added the directory of these files using project configuration settings.

我的网页无法正确加载,因为服务器为cssjs文件返回了404.我在做什么错了?

My webpage doesn't load properly as the server returns 404 for the css and js files. What am I doing wrong?

推荐答案

使用项目结构添加目录时,您只会说:

When you added your directory using project structure, you only say:

嘿,IDEA,请考虑此文件夹是我项目的一部分,请考虑 它的内容源代码,并在我打开项目时显示.

Hey, IDEA, please consider this folder part of my project, consider its contents source code and display it when I open my project.

但是,当您部署或运行​​应用程序时,仅将常规文件夹部署到服务器,其中包含可供客户端访问的资源.

However, when you deploy or run your app, you only deploy the usual folders to the server, which contain the resources which will be available for clients to access.

外部目录不是这些目录的一部分,因此将不会被部署.

The external directory is not part of these directories and will not be deployed.

您可以做的是在部署应用程序之前,从外部目录复制文件,这是构建过程的一部分.

What you can do is to copy the file from the external directory as a part of your build process before deploying the application.

此处提供详细答案:什么是intellij的播放应用程序的构建过程

这篇关于无法在项目中包含外部文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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