org.apereo.portal.xml.XmlUtilities.getStylesheetCacheKey()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(205)

本文整理了Java中org.apereo.portal.xml.XmlUtilities.getStylesheetCacheKey()方法的一些代码示例,展示了XmlUtilities.getStylesheetCacheKey()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlUtilities.getStylesheetCacheKey()方法的具体详情如下:
包路径:org.apereo.portal.xml.XmlUtilities
类名称:XmlUtilities
方法名:getStylesheetCacheKey

XmlUtilities.getStylesheetCacheKey介绍

[英]Gets an appropriate cache key for the specified stylesheet resource. The key should be valid for both Transformers and Templates based on this stylesheet.
[中]为指定的样式表资源获取适当的缓存键。该键应该对基于此样式表的转换器和模板都有效。

代码示例

代码示例来源:origin: Jasig/uPortal

  1. @Override
  2. public final CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
  3. final Resource stylesheetResource = this.getStylesheetResource(request);
  4. final Serializable stylesheetCacheKey;
  5. try {
  6. stylesheetCacheKey = this.xmlUtilities.getStylesheetCacheKey(stylesheetResource);
  7. } catch (TransformerConfigurationException e) {
  8. throw new RuntimeException(
  9. "Failed to get Transformer for stylesheet: " + stylesheetResource, e);
  10. } catch (IOException e) {
  11. throw new RuntimeException("Failed to load stylesheet: " + stylesheetResource, e);
  12. }
  13. return CacheKey.build(stylesheetResource.getDescription(), stylesheetCacheKey);
  14. }

代码示例来源:origin: org.jasig.portal/uPortal-rendering

  1. @Override
  2. public final CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
  3. final Resource stylesheetResource = this.getStylesheetResource(request);
  4. final Serializable stylesheetCacheKey;
  5. try {
  6. stylesheetCacheKey = this.xmlUtilities.getStylesheetCacheKey(stylesheetResource);
  7. } catch (TransformerConfigurationException e) {
  8. throw new RuntimeException(
  9. "Failed to get Transformer for stylesheet: " + stylesheetResource, e);
  10. } catch (IOException e) {
  11. throw new RuntimeException("Failed to load stylesheet: " + stylesheetResource, e);
  12. }
  13. return CacheKey.build(stylesheetResource.getDescription(), stylesheetCacheKey);
  14. }

相关文章