Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
smileNicky
myblog
提交
88fd7479
M
myblog
项目概览
smileNicky
/
myblog
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
1
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
myblog
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
88fd7479
编写于
1月 05, 2019
作者:
U
u014427391
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加写文章页面功能
上级
9e40c134
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
95 addition
and
3 deletion
+95
-3
src/src/main/java/net/myblog/web/controller/admin/ArticleAdminController.java
...t/myblog/web/controller/admin/ArticleAdminController.java
+21
-1
src/src/main/webapp/WEB-INF/jsp/admin/article/article_write.jsp
...c/main/webapp/WEB-INF/jsp/admin/article/article_write.jsp
+74
-2
未找到文件。
src/src/main/java/net/myblog/web/controller/admin/ArticleAdminController.java
浏览文件 @
88fd7479
...
...
@@ -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
;
}
}
src/src/main/webapp/WEB-INF/jsp/admin/article/article_write.jsp
浏览文件 @
88fd7479
<%@ 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
<
!-- English --
>
<
script src="../dist/js/languages/en.js"
><
/script
>
<
!-- 繁體中文 --
>
<
script src="../dist/js/languages/zh-tw.js"
><
/script
>
```
</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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录