<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!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=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">
function st(){
window.location.href="startCamera.html" rel="external nofollow" ;
}
function en(){
window.location.href="cancelCamera.html" rel="external nofollow" ;
}
</script>
</head>
<body>
<input type="button" value="开始" onclick="st()"/><input type="button" value="结束" onclick="en()"/>
</body>
</html>
package net.spring.controller;
import java.util.Timer;
import net.spring.utils.CameraTask;
import net.spring.utils.HKTest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HKController {
public Timer timer = null;
public CameraTask mCameraTask = null;
public static boolean status = false;
@RequestMapping("startCamera")
public String startCamera() {
if (!status) {
// HKTest.getInstance().login();
if (timer == null) {
timer = new Timer();
}
if (mCameraTask == null) {
mCameraTask = new CameraTask();
}
timer.schedule(mCameraTask, 0, 1000);
status = true;
}
return "camera";
}
@RequestMapping("cancelCamera")
public String cancelCamera() {
if (status) {
if (timer != null) {
timer.cancel();
timer = null;
}
if (mCameraTask != null) {
mCameraTask.cancel();
mCameraTask = null;
}
// HKTest.getInstance().logout();
status = false;
}
return "camera";
}
}
package net.spring.utils;
import java.util.TimerTask;
public class CameraTask extends TimerTask {
@Override
public void run() {
//dosomthing;
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有