http://localhost:8080/nutzbook/forum/$%7Bbase%7D/asserts/forum/js/jquery.js
返回的路径中的forum可以去掉吗,怎么设置
@wendal 不是
@wendal HTML文件
@wendal 可以用这个吗
<%=request.getContextPath()%>
@wendal 为什么路径中总是有个forum,那是我的module的模块名,怎么设置可以去除这个?
<img src="./asserts/img/logo.png" alt="aaaaa">
用点后变成了
http://localhost:8080/nutzbook/forum/asserts/img/logo.png
还是多了一个forum,模块名
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>首页</title>
<link rel="stylesheet" href="${base}/asserts/forum/css/common.css">
<link rel="stylesheet" href="${base}/asserts/forum/css/index.css">
</head>
<body>
<!-- header start -->
<div class="topbar">
<div class="topbar-main">
<div class="l">
<a href="javascript:void(0);" onclick="SetHome();">设为首页</a>
<a href="javascript:void(0);" onclick="AddFavorite();">收藏本站</a>
</div>
<div class="r" id="userBox">
<a href="#" id="loginBtn">登录</a>
|
<a href="#" id="regBtn">注册</a>
</div>
</div>
</div>
<div class="wrap">
<div class="header">
<div class="header-main">
<div class="logo l">
<a href="/">
<img src="./asserts/img/logo.png" alt="aaaaa">
</a>
</div>
<div class="form-box r">
<form id="search" action="" method="post">
<input type="text" id="searchText" class="l" placeholder="请输入搜索内容...">
<input type="submit" id="searchBtn" class="search-btn r" value="">
</form>
</div>
</div>
</div>
<!-- header end -->
<!-- main start -->
<div class="website-info">
今日: <em>20152</em>
|
昨日: <em>20152</em>
|
帖子: <em>20152</em>
|
欢迎新会员: <em>aaa</em>
</div>
<div class="main">
<div class="index-list">
<h2>
<span class="index-list-title-ico"></span>
热门手游
<span class="index-list-close"></span>
</h2>
<ul id="hotBox"></ul>
</div>
<div class="index-list">
<h2>
<span class="index-list-title-ico"></span>
推荐手游
<span class="index-list-close"></span>
</h2>
<ul id="recommendBox"></ul>
</div>
<div class="index-list">
<h2>
<span class="index-list-title-ico"></span>
网络游戏
<span class="index-list-close"></span>
</h2>
<ul id="onlineGameBox"></ul>
</div>
<div class="index-list index-list-bottom">
<h2>
<span class="index-list-title-ico"></span>
指娱游戏广场
<span class="index-list-close"></span>
</h2>
<ul id="squareBox"></ul>
</div>
</div>
<!-- main end -->
<!-- footer start -->
<div class="footer">
<div class="footer-info">
<p>
<a href="#">指娱手游简介</a>
<a href="#">|</a>
<a href="#">论坛社区</a>
<a href="#">|</a>
<a href="#">网站合作</a>
<a href="#">|</a>
<a href="#">广告服务</a>
<a href="#">|</a>
<a href="#">免责声明</a>
<a href="#">|</a>
<a href="#">招聘信息</a>
</p>
<p>
Copyright © 1996-2014 SINA Corporation, All Rights Reserved
</p>
<p>版权所有</p>
</div>
<div class="footer-qrcode">
<p>下载Android/ios客户端</p>
<img src="${base}/asserts/img/qrcode.png" alt="bbbbb" />
</div>
</div>
<!-- footer end -->
</div>
<script src="${base}/asserts/forum/js/jquery.js"></script>
<script src="${base}/asserts/forum/js/common.js"></script>
<script src="${base}/asserts/forum/js/index.js"></script>
</body>
</html>
<script src="${base}/asserts/forum/js/jquery.js"></script>
因为没${base}不在jsp/beetl,没有处理, 里面的src值变成了
$%7Bbase%7D/asserts/forum/js/jquery.js
这是一个相对路径, 然后加上当前网页URL http://localhost:8080/nutzbook/forum/
就变成
http://localhost:8080/nutzbook/forum/$%7Bbase%7D/asserts/forum/js/jquery.js
@wendal 网页的URL为什么会有我的模块名称呢,不应该是在工程名就结束的吗?
@wendal 是不是我的资源必须放在我的模块名类似的路径下,才可以访问?