首页 \ 问答 \ MEF CachedAssemblyCatalog - 延迟加载程序集(MEF CachedAssemblyCatalog - Lazy Loading of Assemblies)

MEF CachedAssemblyCatalog - 延迟加载程序集(MEF CachedAssemblyCatalog - Lazy Loading of Assemblies)

我对旧版MEF中提供的示例中引入的CachedAssemblyCatalog类非常感兴趣,它允许加载只包含导出数据而不是整个程序集的小程序集,并且只在该程序集的一部分为需要。

我想在我的应用程序中使用此功能,但我不确定此代码的稳定性/可靠性,以及是否有关于此功能的未来计划。 它是否计划在不久之后成为MEF不可或缺的一部分?

有没有人在他的应用程序中使用这个代码,并可以分享他的印象? 它稳定吗? 它按预期工作吗? 我对这样一个事实感到有些沮丧,即在Google上几乎没有这种类型的目录数据,并且缓存样本不再出现在当前可用的样本中

任何输入将不胜感激。


I'm very interested in the CachedAssemblyCatalog class introduced in the samples provided in older versions of MEF - which allows loading a small assembly containing just the export data instead of the entire assembly, and only loading the full assembly when a part from that assembly is required.

I'd like to use this feature in my application, but I'm not really sure about the stability/reliability of this code, and whether there are any future plans regarding this feature. Is it scheduled to become an integral part of MEF anytime soon, or at all?

Has anyone used this this code in his application and can share his impressions? Is it stable? Is it working as expected? I'm a bit discouraged by the fact that there is practically no data available for this type of catalog on Google and by the fact that the caching sample no longer appears in the currently available samples.

Any input will be greatly appreciated.


原文:https://stackoverflow.com/questions/10833262
更新时间:2019-07-05 05:36

最满意答案

JSP规范

JSP.5.4 <jsp:include>

...

包含的页面不能更改响应状态代码或设置标题。 这排除了调用setCookie之类的方法。 尝试调用这些方法将被忽略。 该约束等同于施加在RequestDispatcher类的include方法上的约束。

也就是说,尝试设置内容类型将被忽略。


From JSP Specification:

JSP.5.4 <jsp:include>

...

An included page cannot change the response status code or set headers. This precludes invoking methods like setCookie. Attempts to invoke these methods will be ignored. The constraint is equivalent to the one imposed on the include method of the RequestDispatcher class.

That is, attempt to set content type will be ignored.

相关问答

更多
  • 解析语言的作用。 获知请求中的消息主体是用何种方式编码,再对主体进行解析。 Content-Type 被指定为 application/x-www-form-urlencoded;其次,提交的数据按照 key1=val1&key2=val2 的方式进行编码,key 和 val 都进行了 URL 转码。大部分服务端语言都对这种方式有很好的支持。例如 PHP 中,$_POST[‘title’] 可以获取到 title 的值,$_POST[‘sub’] 可以得到 sub 数组。 JSP: JSP全名为Java S ...
  • 从JSP规范 : JSP.5.4 ... 包含的页面不能更改响应状态代码或设置标题。 这排除了调用setCookie之类的方法。 尝试调用这些方法将被忽略。 该约束等同于施加在RequestDispatcher类的include方法上的约束。 也就是说,尝试设置内容类型将被忽略。 From JSP Specification: JSP.5.4 ... An included page cannot change the response status ...
  • 您在此指定的网址对您的网站而言是绝对的,而不是网络应用。 所以尽量使用(用正确名称替换WEBAPPROOT) 或者使其相对: The URL you specify here is absolute for your site, not the web app.
  • 我的情况if(!(s.equals(“Hello”)))失败 这是因为: String s=(String)("").toString(); out.println(s.equals("Hello")); ......和写作几乎一样: out.println("this".equals("that")); 它永远是错误的。 现在我正在尝试将所选值设置为会话变量。 要在会话中设置变量,您需要将表单发送到服务器(忽略AJAX技术 ...
  • 当你这样做: header('Location: http://localhost:8080/ClientModule/student.jsp'); 浏览器只是对指定的URL执行GET请求。 您在上面的行中回显的表单字段不包含在此请求中。 相反,你想要的是这样的: header('Location: http://localhost:8080/ClientModule/student.jsp?username='.$userName); When you do this: ...
  • 您的问题是您将特定于服务器的库复制到/WEB-INF/lib因为它似乎解决了编译错误。 然而,这是错误的解决方案。 你仍然会在运行时遇到麻烦,因为/WEB-INF/lib在类加载中获得优先权,并且由于位置错误,一些必需的东西会丢失,一切都会中断。 您应该将这些特定于服务器的库保留在它们最初所属的位置,而不是移动/复制它们。 您需要做的就是在compiletime类路径中包含他们的磁盘文件系统路径。 一般的IDE(Eclipse,Netbeans等)只需单击即可完成。 Your problem is that ...
  • jsp中的out是一个JspWriter对象,由Jsp自动创建,用于向webpage写入内容,而System.out.print()用于向控制台输出/写入内容。 使用out.println() The out in jsp is a JspWriter object which is created by Jsp automatically, it is used to write something to webpage while System.out.print() is used to output ...
  • 这应该工作 - 或者你可能需要将整个内容放在cdata中 -