SSM整合+視訊網站開發(day02)
阿新 • • 發佈:2018-12-12
四、後臺管理
1.VideoInfoMapper.xml
<select id="selectAll" parameterType="com.itmayiedu.entity.VideoInfo" resultType="com.itmayiedu.entity.VideoInfo"> select a.id as id,a.video_name as videoName, a.video_html as videoHtml ,a.video_url as videoUrl, a.video_del as videoDel , b.type_name as typeName from video_info as a inner join video_type as b on a.video_type_id=b.id; </select>
2.videoInfoMapper.java 3.videoInfoServiceImpl.java
4.VideoInfoController.java
**5.IndexVideoInfo.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>後臺管理系統</title> </head> <body> <center> <h1>螞蟻視訊後臺管理系統</h1> <a href="locaAddVideo">新增資源</a> <table style="BORDER-COLLAPSE: collapse; text-align: center;" borderColor=#000000 height=40 cellPadding=1 width="70%" align="center" border=1> <thead> <tr> <th>圖片</th> <th>視訊名稱</th> <th>視訊型別</th> <th>預覽視訊</th> </tr> </thead> <tbody> <c:forEach items="${listVideoInfo}" var="p"> <tr style="font-size: 18px"> <td><img alt="" width="150px;" height="150px;" src="static/imgs/${p.videoUrl}"></td> <td>${p.videoName}</td> <td>${p.typeName}</td> <td><a href="videoDetails?id=${p.id}" style='text-decoration:none;'>預覽視訊</a></td> </tr> </c:forEach> </tbody> </table> </center> </body> </html>
注意要點:該jsp檔案裡面有url要被springmvc攔截,要修改springmvc.xml放行指定路徑 要在springmvc.xml裡面加上 最後訪問成功