webapp文本编辑器_Project Student:维护Webapp(可编辑)

webapp文本编辑器

这是Project Student的一部分。 其他职位包括带有Jersey的 Web服务 客户端,带有Jersey的 Web服务服务器 , 业务层 , 带有Spring数据的持久性 ,分片集成测试数据 , Webservice集成 , JPA标准查询和维护Webapp(只读) 。

上次我们创建了一个简单的Web应用程序,使我们可以快速浏览数据库。 它的功能非常有限–主要目标是将整个系统(从Web浏览器到数据库)的整个系统组合在一起。 这次我们添加了实际的CRUD支持。

这篇文章是从Jumpstart网站大量借用的,但有很大的不同。 有很多代码,但是很容易重用。

局限性

  • 用户身份验证 –尚未进行身份验证的工作。
  • 加密 -尚未对通信进行加密。
  • 分页 –尚未做出任何努力来支持分页。 Tapestry 5组件将显示分页外观,但始终包含相同的第一页数据。
  • 错误消息 –将显示错误消息,但服务器端错误目前尚无信息。
  • 跨站点脚本(XSS) –尚未做出任何努力来防止XSS攻击。
  • 国际化 –尚未做出任何努力来支持国际化。

目标

我们需要标准的CRUD页面。

首先,我们需要能够创建一门新课程。 当我们没有任何数据时,我们的课程列表应包含一个链接作为默认消息。 (第一个“创建...”是一个单独的元素。)

课程列表Chromium_008

现在,创建页面具有多个字段。 代码唯一地标识一门课程,例如CSCI 101,其名称,摘要和说明应不言自明。

课程编辑器Chromium_006

创建成功后,我们将进入评论页面。

课程编辑器Chromium_002

如果需要进行更改,然后返回更新页面。

课程编辑器Chromium_004

任何时候我们都可以返回列表页面。

课程列表Chromium_001

在删除记录之前,系统会提示我们进行确认。

Course-List-Chromium_005

最后,我们可以显示服务器端错误,例如,即使当前消息非常无用,也要显示唯一字段中的重复值。

课程编辑器Chromium_007

我们也有客户端错误检查,尽管我在这里没有显示。

Index.tml

我们从索引页面开始。 这类似于我们在上一篇文章中看到的内容。

Tapestry 5具有三种主要类型的链接。 页面链接映射到标准HTML链接。 一个ActionLink的是直接由相应的类,例如,Index.javaIndex.tml模板处理。 最后,事件链接将事件注入挂毯引擎内的正常事件流。 我所有的链接都转到一个密切相关的页面,所以我使用一个动作链接。

<html t:type="layout" title="Course List"t:sidebarTitle="Framework Version"xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"xmlns:p="tapestry:parameter"><t:zone t:id="zone">   <p>"Course" page</p><t:actionlink t:id="create">Create...</t:actionlink><br/><t:grid source="courses" row="course" include="code, name,creationdate" add="edit,delete"><p:codecell><t:actionlink t:id="view" context="course.uuid">${course.code}</t:actionlink></p:codecell><p:editcell><t:actionlink t:id="update" context="course.uuid">Edit</t:actionlink></p:editcell><p:deletecell><t:actionlink t:id="delete" context="course.uuid" t:mixins="Confirm" t:message="Delete ${course.name}?">Delete</t:actionlink></p:deletecell><p:empty><p>There are no courses to display; you can <t:actionlink t:id="create1">create</t:actionlink> one.</p></p:empty></t:grid></t:zone><p:sidebar><p>[<t:pagelink page="Index">Index</t:pagelink>]<br/>[<t:pagelink page="Course/Index">Courses</t:pagelink>]</p></p:sidebar></html>

确认混入

Index.tml模板在删除操作链接上包含一个“ mixin”。 它使用javascript和Java的混合显示弹出消息,要求用户确认他要删除课程。

此代码直接来自Jumpstart和Tapestry网站。

// from http://jumpstart.doublenegative.com.au/
Confirm = Class.create({initialize: function(elementId, message) {this.message = message;Event.observe($(elementId), 'click', this.doConfirm.bindAsEventListener(this));},doConfirm: function(e) {// Pop up a javascript Confirm Box (see http://www.w3schools.com/js/js_popup.asp)if (!confirm(this.message)) {e.stop();}}
})// Extend the Tapestry.Initializer with a static method that instantiates a Confirm.Tapestry.Initializer.confirm = function(spec) {new Confirm(spec.elementId, spec.message);
}

相应的Java代码是

// from http://jumpstart.doublenegative.com.au/
@Import(library = "confirm.js")
public class Confirm {@Parameter(name = "message", value = "Are you sure?", defaultPrefix = BindingConstants.LITERAL)private String message;@Injectprivate JavaScriptSupport javaScriptSupport;@InjectContainerprivate ClientElement clientElement;@AfterRenderpublic void afterRender() {// Tell the Tapestry.Initializer to do the initializing of a Confirm,// which it will do when the DOM has been// fully loaded.JSONObject spec = new JSONObject();spec.put("elementId", clientElement.getClientId());spec.put("message", message);javaScriptSupport.addInitializerCall("confirm", spec);}
}

Index.java

支持索引模板的Java很简单,因为我们只需要定义一个数据源并提供一些动作处理程序即可。

package com.invariantproperties.sandbox.student.maintenance.web.pages.course;public class Index {@Property@Inject@Symbol(SymbolConstants.TAPESTRY_VERSION)private String tapestryVersion;@InjectComponentprivate Zone zone;@Injectprivate CourseFinderService courseFinderService;@Injectprivate CourseManagerService courseManagerService;@Propertyprivate Course course;// our sibling page@InjectPageprivate com.invariantproperties.sandbox.student.maintenance.web.pages.course.Editor editorPage;/*** Get the datasource containing our data.* * @return*/public GridDataSource getCourses() {return new CoursePagedDataSource(courseFinderService);}/*** Handle a delete request. This could fail, e.g., if the course has already* been deleted.* * @param courseUuid*/void onActionFromDelete(String courseUuid) {courseManagerService.deleteCourse(courseUuid, 0);}/*** Bring up editor page in create mode.* * @param courseUuid* @return*/Object onActionFromCreate() {editorPage.setup(Mode.CREATE, null);return editorPage;}/*** Bring up editor page in create mode.* * @param courseUuid* @return*/Object onActionFromCreate1() {return onActionFromCreate();}/*** Bring up editor page in review mode.* * @param courseUuid* @return*/Object onActionFromView(String courseUuid) {editorPage.setup(Mode.REVIEW, courseUuid);return editorPage;}/*** Bring up editor page in update mode.* * @param courseUuid* @return*/Object onActionFromUpdate(String courseUuid) {editorPage.setup(Mode.UPDATE, courseUuid);return editorPage;}
}

Editor.tml

CRUD页面可以是三个单独的页面(用于创建,查看和更新​​),也可以是一个页面。 我遵循的是Jumpstart网站使用的模式–一个页面。 老实说-我不确定他为什么做出这个决定-也许是因为页面紧密相关并且他使用事件处理? 无论如何,我将分别讨论这些元素。

创建模板

“创建”模板是一种简单的形式。 您可以看到HTML <input>元素得到了增强,它们具有一些特定于挂毯的属性,以及一些其他标记,例如<t:errors />和<t:submit>。

CustomFormCustomError是标准Tapestry FormError类的本地扩展。 它们目前为空,但允许我们轻松添加本地扩展。

<html t:type="layout" title="Course Editor"t:sidebarTitle="Framework Version"xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter"><t:zone t:id="zone">   <t:if test="modeCreate"><h1>Create</h1><form t:type="form" t:id="createForm" ><t:errors/><table><tr><th><t:label for="code"/>:</th><td><input t:type="TextField" t:id="code" value="course.code" t:validate="required, maxlength=12" size="12"/></td><td>(required)</td></tr><tr class="err"><th></th><td colspan="2"><t:CustomError for="code"/></td></tr><tr><th><t:label for="name"/>:</th><td><input t:type="TextField" t:id="name" value="course.name" t:validate="required, maxlength=80" size="45"/></td><td>(required)</td></tr><tr class="err"><th></th><td colspan="2"><t:CustomError for="name"/></td></tr><tr><th><t:label for="summary"/>:</th><td><input cols="50" rows="4" t:type="TextArea" t:id="summary" value="course.summary" t:validate="maxlength=400"/></td></tr><tr class="err"><th></th><td colspan="2"><t:CustomError for="summary"/></td></tr><tr><th><t:label for="description"/>:</th><td><input cols="50" rows="12" t:type="TextArea" t:id="description" value="course.description" t:validate="maxlength=2000"/></td></tr><tr class="err"><th></th><td colspan="2"><t:CustomError for="description"/></td></tr></table><div class="buttons"><t:submit t:event="cancelCreate" t:context="course.uuid" value="Cancel"/><input type="submit" value="Save"/></div></form></t:if>...
</html>

创建java

