search

Home  >  Q&A  >  body text

java - IDEA中jsp页面如何访问webapp下的资源

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

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

引用不到这个js文件

请问应该怎么引入

这样访问仍然不行

ringa_leeringa_lee2802 days ago834

reply all(6)I'll reply

  • 怪我咯

    怪我咯2017-04-18 10:18:49

    Problem solved
    There are no static resources in SpringMVC

    reply
    0
  • PHPz

    PHPz2017-04-18 10:18:49

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



    Waiting for expert help to answer

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:18:49

    <link rel="stylesheet" href="${pageContext.request.contextPath}/templates/style/main.css" />

    reply
    0
  • 阿神

    阿神2017-04-18 10:18:49

    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.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 10:18:49

    前面加上 /

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

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-18 10:18:49

    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

    reply
    0
  • Cancelreply