简体   繁体   English

(Grails)具有语义的GSP

[英](Grails) GSP with semanticui

So this is how my folder looks like 这就是我的文件夹的样子

在此处输入图片说明

I have two files one is gsp one is html and this is the exact same code for both 我有两个文件,一个是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>

this is how gsp looks like 这就是gsp的样子

在此处输入图片说明

and this is how it looks like in html 这就是它在html中的样子

在此处输入图片说明

Why does it not work in gsp while it works in html.. Its same folder and same code 为什么在gsp中不能在gsp中工作?。相同的文件夹和相同的代码

This is because of path to CSS is wrong for gsp. 这是因为gsp的CSS路径错误。 The html files looks for the folder structure, and it finds the CSS file. html文件查找文件夹结构,然后找到CSS文件。 But, Grails applications looks for css files on server URL. 但是,Grails应用程序会在服务器URL上查找css文件。

You should be placing the CSS and js files in webapp folder in grails application and provide correct url path. 您应该将CSS和js文件放在grails应用程序的webapp文件夹中,并提供正确的url路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM