提交 bdef260c 编写于 作者: S smileNicky

Merge remote-tracking branch 'origin/1.0.0'

package net.myblog.web.controller;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import net.myblog.entity.Article;
import net.myblog.service.ArticleService;
import net.myblog.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
/**
* 文章归档控制类
*/
@Controller
public class ArchiveArticleController extends BaseController{
......
package net.myblog.web.controller;
import net.myblog.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
* <pre>
* 博客控制类
* </pre>
*
* @author nicky
* <pre>
* 修改记录
* 修改后版本: 修改人: 修改日期: 2019年01月20日 修改内容:
* </pre>
*/
@RequestMapping("/article")
@Controller
public class ArticleController extends BaseController{
@Autowired
ArticleService articleService;
/**
* 博客详情页面
* @return
*/
@RequestMapping(value = "/details")
public ModelAndView details() {
ModelAndView mv = this.getModelAndView();
mv.setViewName("myblog/article/article_details");
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+"/";
String loadBlogUrl = basePath + "toblog.do?pageNo=";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath %>">
<title>Nicky's blog</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Keywords" content="" >
<meta name="Description" content="" >
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="static/blog/css/blog.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Arizonia' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="static/js/jquery-1.8.3.js"></script>
</head>
<body>
<%@ include file="../frame/top.jsp"%>
<div class="blank"></div>
<div class="article">
<div class="content">
<div class="bloglist">
<!--article begin-->
<c:choose>
<c:when test="${not empty articles}">
<c:forEach items="${articles}" var="ar" varStatus="art">
<ul>
<h2>
<a title="${ar.articleName }" href="/" target="_blank">
${ar.articleName }
</a></h2>
<p>${ar.articleContent }</p>
<p >
<span>${ar.articleTime }</span>
<span>作者:</span>
<span>分类:<a href="/" target="_blank">心得笔记</a></span>
<span>阅读(${ar.articleClick })</span>
<span>评论(124)</span>
</p>
</ul>
</c:forEach>
</c:when>
<c:otherwise>
<li>没有相关数据</li>
</c:otherwise>
</c:choose>
<!--article end-->
</div>
</div>
<%@ include file="../frame/navsidebar.jsp" %>
</div>
<%@ include file="../frame/footer.jsp" %>
</body>
</html>
\ No newline at end of file
......@@ -34,7 +34,7 @@ String loadBlogUrl = basePath + "toblog.do?pageNo=";
<c:forEach items="${articles}" var="ar" varStatus="art">
<ul>
<h2>
<a title="${ar.articleName }" href="/" target="_blank">
<a title="${ar.articleName }" href="article/details" target="_blank">
${ar.articleName }
</a></h2>
<p>${ar.articleContent }</p>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册