我有一个SpringMVC应用程序,我正在使用Spring Tags,但是我正在寻找一种解决方案,用于在应用程序中使用网络摄像头拍照,我找到了JQuery 网络摄像头插件。
问题是这使用了一个元素/标签,而Spring Taglib没有这个标签的定义。我怎么能克服这个?我需要像弹簧标签一样使用标签,或者是否有弹簧标签替代品。下面是我的代码如何运行的示例:
代码
<script type="text/javascript">
$(document).ready(function(){
$("#canvas").hide();
$("#camera").webcam({
width: 320,
height: 240,
useMicrophone: false,
mode: "callback",
swffile: "resources/swf/jscam_canvas_only.swf",
quality:85,
onSave: saveCB,
onCapture: function () {
$("#camera").hide();
webcam.save();
$("#canvas").show();
},
debug: function (type, string) {
$("#status").html(type + ": " + string);
}
});
$('#upload').click(function () {
webcam.capture();
return false;
});
window.addEventListener("load", function() {
var canvas = document.getElementById("canvas");
if (canvas.getContext) {
ctx = document.getElementById("canvas").getContext("2d");
ctx.clearRect(0, 0, 320, 240);
image = ctx.getImageData(0, 0, 320, 240);
}
}, false);
});
<label id="status"></label>
<div id="camera"></div>
<div><p><canvas id="canvas" height="240" width="320"></canvas></p></div>
<input id="upload" type="button" value="Take Photo">
<input id="retake" type="button" value="Re-Take Photo">
<ol>
<li>
<label>Select Gender</label>
<form:select path="genderId" id="genderId" title="Select Your Gender">
<form:options items = "${gender.genderList}" itemValue="genderId" itemLabel="genderDesc" />
</form:select>
<form:errors path="genderId" class="errors"/>
</li>
<li><form:label for="weight" path="weight">Enter Weight <i>(lbs)</i></form:label>
<form:input path="weight" id="weight" title="Enter Weight"/><form:errors path="weight" class="errors"/>
</li>