2015-10-31 52 views
0

所以这是我的文件夹看起来像(Grails的)GSP与semanticui

enter image description here

我有两个文件一个是GSP一个是HTML,这是两个

<html> 
<head> 
<link rel="stylesheet" type="text/css" href="dist/semantic.min.css"> 
<script src="semantic/semantic.min.js"></script> 
</head> 
<body> 
    haluaw 
    <button class="ui primary button"> 
    Save 
</button> 
<button class="ui button"> 
    Discard 
</button> 
</body> 
</html> 
完全相同的代码

这是怎么了GSP的样子

enter image description here

,这是它看起来像在HTML

enter image description here

为什么它不能在普惠制,而它在HTML工作..它的同一个文件夹和相同的代码

回答

1

这是因为路径的CSS gsp是错误的。 html文件查找文件夹结构,并找到CSS文件。但是,Grails应用程序在服务器URL上查找css文件。

您应该将CSS和js文件放在grails应用程序的webapp文件夹中,并提供正确的url路径。

+0

谢谢!不知道它必须放在某个文件夹中 –