  • 相应的java类很简单。 我们必须定义一些自定义事件。
  • ActivationRequestParameter值是从URL查询字符串中提取的。
  • 课程字段包含创建新对象时要使用的值。
  • courseForm字段在模板上包含相应的<form>。
  • indexPage包含对索引页的引用。

有四个名为onEventFromCreateForm的事件处理程序,其中event
可以准备,验证,成功或失败。 每个事件处理程序都有非常特定的角色。

还有一个附加的事件处理程序onCancelCreate() 。 您可以在模板的<t:submit>标记中看到该事件的名称。

/*** This component will trigger the following events on its container (which in* this example is the page):* {@link Editor.web.components.examples.component.crud.Editor#CANCEL_CREATE} ,* {@link Editor.web.components.examples.component.crud.Editor#SUCCESSFUL_CREATE}* (Long courseUuid),* {@link Editor.web.components.examples.component.crud.Editor#FAILED_CREATE} ,*/
// @Events is applied to a component solely to document what events it may
// trigger. It is not checked at runtime.
@Events({ Editor.CANCEL_CREATE, Editor.SUCCESSFUL_CREATE, Editor.FAILED_CREATE })
public class Editor {public static final String CANCEL_CREATE = "cancelCreate";public static final String SUCCESSFUL_CREATE = "successfulCreate";public static final String FAILED_CREATE = "failedCreate";public enum Mode {CREATE, REVIEW, UPDATE;}// Parameters@ActivationRequestParameter@Propertyprivate Mode mode;@ActivationRequestParameter@Propertyprivate String courseUuid;// Screen fields@Propertyprivate Course course;// Work fields// This carries version through the redirect that follows a server-side// validation failure.@Persist(PersistenceConstants.FLASH)private Integer versionFlash;// Generally useful bits and pieces@Injectprivate CourseFinderService courseFinderService;@Injectprivate CourseManagerService courseManagerService;@Componentprivate CustomForm createForm;@Injectprivate ComponentResources componentResources;@InjectPageprivate com.invariantproperties.sandbox.student.maintenance.web.pages.course.Index indexPage;// The codepublic void setup(Mode mode, String courseUuid) {this.mode = mode;this.courseUuid = courseUuid;}// setupRender() is called by Tapestry right before it starts rendering the// component.void setupRender() {if (mode == Mode.REVIEW) {if (courseUuid == null) {course = null;// Handle null course in the template.} else {if (course == null) {try {course = courseFinderService.findCourseByUuid(courseUuid);} catch (ObjectNotFoundException e) {// Handle null course in the template.}}}}}// /// CREATE// /// Handle event "cancelCreate"Object onCancelCreate() {return indexPage;}// Component "createForm" bubbles up the PREPARE event when it is rendered// or submittedvoid onPrepareFromCreateForm() throws Exception {// Instantiate a Course for the form data to overlay.course = new Course();}// Component "createForm" bubbles up the VALIDATE event when it is submittedvoid onValidateFromCreateForm() {if (createForm.getHasErrors()) {// We get here only if a server-side validator detected an error.return;}try {course = courseManagerService.createCourse(course.getCode(), course.getName(), course.getSummary(),course.getDescription(), 1);} catch (RestClientFailureException e) {createForm.recordError("Internal error on server.");createForm.recordError(e.getMessage());} catch (Exception e) {createForm.recordError(ExceptionUtil.getRootCauseMessage(e));}}// Component "createForm" bubbles up SUCCESS or FAILURE when it is// submitted, depending on whether VALIDATE// records an errorboolean onSuccessFromCreateForm() {componentResources.triggerEvent(SUCCESSFUL_CREATE, new Object[] { course.getUuid() }, null);// We don't want "success" to bubble up, so we return true to say we've// handled it.mode = Mode.REVIEW;courseUuid = course.getUuid();return true;}boolean onFailureFromCreateForm() {// Rather than letting "failure" bubble up which doesn't say what you// were trying to do, we trigger new event// "failedCreate". It will bubble up because we don't have a handler// method for it.componentResources.triggerEvent(FAILED_CREATE, null, null);// We don't want "failure" to bubble up, so we return true to say we've// handled it.return true;}....
}

评论模板

“审阅”模板是一个简单的表。 它以表格形式包装,但仅用于页面底部的导航按钮。

<t:if test="modeReview"><h1>Review</h1><strong>Warning: no attempt is made to block XSS</strong><form t:type="form" t:id="reviewForm"><t:errors/><t:if test="course"><div t:type="if" t:test="deleteMessage" class="error">${deleteMessage}</div><table><tr><th>Uuid:</th><td>${course.uuid}</td></tr><tr><th>Code:</th><td>${course.code}</td></tr><tr><th>Name:</th><td>${course.name}</td></tr><tr><th>Summary:</th><td>${course.summary}</td></tr><tr><th>Description:</th><td>${course.description}</td></tr></table><div class="buttons"><t:submit t:event="toIndex" t:context="course.uuid" value="List"/><t:submit t:event="toUpdate" t:context="course.uuid" value="Update"/><t:submit t:event="delete" t:context="course.uuid" t:mixins="Confirm" t:message="Delete ${course.name}?" value="Delete"/></div></t:if><t:if negate="true" test="course">Course ${courseUuid} does not exist.<br/><br/></t:if></form></t:if>

回顾java

审阅表单所需的Java很简单-我们只需要加载数据即可。 我希望setupRender()足够,但实际上我需要onPrepareFromReviewForm()方法。

public class Editor {public enum Mode {CREATE, REVIEW, UPDATE;}// Parameters@ActivationRequestParameter@Propertyprivate Mode mode;@ActivationRequestParameter@Propertyprivate String courseUuid;// Screen fields@Propertyprivate Course course;// Generally useful bits and pieces@Injectprivate CourseFinderService courseFinderService;@Componentprivate CustomForm reviewForm;@Injectprivate ComponentResources componentResources;@InjectPageprivate com.invariantproperties.sandbox.student.maintenance.web.pages.course.Index indexPage;// The codepublic void setup(Mode mode, String courseUuid) {this.mode = mode;this.courseUuid = courseUuid;}// setupRender() is called by Tapestry right before it starts rendering the// component.void setupRender() {if (mode == Mode.REVIEW) {if (courseUuid == null) {course = null;// Handle null course in the template.} else {if (course == null) {try {course = courseFinderService.findCourseByUuid(courseUuid);} catch (ObjectNotFoundException e) {// Handle null course in the template.}}}}}// /// REVIEW// /void onPrepareFromReviewForm() {try {course = courseFinderService.findCourseByUuid(courseUuid);} catch (ObjectNotFoundException e) {// Handle null course in the template.}}// /// PAGE NAVIGATION// /// Handle event "toUpdate"boolean onToUpdate(String courseUuid) {mode = Mode.UPDATE;return false;}// Handle event "toIndex"Object onToIndex() {return indexPage;}....
}

UPDATE模板

最后,“更新”模板看起来类似于“创建”模板。

<t:if test="modeUpdate"><h1>Update</h1><strong>Warning: no attempt is made to block XSS</strong><form t:type="form" t:id="updateForm"><t:errors/><t:if test="course"><!-- If optimistic locking is not needed then comment out this next line. It works because Hidden fields are part of the submit. --><!-- <t:hidden value="course.version"/> --><table><tr><th><t:label for="updCode"/>:</th><td><input t:type="TextField" t:id="updCode" value="course.code" t:disabled="true" size="12"/></td><td>(read-only)</td></tr><tr class="err"><th></th><td colspan="2"><t:CustomError for="updName"/></td></tr><tr><th><t:label for="updName"/>:</th><td><input t:type="TextField" t:id="updName" value="course.name" t:validate="required, maxlength=80" size="45"/></td><td>(required)</td></tr><tr class="err"><th></th><td colspan="2"><t:CustomError for="updSummary"/></td></tr><tr><th><t:label for="updSummary"/>:</th><td><input cols="50" rows="4" t:type="TextArea" t:id="updSummary" value="course.summary" t:validate="maxlength=400"/></td></tr><tr class="err"><th></th><td colspan="2"><t:CustomError for="updSummary"/></td></tr><tr><th><t:label for="updDescription"/>:</th><td><input cols="50" rows="12" t:type="TextArea" t:id="updDescription" value="course.description" t:validate="maxlength=50"/></td></tr><tr class="err"><th></th><td colspan="2"><t:CustomError for="updDescription"/></td></tr></table><div class="buttons"><t:submit t:event="toIndex" t:context="course.uuid" value="List"/><t:submit t:event="cancelUpdate" t:context="course.uuid" value="Cancel"/><input t:type="submit" value="Save"/></div></t:if><t:if negate="true" test="course">Course ${courseUuid} does not exist.<br/><br/></t:if></form>    </t:if>

更新java

同样,“更新” Java代码看起来很像“创建” Java代码。 最大的区别是,我们必须能够处理在尝试更新数据库之前已删除课程的比赛条件。

@Events({ Editor.TO_UPDATE, Editor.CANCEL_UPDATE,Editor.SUCCESSFUL_UPDATE, Editor.FAILED_UPDATE })
public class Editor {public static final String TO_UPDATE = "toUpdate";public static final String CANCEL_UPDATE = "cancelUpdate";public static final String SUCCESSFUL_UPDATE = "successfulUpdate";public static final String FAILED_UPDATE = "failedUpdate";public enum Mode {CREATE, REVIEW, UPDATE;}// Parameters@ActivationRequestParameter@Propertyprivate Mode mode;@ActivationRequestParameter@Propertyprivate String courseUuid;// Screen fields@Propertyprivate Course course;@Property@Persist(PersistenceConstants.FLASH)private String deleteMessage;// Work fields// This carries version through the redirect that follows a server-side// validation failure.@Persist(PersistenceConstants.FLASH)private Integer versionFlash;// Generally useful bits and pieces@Injectprivate CourseFinderService courseFinderService;@Injectprivate CourseManagerService courseManagerService;@Componentprivate CustomForm updateForm;@Injectprivate ComponentResources componentResources;@InjectPageprivate com.invariantproperties.sandbox.student.maintenance.web.pages.course.Index indexPage;// The codepublic void setup(Mode mode, String courseUuid) {this.mode = mode;this.courseUuid = courseUuid;}// setupRender() is called by Tapestry right before it starts rendering the// component.void setupRender() {if (mode == Mode.REVIEW) {if (courseUuid == null) {course = null;// Handle null course in the template.} else {if (course == null) {try {course = courseFinderService.findCourseByUuid(courseUuid);} catch (ObjectNotFoundException e) {// Handle null course in the template.}}}}}// /// UPDATE// /// Handle event "cancelUpdate"Object onCancelUpdate(String courseUuid) {return indexPage;}// Component "updateForm" bubbles up the PREPARE_FOR_RENDER event during// form rendervoid onPrepareForRenderFromUpdateForm() {try {course = courseFinderService.findCourseByUuid(courseUuid);} catch (ObjectNotFoundException e) {// Handle null course in the template.}// If the form has errors then we're redisplaying after a redirect.// Form will restore your input values but it's up to us to restore// Hidden values.if (updateForm.getHasErrors()) {if (course != null) {course.setVersion(versionFlash);}}}// Component "updateForm" bubbles up the PREPARE_FOR_SUBMIT event during for// submissionvoid onPrepareForSubmitFromUpdateForm() {// Get objects for the form fields to overlay.try {course = courseFinderService.findCourseByUuid(courseUuid);} catch (ObjectNotFoundException e) {course = new Course();updateForm.recordError("Course has been deleted by another process.");}}// Component "updateForm" bubbles up the VALIDATE event when it is submittedvoid onValidateFromUpdateForm() {if (updateForm.getHasErrors()) {// We get here only if a server-side validator detected an error.return;}try {courseManagerService.updateCourse(course, course.getName(), course.getSummary(), course.getDescription(), 1);} catch (RestClientFailureException e) {updateForm.recordError("Internal error on server.");updateForm.recordError(e.getMessage());} catch (Exception e) {// Display the cause. In a real system we would try harder to get a// user-friendly message.updateForm.recordError(ExceptionUtil.getRootCauseMessage(e));}}// Component "updateForm" bubbles up SUCCESS or FAILURE when it is// submitted, depending on whether VALIDATE// records an errorboolean onSuccessFromUpdateForm() {// We want to tell our containing page explicitly what course we've// updated, so we trigger new event// "successfulUpdate" with a parameter. It will bubble up because we// don't have a handler method for it.componentResources.triggerEvent(SUCCESSFUL_UPDATE, new Object[] { courseUuid }, null);// We don't want "success" to bubble up, so we return true to say we've// handled it.mode = Mode.REVIEW;return true;}boolean onFailureFromUpdateForm() {versionFlash = course.getVersion();// Rather than letting "failure" bubble up which doesn't say what you// were trying to do, we trigger new event// "failedUpdate". It will bubble up because we don't have a handler// method for it.componentResources.triggerEvent(FAILED_UPDATE, new Object[] { courseUuid }, null);// We don't want "failure" to bubble up, so we return true to say we've// handled it.return true;}
}

删除模板和Java

编辑器没有显式的“删除”模式,但确实支持删除审阅和更新页面上的当前对象。

// /// DELETE// /// Handle event "delete"Object onDelete(String courseUuid) {this.courseUuid = courseUuid;int courseVersion = 0;try {courseManagerService.deleteCourse(courseUuid, courseVersion);} catch (ObjectNotFoundException e) {// the object's already deleted} catch (RestClientFailureException e) {createForm.recordError("Internal error on server.");createForm.recordError(e.getMessage());// Display the cause. In a real system we would try harder to get a// user-friendly message.deleteMessage = ExceptionUtil.getRootCauseMessage(e);// Trigger new event "failedDelete" which will bubble up.componentResources.triggerEvent(FAILED_DELETE, new Object[] { courseUuid }, null);// We don't want "delete" to bubble up, so we return true to say// we've handled it.return true;} catch (Exception e) {// Display the cause. In a real system we would try harder to get a// user-friendly message.deleteMessage = ExceptionUtil.getRootCauseMessage(e);// Trigger new event "failedDelete" which will bubble up.componentResources.triggerEvent(FAILED_DELETE, new Object[] { courseUuid }, null);// We don't want "delete" to bubble up, so we return true to say// we've handled it.return true;}// Trigger new event "successfulDelete" which will bubble up.componentResources.triggerEvent(SUCCESFUL_DELETE, new Object[] { courseUuid }, null);// We don't want "delete" to bubble up, so we return true to say we've// handled it.return indexPage;}

下一步

显而易见的下一步是改进错误消息,增加对分页,支持以及一对多和多对多关系的支持。 所有这些都需要修改REST负载。 我在管道中还有一些其他项目,例如ExceptionService,更不用说安全问题了。

源代码

