功能描述:
用户在首页http://localhost:8080/SSM_HTTPS/,输入视频名,点击“走 你”按钮,跳转到视频页面,搜索符合你视频名的视频(本项目中只有两个视频,test和test2,没有加任何控制逻辑,后期若想增加操作课自行添加)
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
需要的资源:
SSM框架需要的jar包;(不提供)
需要的js,css文件:
flowplayer-3.2.12.min.js ,favicon.ico ,jquery-1.8.3.js
项目环境:
JDK: 1.6
TOMCAT: 7.0
步骤:
1:搭建ssm框架:(自己随便百度,本项目简单,不适用数据库,只用到了控制器,业务逻辑注入部分已经注释,所以可以在任何电脑运行,不用修改,不会连接数据库,后面需要添加数据库时自己添加控制器的注入,XML配置已经配好了的,数据库连接自己在config里的db.properties修改Mysql连接)
src:
项目的java文件(本项目只用到了控制器)
config:
项目的配置文件,不用修改。
css:
项目需要的css文件。
js:
项目需要的Js文件。
mp4:
项目的MP4资源文件。
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
2:编写欢迎页面index.jsp,在web.xml添加为欢迎界面:
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
Index.jsp:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>视频搜索</title></head><body><!-- main begin--><div> <p><img src="${pageContext.request.contextPath}/images/img1.jpg" width="443" height="314" alt="" /></p></div><form action="login.action" method="post"><div class="login"><dl><dt class="blues">视频搜索</dt><dd><label for="name">视频名:</label><input type="text" name="videoname" class="inputh" value="${videoname}" id="name"/></dd><dd class="buttom"><input name="" type="submit" value="走 你" class="spbg buttombg f14 lf" /><div class="cl"></div></dd></dl></div></form></body></html>
3:编写控制器UserController.java
package com.qut.controller;import org.springframework.stereotype.Controller;import org.springframework.ui.Model;import org.springframework.web.bind.annotation.RequestMapping;import com.qut.pojo.VedioMsg;@Controllerpublic class UserController {//我就不注入了,没用到数据库//@Autowired// private UserService userService;@RequestMapping("/login")public String login(VedioMsg video , Model model){System.out.println("进入login:"+model);model.addAttribute("videoname",video.getVideoname());System.out.println("videoname:"+video.getVideoname());return "Flowplayer";}}
3:编写视频页面Flowplayer.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="${pageContext.request.contextPath}/js/jquery-1.8.3.js"></script>
<%-- <script src="${pageContext.request.contextPath}/js/flowplayer.min.js"></script> --%>
<link rel="shortcut icon" href="http://flash.flowplayer.org/favicon.ico"> <script src="http://releases.flowplayer.org/js/flowplayer-3.2.12.min.js"></script>
<title>Flowplayer</title><style>
body {background-color: white
}.m {width: 840px;height: 500px;margin-left: auto;margin-right: auto;margin-top: 100px;background-color: white
}
</style>
</head>
<body>Model:Flowplayer<br> videoname: ${videoname}<br><div class="m"><a href="${pageContext.request.contextPath}/mp4/${videoname}.mp4" class="player" style="display:block;width:625px;height:200px;" id="player"> </a> <script>flowplayer("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf");</script></div></body>
</html>
——————————————————————————————————
4:运行项目: