alfresco webscript 和 Java servlet 之间的区别

Difference between alfresco webscript and Java servlet

最近我发现 Alfresco 中的文档上传功能支持一个简单的 Java Servlet (UploadContentServlet.java)。我不明白为什么它是 servlet 而不是 webscript。因为在 Alfresco 中无处不在使用网络脚本。 弹出的另一个问题是 Alfresco webscript 和 Java Servlet 之间的区别是什么?它们看起来几乎相同,除了创建它们的过程和可以使用一些 ftl 模板自定义的 Alfresco WebScript 响应。 还有其他区别吗?

您可以在此处找到 Alfresco UploadContentServlet,UploadContentServlet 是

Responsible for streaming content directly from servers into the repository using the HTTP PUT command. The NodeRef of the node onto which the content will be streamed can be encoded into the URL. In this situation the content of the property can be considered to be updated once the servlet has returned.

它与 URL 可寻址性相关,该主题似乎已在较新的 Alfresco 版本中停止使用。 顺便说一下,我认为原因可能是使用 servlet 效率更高,尤其是在上传大文件时。

主要是webscripts比servlets更容易编写和维护。此外,如果您更改了服务器端 javascript 文件中的某些内容,您所要做的就是重新加载容器,而不是重新加载应用程序的上下文。 此 link 可能会向您展示架构 Web Script Framework,即使它很旧,该信息对于较新版本的平台仍然有效。 Ftl 模板非常有用,请记住该平台为您提供了大量可在您的网络脚本中使用的根对象。