  • 可从http://code.google.com/p/invariant-properties-blog/source/browse/student获取源代码。

参考: 项目学生: Invariant Properties博客上来自JCG合作伙伴 Bear Giles的Maintenance Webapp(可编辑) 。

翻译自: https://www.javacodegeeks.com/2014/02/project-student-maintenance-webapp-editable.html

webapp文本编辑器

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/343650.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

交换机的端口结构及端口类型

交换机在同一时刻可进行多个端口对之间的数据传输。每一端口都可视为独立的物理网段&#xff08;注&#xff1a;非IP网段&#xff09;&#xff0c;连接在其上的网络设备独自享有全部的带宽&#xff0c;无须同其他设备竞争使用。那么&#xff0c;你对于交换机的端口结构及端口类…

【渝粤教育】国家开放大学2018年春季 0025-22T数据结构 参考试题

编号&#xff1a;0025 座位号&#xff1a; 17-18学年第1学期期末考试 数据结构 试题 一、选择题&#xff1a;&#xff08;每题2分&#xff0c;共20分&#xff09; 1&#xff0e;在一个单链表中&#xff0c;若要向指针p指向的结点之后插入一个由指针q指向的结点&#xff0c;则…

qt 加载rtsp流_qt_ffmpeg_rtsp 在QT中拉取RTSP视频流并用FFMPEG解码播放 - 下载 - 搜珍网...

压缩包 : d078f445f64e4d494b78433595b8954d.zip 列表FFmpeg-QT-rtsp/FFmpeg-QT-rtsp/README.mdFFmpeg-QT-rtsp/VideoPlayer_2.proFFmpeg-QT-rtsp/bin/FFmpeg-QT-rtsp/bin/VideoPlayer_2.exeFFmpeg-QT-rtsp/bin/avcodec-58.dllFFmpeg-QT-rtsp/bin/avdevice-58.dllFFmpeg-QT-rts…

表示微型计算机系统稳定性,计算机基础知识(三)135

135、微型计算机的运算器、控制器和内存存器的总称是()A 主机B MPUC ALUD CPU136、在微型计算机中&#xff0c;控制器的基本功能是()A 存储各种控制信息B 保持各种控制状态C 实现算数运算和逻辑运算D 控制机器各个部件协调一致工作137、硬盘与软盘相比()A 硬盘容量小B 硬盘旋转…

【渝粤教育】国家开放大学2018年春季 0077-21T古代汉语专题 参考试题

试卷编号&#xff1a;0077 2017—2018学年度第二学期期末考试 古代汉语专题试题 2018年7月 一、名词解释&#xff08;每小题5分&#xff0c;共20分&#xff09; 1&#xff0e;图画文字2&#xff0e;意动动词3&#xff0e;反切注音 4&#xff0e;区别字 1. 朋 2. 宁 3. 监…

交换机用光纤模块互连一端灯不亮或两端都不亮,如何处理?

交换机用光纤模块互连一端灯不亮或两端都不亮如何处理&#xff0c;接下来我们就跟随飞畅科技的小编一起来详细了解下吧&#xff01; 1、使用dis int 相应的接口确认此模块已经被正确的识别&#xff1b; 2、确认两端设备光模块的物理参数是否一致&#xff0c;如波长、速率、距…

Java 12:使用开关表达式进行映射

在本文中&#xff0c;我们将研究Java 12的新功能“ Switch Expressions”&#xff0c;以及如何与Java 12结合使用。 Stream::map操作和其他一些Stream操作。 了解如何使用流和开关表达式使代码更好。 切换表达式 Java 12附带了对“开关表达式”的“预览”支持。 Switch Expre…

openmv串口发送数据_关于arduino和openmv串口通信的问题

#openmv的代码import sensor, image, timeimport jsonfrom pyb import UART# For color tracking to work really well you should ideally be in a very, very,# very, controlled enviroment where the lighting is constant...blue_threshold ( 0, 60, -20, 64, -128, 0)…

【渝粤教育】国家开放大学2018年春季 0175-21T社会调查研究与方法 参考试题

科目编号&#xff1a;0175 座位号 2017-2018学年度第二学期期末考试 社会调查研究与方法 试题 2018年 7 月 一、单选题&#xff08;本大题共10小题&#xff0c;每小题3分&#xff0c;共计30分&#xff09; &#xff08;★请考生务必将答案填入到下面对应序号的答题框中★&…

主流微型计算机,主流微型计算机硬件系统维护

主流微型计算机硬件系统维护通过其芯片技术的革新来缩短存取时间和提高内存访问周期效率的。FP打兰快页模式与EDO打兰占据原PC内存条的大部分市场&#xff0c;但随着电脑进入奔腾时代,SDRAM已作为内存条最新技术要求取代了前两者在新型号电脑上的位置。SDRAM即同步打兰也…

【渝粤教育】国家开放大学2018年春季 0257-22T高级英语听力(1) 参考试题

试卷代码&#xff1a;0257 2017-2018学年度第二学期期末考试 高级英语听力&#xff08;1&#xff09;试题 2018年7月 注 意 事 项 一、将你的准考证号、学生证号、姓名及分校&#xff08;工作站&#xff09;名称填写在答题纸规定栏内。 考试结束后&#xff0c;把试卷和答题纸放…

什么叫POE交换机?POE交换机使用方法介绍?

供电用的交换机&#xff0c;比如安装网络监控时不方便给摄像头拉电线&#xff0c;就可以使用PoE交换机供电&#xff0c;还有弄无线网络时也可以给AP供电&#xff0c;主要方便&#xff0c;关于怎么使用&#xff0c;如果那些需要供电的设备支持PoE直接连接就行了。那么&#xff0…

【渝粤教育】国家开放大学2018年春季 0359-22T会计学原理 参考试题

科目编号&#xff1a;0359 座位号 2017-2018学年第二学期期末考试 基础会计试题 2018 年7月一、单项选择题&#xff1a;请将正确答案填在下面的表格内 &#xff08;每小题2分&#xff0c;共30分&#xff09; 1.企业法定盈余公积金的计算依据是&#xff08; &#xff09;。 A.…

前9个免费的Java进程监视工具以及如何选择一种

这样就可以运行Java代码了。 也许它甚至可以在生产服务器上运行。 在您完成出色工作之后&#xff0c;我们得到了好消息和令人讨厌的消息。 令人讨厌的消息是&#xff0c;现在开始调试。 就是调试和应用程序性能监视。 这意味着您不仅需要查看编写的代码&#xff0c;还可以查看…

redisson的锁的类型_厉害了,中间件Redisson原来这么好用!

点击上方[全栈开发者社区]→右上角[...]→[设为星标⭐]作者&#xff1a;bravoban原文&#xff1a;http://tech.lede.com/2017/03/08/rd/server/Redisson/针对项目中使用的分布式锁进行简单的示例配置以及源码解析&#xff0c;并列举源码中使用到的一些基础知识点&#xff0c;但…

计算机应用与科学专业简介,计算机应用技术学科专业简介

计算机应用技术学科是计算机科学与技术一级学科所属的二级学科。该学科以计算机基本理论为基础&#xff0c;突出计算机理论和技术的实际应用&#xff0c;是计算机科学服务于国民经济的钥匙与纽带。本学科主要研究对于计算机各种应用具有共性的理论、技术和方法&#xff0c;以及…

【渝粤教育】国家开放大学2018年春季 0554-21T立体构成(一) 参考试题

编号&#xff1a;0554 座位号&#xff1a; 2017&#xff5e;2018学年度第二学期期末考试 平面构成 试题 2018年7月 一、设计题&#xff1a;&#xff08;100分&#xff09; 在25cm25cm的方形内&#xff0c;用“自由分割”的构成方式&#xff0c;设计一张广告招贴图。主题不限&a…

q7goodies事例_Java 8 Friday Goodies:新的新I / O API

q7goodies事例在Data Geekery &#xff0c;我们喜欢Java。 而且&#xff0c;由于我们真的很喜欢jOOQ的流畅的API和查询DSL &#xff0c;我们对Java 8将为我们的生态系统带来什么感到非常兴奋。 我们已经写了一些关于Java 8好东西的博客 &#xff0c;现在我们觉得是时候开始一个…

网管交换机与非网管交换机的利弊介绍

交换机可以分为网管交换机以及非网管交换机&#xff0c;网管型交换机就字面上的意思&#xff0c;可以网络管理的交换机&#xff0c;而非网管交换机&#xff0c;是相对网管型交换机而言的&#xff0c;非网管交换机又称为傻瓜型交换机&#xff0c;不需要任何设置&#xff0c;插上…

探探自动配对PHP_CentOS7 - 安装Apache HTTP Server和PHP

安装Apache HTTP Server和PHP你可能听说过LAMP的缩写&#xff0c;它代表Linux&#xff0c;Apache&#xff0c;MySQL和PHP。 它指的是用于提供网站和Web应用程序的流行技术配对。 本文教您如何安装Apache HTTP Server(简称Apache)并将其配置为与PHP一起使用以提供动态Web内容.Ap…