【发布时间】:2012-02-29 23:19:49
【问题描述】:
我正在尝试在 Spring Roo 中使用 jQuery Mobile。
当我登录到我的应用程序时,应用程序会显示最后包含的 javascript 文件的源代码。
看看下面的 mjquery-scripts.tagx 文件。
请注意,无论最后包含的文件是什么,该文件的源代码都将显示在浏览器中。
地址类似于https://testdomain.com:8080/scripts/jquerymobile/jquery.mobile-1.0.min.js
现在,当我输入 url https://testdomain.com:8080/ 时,我将看到正确的页面。
问题似乎是登录时重定向到路径 scripts/jquerymobile/jquery.mobile-1.0.min.js 。
什么可能导致这个问题?
即使我已经指出 jquery.mobile 这个问题也发生在 jquery.min 上。
默认的 load-scripts.tagx 工作正常。
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0">
<spring:url value="/scripts/jquery-1.7.min.js" var="jQuery_URL" />
<spring:url value="/scripts/jquerymobile/jquery.mobile-1.0.min.css" var="mobile_CSS" />
<spring:url value="/scripts/jquerymobile/jquery.mobile-1.0.min.js" var="mobile_js" />
<link rel="stylesheet" type="text/css" href="${mobile_CSS}"><!-- required for FF3 and Opera --></link>
<script type="text/javascript" src="${jQuery_URL}"><!-- required for FF3 and Opera --></script>
<script type="text/javascript" src="${mobile_js}"><!-- required for FF3 and Opera --></script>
【问题讨论】: