在eclipse maven项目中集成网站模板

时间:2023-01-17 14:16:42

I was wondering if it's possible to integrate a free website template downloaded into an eclipse maven project developed using spring. (I talk about html, javascript, css files). And how to do it ? just copy all files in folders of the projects ?

我想知道是否可以将下载的免费网站模板集成到使用spring开发的eclipse maven项目中。 (我谈论html,javascript,css文件)。怎么做?只是复制项目文件夹中的所有文件?

2 个解决方案

#1


1  

This is an example of directory structure:

这是目录结构的一个例子:

webapp
     |
     resources
     |       |
     |       css (CSS files go here)
     |       |
     |       js (JavaScript files go here)
     |   
     |
     WEB-INF
           |
           views (JSP, html... files go here)

However a big note! As I mentioned, you have to be careful about loading them.

不过要大肆宣传!正如我所提到的,你必须小心加载它们。

I.e. in JSP you load JS and CSS files like this:

即在JSP中你加载JS和CSS文件,如下所示:

<link href="<c:url value="/resources/css/style.css" />"
    rel="stylesheet">
<script src="<c:url value="/resources/js/functions.js" />"></script>

In something like Thymeleaf you will do it like this:

像Thymeleaf这样的东西,你会这样做:

<link th:href="@{/resources/css/style.css}" rel="stylesheet" />

<script th:src="@{/resources/js/functions.js}"></script>

Basically, it depends which template engine you use.

基本上,它取决于您使用的模板引擎。

#2


1  

Yes! You can copy the folders. but you have to include in the build.xml to create the deployment file. should be in under WEB-INF/xyz.. dependent on your request url

是!您可以复制文件夹。但是您必须在build.xml中包含以创建部署文件。应该在WEB-INF / xyz下...取决于你的请求url

#1


1  

This is an example of directory structure:

这是目录结构的一个例子:

webapp
     |
     resources
     |       |
     |       css (CSS files go here)
     |       |
     |       js (JavaScript files go here)
     |   
     |
     WEB-INF
           |
           views (JSP, html... files go here)

However a big note! As I mentioned, you have to be careful about loading them.

不过要大肆宣传!正如我所提到的,你必须小心加载它们。

I.e. in JSP you load JS and CSS files like this:

即在JSP中你加载JS和CSS文件,如下所示:

<link href="<c:url value="/resources/css/style.css" />"
    rel="stylesheet">
<script src="<c:url value="/resources/js/functions.js" />"></script>

In something like Thymeleaf you will do it like this:

像Thymeleaf这样的东西,你会这样做:

<link th:href="@{/resources/css/style.css}" rel="stylesheet" />

<script th:src="@{/resources/js/functions.js}"></script>

Basically, it depends which template engine you use.

基本上,它取决于您使用的模板引擎。

#2


1  

Yes! You can copy the folders. but you have to include in the build.xml to create the deployment file. should be in under WEB-INF/xyz.. dependent on your request url

是!您可以复制文件夹。但是您必须在build.xml中包含以创建部署文件。应该在WEB-INF / xyz下...取决于你的请求url