更新时间:2023-11-17 23:04:46
在您的JSP(将其命名为showJson.jsp)中,您将像这样加载javascript.js和data.json:
In your JSP (lets name it showJson.jsp) you loads javascript.js and data.json like this:
<script type="text/javascript" src="javascript.js"></script>
<script type="text/javascript" src="data.json"></script>
在src
中,您直接提供文件名而没有前缀.
因此, data.json,javascript.js和您的showJson.jsp应该位于同一文件夹中.
In the src
you give the filenames directly without prefix.
Therefore the data.json, javascript.js and your showJson.jsp should be in the same folder.
glassfish 4(java ee)中的项目结构如下:
The project structure in glassfish 4 (java ee) look like this:
当文件直接位于WebContent
-文件夹中时,可以使用以下网址进行访问:
When the files are directly in WebContent
-Folder, they can be access with these urls:
但是应该先部署它们.部署基本上是在创建 Web存档文件projectName.war并将其移入特定的服务器文件夹.即:
But they should be first deployed. The deployment is basically creating an Web Archive file projectName.war and moving it in a specific server folder. i.e.:
C:\ glassfish4 \ glassfish \ domains \ domain1 \ applications \ domain1
C:\glassfish4\glassfish\domains\domain1\applications\domain1
在大多数情况下,此projectName.war将提取为:
This projectName.war will be (in most cases) extracted to:
C:\ glassfish4 \ glassfish \ domains \ domain1 \ applications \ domain1 \ projectName_war
C:\glassfish4\glassfish\domains\domain1\applications\domain1\projectName_war