【发布时间】:2017-07-23 08:29:24
【问题描述】:
我正在解决我的 gwt+spring 安全简单应用程序中的 css/js 访问问题。所以,我有下一个方法的安全控制器:
@GetMapping(value = "/notes")
public ModelAndView index(ModelAndView modelAndView) {
modelAndView.setViewName(VIEW_NOTES);
return modelAndView;
}
顺便说一下,我按照这个article整合了这些技术。所以,多亏了这个控制器方法(我使用 RestController),我们得到了解析视图(简单如 ****):
<!DOCTYPE html>
<html lang="en">
<head>
<title>Notes</title>
<link rel="stylesheet" type="text/css" media="all"
href="../static/css/notes-main.css"></link>
</head>
<body>
<!-- This script tag is what actually loads the GWT module. The -->
<!-- 'nocache.js' file (also called a "selection script") is -->
<!-- produced by the GWT compiler in the module output directory -->
<!-- or generated automatically in development mode. -->
<script language="javascript" src="notesgwtapp/notesgwtapp.nocache.js">
</script>
<!-- Include a history iframe to enable full GWT history support -->
<!-- (the id must be exactly as shown) -->
<iframe src="javascript:''" id="__gwt_historyFrame"
style="width:0;height:0;border:0"></iframe>
<div id="notes"></div>
</body>
</html>
现在最有趣的是我有这两个错误: 获取http://localhost:8080/static/css/notes-main.css403 获取http://localhost:8080/notesgwtapp/notesgwtapp.nocache.js403
顺便说一句,我在为其他视图解析资源方面没有问题。 请帮忙,我该如何处理?如果我错过了代码的某些重要部分,我会添加它。问一下。提前谢谢你。
【问题讨论】: