Jquery SpringMVC和HTML5
我有一个SpringMVC应用程序,我正在使用Spring标签,但是我在应用程序中寻找一个使用网络摄像头拍照的解决方案,我发现 问题是它使用了一个元素/标记,Spring Taglib没有此标记的定义。我怎么能过来?我需要像弹簧标签一样使用标签,或者有弹簧标签的替代品。下面是我的代码如何工作的示例: 代码Jquery SpringMVC和HTML5,jquery,html,spring,spring-mvc,Jquery,Html,Spring,Spring Mvc,我有一个SpringMVC应用程序,我正在使用Spring标签,但是我在应用程序中寻找一个使用网络摄像头拍照的解决方案,我发现 问题是它使用了一个元素/标记,Spring Taglib没有此标记的定义。我怎么能过来?我需要像弹簧标签一样使用标签,或者有弹簧标签的替代品。下面是我的代码如何工作的示例: 代码 <script type="text/javascript"> $(document).ready(function(){ $("#canvas").
<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>
$(文档).ready(函数(){
$(“#画布”).hide();
$(“摄像头”)。网络摄像头({
宽度:320,
身高:240,
使用麦克风:错误,
模式:“回调”,
swffile:“resources/swf/jscam_canvas_only.swf”,
质量:85,
onSave:saveCB,
onCapture:function(){
$(“#摄影机”).hide();
webcam.save();
$(“#画布”).show();
},
调试:函数(类型、字符串){
$(“#status”).html(type+”:“+string);
}
});
$('#上载')。单击(函数(){
webcam.capture();
返回false;
});
addEventListener(“加载”,函数(){
var canvas=document.getElementById(“canvas”);
if(canvas.getContext){
ctx=document.getElementById(“画布”).getContext(“2d”);
ctx.clearRect(0,03203240);
image=ctx.getImageData(0,03203240);
}
},假);
});
选择性别
输入重量(磅)
如果spring标记不能满足您的需要,您可以尝试编写tagx自定义标记。这些标记是用jsp(x)编写的,而不是用java编写的,因此它们适合于呈现任意html。在spring中需要哪个元素/标记?你能给我介绍一个创建自定义spring tagDocument的例子吗?在这些方面似乎缺乏,但有一点:要看到它们的实际效果,请看一看spring ROO,只需创建一个helloworld项目,就可以看到它们的实际效果。