java - IDEA中jsp页面如何访问webapp下的资源
ringa_lee
ringa_lee 2017-04-18 10:16:49
0
6
855

目录结构如图,我在jsp里面

<script type="text/javascript" src="easyui/js/jquery.easyui.min.js"></script>

引用不到这个js文件

请问应该怎么引入

这样访问仍然不行

ringa_lee
ringa_lee

ringa_lee

reply all(6)
刘奇

Problem solved
There are no static resources in SpringMVC

PHPzhong

Is yours unable to be linked in IDEA or something? I also encountered a similar problem:



Waiting for expert help to answer

伊谢尔伦
<link rel="stylesheet" href="${pageContext.request.contextPath}/templates/style/main.css" />
阿神

You can write it as an absolute address or a complete URL. Also check whether the web container you publish should have a project name.
So unified management of static resources is a good way. Pictures/js/css should be placed in a certain folder Use nginx to configure static resources.

洪涛

前面加上 /

<script type="text/javascript" src="/static/js/system/index.js"></script>

Peter_Zhu

The problem I am encountering now is that there is no problem in the idea, but when deployed to the server, one jsp cannot find the corresponding servlet, but another one in the same position as him can!

It’s really metaphysics

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template