You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by GitBox <gi...@apache.org> on 2022/02/13 09:06:33 UTC

[GitHub] [struts] lukaszlenart commented on pull request #528: Potential expression cache enhancement for 2.6 series

lukaszlenart commented on pull request #528:
URL: https://github.com/apache/struts/pull/528#issuecomment-1037946560


   You can inject them via constructor if you want to or provide a factory which will be injected into `OgnlUtil` and this factory will be used to create a proper instance of cache:
   
   ```java
   public OgnlUtil(
       @Inject(StrutsConstants.STRUTS_EXPRESSION_CACHE_FACTORY, required = false) ExpressionCacheFactory cacheFactory
   ) {
       if (cacheFactory == null) {
           // fallback to old mechanism
       } else {
          this.cache = cacheFactory.createCache();
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org