Idea下springboot+easyUI的下載與整合
阿新 • • 發佈:2018-12-12
easyUI的地址:http://www.jeasyui.com/download/index.php
easyui的中文學習網站:http://www.jeasyui.net/
我的springboot的專案結構:
在中文網站放置一個demo試一試:
配置檔案:
application.properties的配置:
點選訪問:http://localhost:8080/dialogs#
成功調取了html的頁面!
html的頁面就拉去了一個demo:dialog.html
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Basic Panel - jQuery EasyUI Demo</title> <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css"> <link rel="stylesheet" type="text/css" href="easyui/themes/demo/demo.css"> <script type="text/javascript" src="easyui/jquery.min.js"></script> <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script> </head> <body> <h2>Basic Panel</h2> <p>The panel is a container for other components or elements.</p> <div style="margin:20px 0 10px 0;"> <a href="#" class="easyui-linkbutton" onclick="javascript:$('#p').panel('open')">Open</a> <a href="#" class="easyui-linkbutton" onclick="javascript:$('#p').panel('close')">Close</a> </div> <div id="p" class="easyui-panel" title="Basic Panel" style="width:700px;height:200px;padding:10px;"> <p style="font-size:14px">jQuery EasyUI framework helps you build your web pages easily.</p> <ul> <li>easyui is a collection of user-interface plugin based on jQuery.</li> <li>easyui provides essential functionality for building modem, interactive, javascript applications.</li> <li>using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.</li> <li>complete framework for HTML5 web page.</li> <li>easyui save your time and scales while developing your products.</li> <li>easyui is very easy but powerful.</li> </ul> </div> </body> </html>
cotroller的程式碼:
package com.easyui.easyuidemo.cotroller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * @authorseerhuitao 使用者user * @create2018/12/11 */ @Controller public class UserCotroller { @RequestMapping(value="/dialogs", method = {RequestMethod.POST, RequestMethod.GET}) public String getDialog(){ return "/dialog"; } }
到此成功實現了easyui的前後端呼叫!睡覺。。。。。。。。。。。。。。。。。。。。。。。。。。