提交 88fd7479 编写于 作者: U u014427391

添加写文章页面功能

上级 9e40c134
......@@ -13,6 +13,9 @@ import org.springframework.data.domain.Sort.Direction;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("/article")
......@@ -20,7 +23,13 @@ public class ArticleAdminController extends BaseController{
@Autowired ArticleService articleService;
@RequestMapping("/list")
/**
* 跳转到文章列表页面
* @param request
* @param model
* @return
*/
@RequestMapping(value="/list",method=RequestMethod.GET)
public String listAll(HttpServletRequest request,Model model){
String pageNoString = request.getParameter("pageNo");
if(pageNoString==null||"".equals(pageNoString)){
......@@ -35,5 +44,16 @@ public class ArticleAdminController extends BaseController{
model.addAttribute("totalPage",articlePage.getTotalElements());
return "admin/article/article_list";
}
/**
* 跳转到写文章页面
* @return
*/
@RequestMapping(value="/toWriteArticle")
public ModelAndView toWriteArticle() {
ModelAndView mv = this.getModelAndView();
mv.setViewName("admin/article/article_write");
return mv;
}
}
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath %>">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>写博客</title>
<script type="text/javascript" src="plugins/epiceditor-0.2.3/js/epiceditor.min.js"></script>
<title>Insert title here</title>
<link href="<%=basePath %>/plugins/editormd/css/editormd.min.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript"
src="<%=basePath %>/static/js/jquery-1.8.3.js"></script>
<script type="text/javascript"
src="<%=basePath %>/plugins/editormd/editormd.min.js"></script>
</head>
<body>
<div id="layout">
<header>
<h1>Simple example</h1>
</header>
<div id="test-editormd">
<textarea style="display: none;">[TOC]
#### Disabled options
- TeX (Based on KaTeX);
- Emoji;
- Task lists;
- HTML tags decode;
- Flowchart and Sequence Diagram;
#### Editor.md directory
editor.md/
lib/
css/
scss/
tests/
fonts/
images/
plugins/
examples/
languages/
editormd.js
...
```html
&lt;!-- English --&gt;
&lt;script src="../dist/js/languages/en.js"&gt;&lt;/script&gt;
&lt;!-- 繁體中文 --&gt;
&lt;script src="../dist/js/languages/zh-tw.js"&gt;&lt;/script&gt;
```
</textarea>
</div>
<script type="text/javascript">
var testEditor;
$(function() {
testEditor = editormd("test-editormd", {
width : "90%",
height : 640,
syncScrolling : "single",
path : "<%=basePath %>/plugins/editormd/lib/"
});
/*
// or
testEditor = editormd({
id : "test-editormd",
width : "90%",
height : 640,
path : "../lib/"
});
*/
});
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册